bory has asked for the wisdom of the Perl Monks concerning the following question:
For a channel there can be 2 situations : forever or minutes and hours (in the same command line).My problem is that I don't know how to store for each channel it's corresponding situation. For eg. for the upper case I shall have: Channel number 1 forever 1 minutes 0 hours 0 Channel number 2 forever 0 minutes 10 hours 20 Channel number 3 forever 1 minutes 0 hours 0 Or is it possible to do something like this? Thank you very much, borymy ( @channel, @minutes, @hours, @forever); GetOptions( " channel:s" => \@channel, "minutes:s" => \@minutes, "hours:s" => \@hours, "forever:s" => \@forever); for ( my $i=0; $i<=$#channel; $i++) { print "Channel number $channel[$i] forever $forever[$i] minutes $m +inutes[$i] hours $hours[$i] \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GetOptions problem
by trammell (Priest) on Jan 21, 2005 at 15:55 UTC | |
|
Re: GetOptions problem
by Hena (Friar) on Jan 21, 2005 at 14:45 UTC | |
|
Re: GetOptions problem
by Limbic~Region (Chancellor) on Jan 21, 2005 at 15:03 UTC | |
|
Re: GetOptions problem
by Solo (Deacon) on Jan 21, 2005 at 15:04 UTC | |
|
Re: GetOptions problem
by Tanktalus (Canon) on Jan 21, 2005 at 14:11 UTC | |
|
Re: GetOptions problem
by ambrus (Abbot) on Jan 21, 2005 at 16:48 UTC |