It doesn't, the line starts with a '#' so it is ignored. You have to tell 
MS-Windows to associate .pl files with perl.exe. Then the OS does what #! was 
supposed to. But it will always use the same copy of perl.exe, so you don't get 
the ability to use different releases for different scripts.

Bob McConnell

-----Original Message-----
From: Sunita Rani Pradhan [mailto:sunita.prad...@altair.com] 
Sent: Monday, January 10, 2011 10:58 AM
To: Brandon McCaig; Shawn H Corey
Cc: beginners@perl.org
Subject: RE: 1st line of perl script

Yes I agree . Then I am coming back to my 1st question . This path does not 
exist on windows "/usr/bin/perl " , how it works ?


Thanks
Sunita

-----Original Message-----
From: Brandon McCaig [mailto:bamcc...@gmail.com] 
Sent: Monday, January 10, 2011 9:14 PM
To: Shawn H Corey
Cc: beginners@perl.org
Subject: Re: 1st line of perl script

On Mon, Jan 10, 2011 at 10:32 AM, Shawn H Corey <shawnhco...@gmail.com> wrote:
> I do believe so but if you `use warnings;` you can turn it off.  You can't
> do that with -w.

I just tested with Strawberry Perl v5.12.1 in Windows XP with the
following code:

#!/usr/bin/perl -w

my @a;
my $b = @a[0];

__END__

When run, I get:

Scalar value @a[0] better written as $a[0] at test.pl line 4.

So yes, it does seem to work, but I think that 'use warnings;' is best
practice anyway, as Shawn pointed out.

-- 
Brandon McCaig <http://www.bamccaig.com> <bamcc...@gmail.com>
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software <http://www.castopulence.org/> <bamcc...@castopulence.org>

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to