perl-unicode

Re: loading necessary module to Interpreter

2008-09-11 09:12:05
Dear Gemma,

I have downloaded ActiveState for windows, and cannot get scripts to run 
other then the perl -v and perl -h command.
The hello program was saved to the desktop in a folder called "perlscripts". 
The commands typed in the console window are as follows.
cd \desktop
cd \perlscripts
perl hello.pl

(I'm assuming you didn't have \ in those cd commands and that when you do dir 
you can see hello.pl)

 
This outputs the hello.pl script text file instead of just "hello world". 
 The example.pl script in ActivePerl will not output anything.
 When the command "perl -w perlscipts" is run, the following error is:
"panic: utf16_to_utf8: odd bytelen 47 at hello.pl line1."

Well the error looks logical in that *if* hello.pl is in UTF16 (which I doubt. 
But did you open it in Notepad and then save it again?) then since it takes 2 
bytes for each character, having 47 bytes on a line is just wrong. Perhaps 
loading hello.pl into Notepad and then making a minor change (add a space to a 
line and then delete it to 'dirty' the file) then hit save, will sort it out.

 I have been advised this looks like a user error, and that Perl will handle 
UTF character sets, but it needs to prepared before it
encounters them, that the error message looks like what results when you pass 
UTF data to a Perl that has not had the necessary module loaded into the 
interpreter. Could anyone advise where I could find the necessary module and 
how to load it to the interpreter? or how I could work around this.

If you want to dig deeper into this then you can read the perlunicode docs in 
the activestate documentation. But since this is your first program you are 
trying to run, let's get you up and going before you dive into deep water. This 
should be a walk on the beach not a scramble over the rocks.

If you are still having problems, can you attach hello.pl with your reply so we 
can see what is going on (perhaps zip it so it comes in binary, if you can do 
that).

HTH,
GB,
Martin

<Prev in Thread] Current Thread [Next in Thread>