I'm attempting to write a quick script for my Unix account at work, and I am running into some errors. It's an HPUX system running (gasp!) Perl 4.0 (Revision 4.0.1.8). I don't have any privileges to upgrade to Perl 5.x.
I started creating a script, and wondered if Getopt::Long was available. So I perl -wc'ed it. And it says that use may clash with a future reserved word, and use strict is a syntax error.
Here is the test script (after I tried to simplify it down to the base problem):
#!/usr/contrib/bin/perl # Note that this path to Perl was # verified using 'which perl' use strict; use Getopt::Long; print "Hello, HPUX.\n";
And this is the error message from perl -wc try.pl:
"use" may clash with future reserved word at try.pl line 3. syntax error in file try.pl at line 3, next 2 tokens "use strict" "use" may clash with future reserved word at try.pl line 4. try.pl had compilation errors.
The perldoc -f use reports that all is like it should be. Removal of the Getopt::Long module provides similar results, and this script was created using nano compiled for HPUX (so there isn't an issue with line endings). And just for giggles I checked the results before and after a chmod +x try.pl call, with no changes.
Pointers to web pages would be welcomed, as would ideas to try out. This isn't mission critical or anything, but it is slightly annoying. I don't know enough shell scripting to be able to write my script without Perl...
And of course, a swift kick would be appreciated if I am missing something glaringly obvious. :)
In reply to Perl 4 errors by Nkuvu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |