Search code examples
perlpar

Run time error in perl


I have made a standalone exe file by packaging a perl file using PAR::Packager.

The file works perfectly in my system, but it throws an error. if i used it in another system which have windows xp as OS.

The locale codeset (cp936) isn't one that perl can decode,Stopped at Encode/Locale.pm line 94
Compliation failed in require at LWP/UserAgent.pm line 1000

Please give some suggestion.Thanks

Update : the files i have included in the script is

use Encode::Byte;
use strict;
use warnings;
use WWW::Mechanize;
use utf8;

Solution

  • You are missing the following line in your code:

    use Encode::CN;
    

    As you can see in Encode::Byte documentation, cp936 it is not included. But it is listed in Encode::CN docs.

    Adding both packages (Encode::Byte and Encode::CN should solve your problem).