Re: Flag for script

2004-04-16 Thread Jose Alves de Castro
Also, take a look at this: #!/usr/bin/perl -s use strict; our $h; if ($h) { print "this is a very special feature"; } The -s switch "interprets -xxx on the command line as a switch and sets the corresponding variable $xxx in the script to 1." There's also something else, which I leave for you

Re: Flag for script

2004-04-15 Thread JupiterHost.Net
Jakob Kofoed wrote: Hello All, I'm trying to create a script with where you can put a flag to the script or not fx run it like: script -h or just script something like: if ( $ARGV[0] =~ /-h/ ) { Try if(defined $ARGV[0]) { if($ARGV[0] eq '-h') { print "Welcome to dash h\n"; } else { print

RE: Flag for script

2004-04-15 Thread Jakob Kofoed
Thanks for all your replies - I have something to work with! Cheers, Jakob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

RE: Flag for script

2004-04-15 Thread Guay Jean-Sébastien
Hello Jakob, > I'm trying to create a script with where you can put a flag to the script or > not > fx run it like: > > script -h > or just > script I would use one of the Getopt::* modules, because parsing command line options is something very standard, and as you add more and more options, th

Re: Flag for script

2004-04-15 Thread James Edward Gray II
On Apr 15, 2004, at 2:10 PM, Jakob Kofoed wrote: Hello All, I'm trying to create a script with where you can put a flag to the script or not fx run it like: script -h or just script something like: if ( $ARGV[0] =~ /-h/ ) { print "You have chosen the very special ability!\n"; } else { print "y

Re: Flag for script

2004-04-15 Thread WilliamGunther
In a message dated 4/15/2004 3:19:04 PM Eastern Daylight Time, [EMAIL PROTECTED] writes: >I'm trying to create a script with where you can put a flag to the script or >not >fx run it like: [Rest snipped] It's best not to deal with @ARGV directly if you want to do the fancy stuff. Look into Getop