For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > August 2005 > and I gave up the shebang line too









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author and I gave up the shebang line too
newyork799-miscperl@yahoo.com

2005-08-26, 3:56 am

all the boilerplate:

#!/usr/bin/perl -w
use strict

is kind of useless in short programs, isn't it ;-)

just use ./perl my_prog.pl

and bang...you get what you want!

John Bokma

2005-08-26, 7:56 am

newyork799-miscperl@yahoo.com wrote:

> all the boilerplate:
>
> #!/usr/bin/perl -w
> use strict
>
> is kind of useless in short programs, isn't it ;-)
>
> just use ./perl my_prog.pl
>
> and bang...you get what you want!


And one day you will learn that the pl extension can be dropped. Party
time! And if you hack your PATH, you don't even have to type the ./

And a real hacker just does:

perl

and then starts coding :-)

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html

Tintin

2005-08-26, 7:56 am


<newyork799-miscperl@yahoo.com> wrote in message
news:1125037819.099190.13920@g43g2000cwa.googlegroups.com...
> all the boilerplate:
>
> #!/usr/bin/perl -w
> use strict
>
> is kind of useless in short programs, isn't it ;-)
>
> just use ./perl my_prog.pl


I know I shouldn't feed the troll, but....

Do you seriously like cd'ing the the directory perl lives in to execute a
perl script?


Henry Law

2005-08-26, 7:56 am

On 25 Aug 2005 23:30:19 -0700, newyork799-miscperl@yahoo.com wrote:

>all the boilerplate:


Hmm. Look under the little old stone bridge: nobody there.
--

Henry Law <>< Manchester, England
Bernard El-Hagin

2005-08-26, 7:56 am

"Tintin" <tintin@invalid.invalid> wrote:

>
> <newyork799-miscperl@yahoo.com> wrote in message
> news:1125037819.099190.13920@g43g2000cwa.googlegroups.com...
>
> I know I shouldn't feed the troll, but....



Yet you insist on doing it. *sigh*


--
Cheers,
Bernard
Jürgen Exner

2005-08-26, 7:56 am

newyork799-miscperl@yahoo.com wrote:
> all the boilerplate:
>
> #!/usr/bin/perl -w
> use strict
>
> is kind of useless in short programs, isn't it ;-)


Indeed,

use warnings;

is much prefered over "-w"

jue


James Taylor

2005-08-26, 6:57 pm

In article <PQDPe.22699$0U6.1965@trnddc09>,
Jürgen Exner <jurgenex@hotmail.com> wrote:
>
> use warnings;
>
> is much prefered over "-w"


Really? Why?

Not only is -w shorter to type but it doesn't require perl
to load a module to perform what it can do without one.
I always thought "use warnings;" was for people who found
it difficult to remember -w or who just wanted to be more
in-your-face about turning warnings on and didn't mind the
performance hit of loading another module. What did I miss?

--
James Taylor, London, UK PGP key: 3FBE1BF9
To protect against spam, the address in the "From:" header is not valid.
In any case, you should reply to the group so that everyone can benefit.
If you must send me a private email, use james at oakseed demon co uk.

Paul Lalli

2005-08-26, 6:57 pm

James Taylor wrote:
> In article <PQDPe.22699$0U6.1965@trnddc09>,
> J=FCrgen Exner <jurgenex@hotmail.com> wrote:
>
> Really? Why?
>
> Not only is -w shorter to type but it doesn't require perl
> to load a module to perform what it can do without one.
> I always thought "use warnings;" was for people who found
> it difficult to remember -w or who just wanted to be more
> in-your-face about turning warnings on and didn't mind the
> performance hit of loading another module. What did I miss?


For one, it's nice to have a symmetry between the way you enable
warnings ('use warnings;') and the way you temporarily disable warnings
('no warnings').

For two, -w is global. It enables warnings in every script, everything
that's been require()'d or use'd. If you're using a module which is
for some reason not warnings-compliant, -w will report the warnings in
a module that you have no control over. use warnings; only reports
them in your own script.

Paul Lalli

James Taylor

2005-08-26, 6:58 pm

In article <1125070716.379222.186470@g47g2000cwa.googlegroups.com>,
Paul Lalli <mritty@gmail.com> wrote:
>
> James Taylor wrote:
>
> For one, it's nice to have a symmetry between the way you enable
> warnings ('use warnings;') and the way you temporarily disable
> warnings ('no warnings').


Oh, and I thought you just said local $^W = 0;

> For two, -w is global. It enables warnings in every script, everything
> that's been require()'d or use'd.


Isn't that a good thing?

> If you're using a module which is for some reason not
> warnings-compliant,


<shock> You mean people still develop code without warnings?! </shock>
<confusion> How do they ensure their code works before releasing it? </confusion>
<anger> They should be put up against a wall and shot! </anger>

> -w will report the warnings in a module that you have no control over.


Is there such a thing as a module you have no control over?
Surely I could just hack a copy of it and use lib?

> use warnings; only reports them in your own script.


That's clever, I wonder how it does that. Just a minute while I
reach in my standard library... It's not there! My version of
perl has no warnings.pm! If I grabbed a copy of warnings.pm from
elsewhere, would it necessarily work on my version of perl:
version 5.005_03 built for arm-riscos?

If you're tempted to tell me to upgrade, I don't have that luxury.
The original porter of perl to RISC OS has lost interest in keeping
it up to date so I'm stuck with 5.005_03.

--
James Taylor, London, UK PGP key: 3FBE1BF9
To protect against spam, the address in the "From:" header is not valid.
In any case, you should reply to the group so that everyone can benefit.
If you must send me a private email, use james at oakseed demon co uk.

Tad McClellan

2005-08-26, 6:58 pm

James Taylor <spam-block-@-SEE-MY-SIG.com> wrote:
> In article <PQDPe.22699$0U6.1965@trnddc09>,
> Jürgen Exner <jurgenex@hotmail.com> wrote:
>
> Really? Why?



For the same reason that scoped variables are preferred over global ones.


> Not only is -w shorter to type but it doesn't require perl
> to load a module to perform what it can do without one.
> I always thought "use warnings;" was for people who found
> it difficult to remember -w or who just wanted to be more
> in-your-face about turning warnings on and didn't mind the
> performance hit of loading another module. What did I miss?



Scoping.


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
newyork799-miscperl@yahoo.com

2005-08-28, 3:56 am

> And one day you will learn that the pl extension can be dropped. Party
> time! And if you hack your PATH, you don't even have to type the ./
>
> And a real hacker just does:
>
> perl
>
> and then starts coding :-)
>


whoa, whoa, whoa...I stand in awe ;-) ............!

Jürgen Exner

2005-08-28, 7:56 am

John Bokma wrote:
> And a real hacker just does:
>
> perl
>
> and then starts coding :-)


"Real programmers "cp /dev/audio a.out" and whistle into the mike."
- Randal L. Schwartz, 2002

jue


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com