in reply to perl -s is evil?
Unfortunately, I can't reproduce your results. I get 'password = hello' no matter what, for the following platforms:
- 5.005_03 built for i386-freebsd
- 5.005_03 built for i386-linux
- v5.6.0 built for i386-openbsd
- v5.6.0 built for sun4-solaris
- v5.6.1 built for i386-linux
- v5.6.1 built for MSWin32-x86-multi-thread
update: regarding blakem's one-liner, I see "foo" outputted on all the above platforms. So it looks like a bug. I shall have to revise my opinion regarding -s.
Are you sure that code fragment is what you ran locally? -s isn't that bad. I use it on rare occasions, usually for a short while when a script evolves from needing no command-line switches at all before needing the full-blown mechanism that Getopt::* brings you.
Others may be interested in a tutorial I wrote on the subject a while back: Parsing your script's command line. (Now revised to point to this thread).
--g r i n d e r
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: perl -s is evil?
by blakem (Monsignor) on Nov 15, 2001 at 14:50 UTC | |
by buckaduck (Chaplain) on Nov 16, 2001 at 01:56 UTC | |
by jclovs (Sexton) on Nov 16, 2001 at 21:29 UTC | |
by blakem (Monsignor) on Nov 17, 2001 at 01:43 UTC | |
Re: Re: perl -s is evil?
by malloc (Pilgrim) on Nov 15, 2001 at 21:30 UTC |
In Section
Meditations