Don't ask to ask, just ask | |
PerlMonks |
Re: how add option to my program?by ambs (Pilgrim) |
on Mar 26, 2005 at 19:49 UTC ( [id://442549]=note: print w/replies, xml ) | Need Help?? |
For simple switches (with only one - before the switch) you can use
#!/usr/bin/perl -sWhen you call this script with a swtich (say, -foo) the $foo variable gets defined. If you use it with a value (say, -foo=bar) then $foo will get the 'bar' value. It is not so powerfull as getopt, but is useful for small tasks. Alberto Simões
In Section
Seekers of Perl Wisdom
|
|