Ignacio Lacosta wrote:
!I am starting to work wiith Perl in OS/400 environment (V4R5). In my first
!test I try to call an script wich has comments (#). This make the error:
!
!Unrecognized character \151 in line xxx
!
!The same script without comments works ok.
!
!Whats the problem ?
!
!And the possible solution ? (That were great !)
Thank you for posting. Yours is the first post to this
list from someone actively using perl on OS/400. I cannot
resist asking (even though it might not help find a solution
to your problem) what version of perl are you using?
perl -v
or:
perl -V
ought to provide the answer, from a command line environment.
Where did you obtain perl for OS/400? From CPAN or from
IBM - Rochester Minnesota?
About the problem: the character \151 would be octal
151, or decimal 105. Which should be the character
"N WITH TILDE" under most well known EBCDIC codes.
Since you are posting from Spain, perhaps there are
comments in your code that contain that character(?).
Perhaps you could edit the comments to remove the
N WITH TILDE characters, and say replace them with
simple N characters and see if it is possible
to have perl run your script for you. The other test
would be to run just the # character, for example,
from Unix:
> cat try
print "hello\n";
#
print "goodbye\n";
> perl try
hello
goodbye
Does a script as simple as that work for you without
complaining about the \151 character?
I am curious: what code page are you using on OS/400?
Can you run the command:
chcp
and determine that? As far as I ever heard the
POSIX environment on OS/400 used EBCDIC cp 037,
by default. It could be the case that the perl
code does not know cp 037 as well as it knows
cp 1047.
Peter Prymmer