"use warnings" not working in Perl 5.8.8
- From: jason@xxxxxxxxxxxxxxx (Mattesonweb)
- Date: Sat, 15 Apr 2006 12:02:02 -0400
I am a complete newbie to Perl (although I am an advanced PHP programmer). I have installed ActivePerl-5.8.8.817-MSWin32-x86-257965.msi on my Windows XP machine running Apache 2.0.
I am getting this syntax error:
"use" not allowed in expression at c:\hello_world.pl line 2, at end of line
Here is my script:
!# /usr/bin/perl
use warnings;
print "Hello World!\n";
If I take out the "use warnings" directive an replace with
#! /usr/bin/perl -w
it works fine. However, this PDF (http://learn.perl.org/library/beginning_perl/3145_Chap01.pdf) mentions that after Perl version 5.6.x you should not use:
#! /usr/bin/perl -w
but use
#! /usr/bin/perl
use warnings;
instead.
Call me an idiot, but if I have Perl 5.8.8, shouldn't "use warnings;" work in this program??
thanks for any help!
-j
.
- Follow-Ups:
- Re: "use warnings" not working in Perl 5.8.8
- From: Tom Phoenix
- Re: "use warnings" not working in Perl 5.8.8
- Prev by Date: Re: does rename have problems on W2K, W Server 2003, etc?
- Next by Date: Seperating a scaler into various components.
- Previous by thread: Cannot access file because it is being used by another process
- Next by thread: Re: "use warnings" not working in Perl 5.8.8
- Index(es):
Relevant Pages
|