-2

I am running perl script to check whether the IP is present or not. I am getting the error in script.

Perl script: I used use URL::Encode; library, but it threw the below error:

Can't locate URL/Encode.pm in @INC (@INC contains: C:\Strawberry\perl\lib\CPAN C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib .)

So I used direct path as below:

use lib 'C:\Strawberry\perl\lib\CPAN';

my $json_hash={};
$json_hash->{'username'}=$username;
$json_hash->{'response'}=$response;
$json_hash->{'control'}=$control;

my $json_query=URL::Encode::url_encode(JSON::to_json($json_hash));

Suggest me any alternate library or a way to use this library

ikegami
  • 367,544
  • 15
  • 269
  • 518
impika
  • 107
  • 3
  • 11

1 Answers1

2
  1. The code you posted doesn't result in the error you are getting. Your program surely has use URL::Encode; or similar.

  2. There's no point in adding a path to @INC that's already in @INC, so your solution is useless.

  3. The correct fix is to install the missing modules.

  4. You're using an older version of Perl. You might want to consider upgrading. (The message in question has been updated to include the useful hint that you may need need to install the module.)

ikegami
  • 367,544
  • 15
  • 269
  • 518