Jen11 has asked for the wisdom of the Perl Monks concerning the following question:

Perl ActiveState was downloaded to windowsxp computer, the hello program will not run. 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 This outputs the whole hello.pl script text file instead of just "hello world". When the command "perl -w perlscipts" is run, the following error is: "panic: utf16_to_utf8: odd bytelen 47 at hello.pl line1." The command "perl -v" outputs the installation version of Perl, so I assumed it was installed alright. The "perl -h" command also outputs the list of Perl commands. The documentation states if the example.pl script did not run, there is something wrong with the installation, I assume perl was installed in the c directory named perl. I would appreciate any information on what might be wrong and how to fix it. Regards Jen

Replies are listed 'Best First'.
Re: Active State not working on Windows
by ikegami (Patriarch) on Sep 08, 2008 at 23:42 UTC

    Your script (hello.pl) starts with a UTF-16 BOM, but isn't a valid UTF-16 file.

    >perl -e"print qq{\xFE\xFF\x31}" | perl panic: utf16_to_utf8: odd bytelen 1.
Re: Active State not working on Windows
by cdarke (Prior) on Sep 09, 2008 at 07:39 UTC
    Or maybe you used Word (or something like it) to generate the script? Use Notepad, Wordpad, or any of the hundreds of other text editors out there.