RE: 1st line of perl script

2011-01-10 Thread Sunita Rani Pradhan
On Mon, Jan 10, 2011 at 11:21 AM, Shawn H Corey wrote: > It isn't used if you start your scripts from Windows. It worked for me earlier: On Mon, Jan 10, 2011 at 10:43 AM, Brandon McCaig wrote: > I just tested with Strawberry Perl v5.12.1 in Windows XP with the > following code: > > #!/usr/bin/

Re: 1st line of perl script

2011-01-10 Thread Octavian Rasnita
From: "Bob McConnell" 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 fo

Re: 1st line of perl script

2011-01-10 Thread Octavian Rasnita
From: "Shawn H Corey" > On 11-01-10 10:21 AM, Sunita Rani Pradhan wrote: >> Yes I can use that . Does this -w option works on windows or not ? > > I do believe so but if you `use warnings;` you can turn it off. You > can't do that with -w. > > use warnings; > > { > no warnings; > # some c

Re: 1st line of perl script

2011-01-10 Thread Octavian Rasnita
From: "Sunita Rani Pradhan" > We have -w option for warnings which we specify with the 1st line . How > does it work on windows ? > > -Sunita Yes it works under Windows, but is recommended to not use it anymore. It is better to use (under any OS) instead: use warnings; Because later in some

Re: 1st line of perl script

2011-01-10 Thread Brandon McCaig
On Mon, Jan 10, 2011 at 11:39 AM, Shawn H Corey wrote: > It's the Perl interpreter that looks up the switches on the shebang line, > not Windows. That's what I've been saying... -- Brandon McCaig V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl. Casto

Re: 1st line of perl script

2011-01-10 Thread Shawn H Corey
On 11-01-10 11:29 AM, Brandon McCaig wrote: Invoked like: perl test.pl If I remove the -w from the shebang line then no warning is output. Unless I'm misunderstanding you... It's the Perl interpreter that looks up the switches on the shebang line, not Windows. -- Just my 0.0002 million

Re: 1st line of perl script

2011-01-10 Thread Shawn H Corey
On 11-01-10 11:34 AM, Bob McConnell wrote: And I repeat, it doesn't. Windows looks up the association you defined and then goes through the %PATH% in your environment looking for the first perl.exe it can find. It doesn't even read the file, but passes it as a parameter to perl.exe. At that point

RE: 1st line of perl script

2011-01-10 Thread Bob McConnell
to decide what to do with that first line. Bob McConnell -Original Message- From: Shawn H Corey [mailto:shawnhco...@gmail.com] Sent: Monday, January 10, 2011 11:08 AM To: beginners@perl.org Subject: Re: 1st line of perl script On 11-01-10 10:57 AM, Sunita Rani Pradhan wrote: > Yes I

Re: 1st line of perl script

2011-01-10 Thread Brandon McCaig
On Mon, Jan 10, 2011 at 11:21 AM, Shawn H Corey wrote: > It isn't used if you start your scripts from Windows. It worked for me earlier: On Mon, Jan 10, 2011 at 10:43 AM, Brandon McCaig wrote: > I just tested with Strawberry Perl v5.12.1 in Windows XP with the > following code: > > #!/usr/bin/p

Re: 1st line of perl script

2011-01-10 Thread Shawn H Corey
On 11-01-10 11:15 AM, Brandon McCaig wrote: On Mon, Jan 10, 2011 at 11:07 AM, Shawn H Corey wrote: However, some web servers read the the shebang line and executes what it says. So, you should change any Perl CGIs to point to the perl program. It isn't used to determine the interpreter on Wi

Re: 1st line of perl script

2011-01-10 Thread Brandon McCaig
On Mon, Jan 10, 2011 at 11:07 AM, Shawn H Corey wrote: > It doesn't.  At least, it doesn't if you start the script from Windows. >  What Windows does is look up the extension, *.pl, in the Registry and > launch the program associated with it.  When it starts, perl will check the > first line for a

Re: 1st line of perl script

2011-01-10 Thread Shawn H Corey
On 11-01-10 10:57 AM, Sunita Rani Pradhan wrote: 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 ? It doesn't. At least, it doesn't if you start the script from Windows. What Windows does is look up the extension,

RE: 1st line of perl script

2011-01-10 Thread Bob McConnell
or 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

RE: 1st line of perl script

2011-01-10 Thread Sunita Rani Pradhan
beginners@perl.org Subject: Re: 1st line of perl script On Mon, Jan 10, 2011 at 10:32 AM, Shawn H Corey 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: #

Re: 1st line of perl script

2011-01-10 Thread Brandon McCaig
On Mon, Jan 10, 2011 at 10:32 AM, Shawn H Corey 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

Re: 1st line of perl script

2011-01-10 Thread Shawn H Corey
On 11-01-10 10:21 AM, Sunita Rani Pradhan wrote: Yes I can use that . Does this -w option works on windows or not ? I do believe so but if you `use warnings;` you can turn it off. You can't do that with -w. use warnings; { no warnings; # some code } -- Just my 0.0002 million doll

RE: 1st line of perl script

2011-01-10 Thread Sunita Rani Pradhan
al Message- >From: Donald Calloway [mailto:donald.callo...@gmail.com] >Sent: Sunday, January 09, 2011 6:42 PM >To: beginners@perl.org >Subject: Re: 1st line of perl script > >I think there is no error thrown by Windows (or any other architecture) > >because this line is

Re: 1st line of perl script

2011-01-10 Thread Christian Marquardt
al Message- >From: Donald Calloway [mailto:donald.callo...@gmail.com] >Sent: Sunday, January 09, 2011 6:42 PM >To: beginners@perl.org >Subject: Re: 1st line of perl script > >I think there is no error thrown by Windows (or any other architecture) > >because this line is

RE: 1st line of perl script

2011-01-10 Thread Sunita Rani Pradhan
We have -w option for warnings which we specify with the 1st line . How does it work on windows ? -Sunita -Original Message- From: Donald Calloway [mailto:donald.callo...@gmail.com] Sent: Sunday, January 09, 2011 6:42 PM To: beginners@perl.org Subject: Re: 1st line of perl script I

Re: 1st line of perl script

2011-01-10 Thread Donald Calloway
I think there is no error thrown by Windows (or any other architecture) because this line is never compiled because of the # in front which signifies the line as comments. On Tue, 04 Jan 2011 00:33:18 -0500, Sunita Rani Pradhan wrote: Hi All Perl script works without the

Re: 1st line of perl script

2011-01-04 Thread Shawn H Corey
On 11-01-04 02:56 PM, Chap Harrison wrote: Although I don't know if this works on Windows, I notice that nobody has mentioned... #!/usr/bin/env perl No, it doesn't. In the Windows Registry, the *.pl extension is linked to the perl program. Double-clicking on a *.pl file will run perl with

Re: 1st line of perl script

2011-01-04 Thread Chap Harrison
On Jan 4, 2011, at 12:09 AM, George Worroll wrote: > I would, however, recommend that you use the "#!/usr/bin/perl" line even on > Windows. It will make things a little easier if you have to move the script > over to a Unix like system. It won't cause any problems in windows, it will > just g

Re: 1st line of perl script

2011-01-04 Thread George Worroll
On 1/4/11 4:31 AM, John Delacour wrote: On UNIX/ Mac OS X it also gives you the option of using a variety of perl installations. For example the Apple installation of Perl is made in /usr/bin but the default installation is in /usr/local/bin and other programs might make further installations

Re: 1st line of perl script

2011-01-04 Thread John Delacour
At 01:09 -0500 04/01/2011, George Worroll wrote: On 1/4/11 12:33 AM, Sunita Rani Pradhan wrote: Perl script works without the first line ( perl Interpreter : #! /usr/bin/perl) . What is the real use of this line ? This line does not through any error on Windows where , this path

Re: 1st line of perl script

2011-01-04 Thread Alan Haggai Alavi
Hi Sunita, >            Perl script  works without the first line ( perl Interpreter > : #! /usr/bin/perl) . What is the real use of this line ? This line does > not through any error on Windows where , this path does not exist . It is a shebang line which is only useful in Unix-like operating sy

Re: 1st line of perl script

2011-01-03 Thread Peter Scott
On Tue, 04 Jan 2011 01:09:56 -0500, George Worroll wrote: > On Windows, that line is just a comment. Neither the operating system > nor the interpreter does anything with it. Not quite. Any options on the line (e.g., -T) will be activated. -- Peter Scott http://www.perlmedic.com/ http://w

RE: 1st line of perl script

2011-01-03 Thread Sunita Rani Pradhan
: Sunita Rani Pradhan Cc: beginners@perl.org Subject: Re: 1st line of perl script Hi Sunita, >            Perl script  works without the first line ( perl Interpreter > : #! /usr/bin/perl) . What is the real use of this line ? This line does > not through any error on Windows where , this path

Re: 1st line of perl script

2011-01-03 Thread Octavian Rasnita
same drive in the folder e:\usr and in this case I can use #!/usr/bin/perl as the first line in CGI scripts (although I haven't used CGI scripts for years:) --Octavian - Original Message - From: "Sunita Rani Pradhan" To: Sent: Tuesday, January 04, 2011 7:33 AM Subje

Re: 1st line of perl script

2011-01-03 Thread George Worroll
On 1/4/11 12:33 AM, Sunita Rani Pradhan wrote: Perl script works without the first line ( perl Interpreter : #! /usr/bin/perl) . What is the real use of this line ? This line does not through any error on Windows where , this path does not exist . On Unix, it allows you to run you

Re: 1st line of perl script

2011-01-03 Thread Parag Kalra
Thats called Sha-Bang header also called Magical Bytes. They come into picture when you do not specify the interpreter while executing the script. EG: ./my_script.pl (here no interpreter is specified i.e perl is missing) In this case, script uses the interpreter specified at sha-bang header. An

1st line of perl script

2011-01-03 Thread Sunita Rani Pradhan
Hi All Perl script works without the first line ( perl Interpreter : #! /usr/bin/perl) . What is the real use of this line ? This line does not through any error on Windows where , this path does not exist . Why is it so ? Could anybody explain it clearly? Thanks Sunita