Nkuvu has asked for the wisdom of the Perl Monks concerning the following question:
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. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl 4 errors (look)
by tye (Sage) on Feb 21, 2003 at 18:33 UTC | |
by Nkuvu (Priest) on Feb 21, 2003 at 18:43 UTC | |
|
•Re: Perl 4 errors
by merlyn (Sage) on Feb 21, 2003 at 18:21 UTC | |
by Nkuvu (Priest) on Feb 21, 2003 at 18:59 UTC | |
by Coruscate (Sexton) on Feb 22, 2003 at 07:08 UTC | |
by Nkuvu (Priest) on Feb 22, 2003 at 08:44 UTC | |
|
Re: Perl 4 errors
by Ovid (Cardinal) on Feb 21, 2003 at 18:30 UTC | |
|
Re: Perl 4 errors
by VSarkiss (Monsignor) on Feb 21, 2003 at 18:37 UTC | |
by Nkuvu (Priest) on Feb 21, 2003 at 18:53 UTC |