I'm installing the IBM Redbook version of perl 5.6.1, and seem to be having odd problems with character encoding. My 3270 emulator is set to code page 287 as I'm in the UK.
The base product works OK if I use internal functions only (printf "Hello World"), but when I tried adding 'use Basename.pm' () to check out my LIB settings, I got the following type of error:
--------------------
# bin/perl test.pl
Syntax error at /usr/local/lib/perl5/5.6.1/File/Basename.pm line 155, near "£_Ý0
¨"
Syntax error at /usr/local/lib/perl5/5.6.1/File/Basename.pm line 156, near "£_Ý0
¨"
Unmatched right curly bracket at /usr/local/lib/perl5/5.6.1/File/Basename.pm lin
e 157, at end of line
------------------------
Examining the code, the ""£_Ý0¨" should be "$_[0]".
After much poking, I used "iconv -f IBM-1047 -t IBM-285 " on the modules, and they now look "right" - i.e. using the expected international characters []^$.
However, now when I run the test job I just get:
-----------------------
Unrecognized character \x4A at /usr/local/lib/perl5/5.6.1/File/Basename.pm line
139.
Compilation failed in require at test.pl line 1.
BEGIN failed--compilation aborted at test.pl line 1.
------------------------
This x4A being apparently a valid $.
So I'm not sure what to do next? Does the perl application expect code to be in a specific code page? Am I misunderstanding the problem completely?
The test.pl runs fine when I write it in oedit having set "export LANG="En_GB.IBM-285""
For reference, it reads:
# cat test.pl
use File::Basename;
{
printf "Hello World\n";
my $name = "/usr/local/bin/perl";
my $basename = basename $name; # gives 'perl'
printf $basename;
}
#
The code may be bad (I pasted it out of a sample), but it's the compilation errors I need to work on first.
Any advice gratefully received.
Regards,
Phil
Phil Bowman
EDS - UK Mainframe Software Services (OSG)
