Hi Folks,
I think that Rodney's looking for something a little more basic.
There are at least 10 variations on doing what you want, some better than
others. This is one way I commonly use.
#! /usr/bin/perl -w
for $arg(@ARGV) {
if ($arg eq "-a") {
$length = shift(@ARGV);
} elsif ($arg eq "-b") {
$width = shift(@ARGV);
} elsif ($arg eq "-ab") {
$height = shift(@ARGV);
} else {
# include any error handling here!
}
}
# Next, check to see if your parameters are all present and in the correct
range!
# Error handling is always a good practice.
Hope this helps.
Sincerely,
Ken
|