in reply to use strict; and command line options
Anwyay, the solution is actually quite simple, you just need to add use vars qw($useTR);. Here's some sample code and example run:
and sample run:#!/usr/bin/perl use strict; use vars qw($a $b); print "a: $a\n"; print "b: $b\n";
OK, though... all that being said I'd still recomend using Getopt::Long instead of just the -s switch, if for no other reason than that the user has to supply "-s" before your script when they run it (yes, folks, before you jump on me... I tested putting -s in the shebang line and it didn't work... which, frankly, shocked the heck out of me... maybe it's a bug in 5.005_03, or maybe it's a "feature").[me@host]$ perl -s tmp.pl -a a: 1 b: [me@host]$
------------ :Wq Not an editor command: Wq
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use strict; and command line options
by ysth (Canon) on Feb 11, 2004 at 05:29 UTC | |
by etcshadow (Priest) on Feb 11, 2004 at 05:31 UTC | |
|
Re: Re: use strict; and command line options
by etcshadow (Priest) on Feb 11, 2004 at 05:28 UTC |