in reply to Changing parameters
You can't directly type, "myscript $i=200 on the command line and expect it to do what you want. However, it is fairly straightforward to define a default value that can be overridden by some other means.
For example:
my $i = 2; if( exists( $ARGV[0] ) ) { $i = $ARGV[0] };
But if you have anything beyond the most basic of needs in this respect, I suggest you have a look at Getopt::Long, or Getopt::Std. It's best to let one of those modules handle your command-line parsing for you.
Dave
|
|---|