in reply to Re^2: a simple question...
in thread a simple question...
But then again, you could continue to match keys, and use a slice to access the values inside the if. It all depends on what your needs are.if (my @values = grep {$_} @input{qw(info1 info2 info3)}) { print "Matched values: @values"; } else { print "none of the conditions were met\n"; }
- Millerif (my @matches = grep {$input{$_}} qw(info1 info2 info3)) { print "Matched keys: @matches"; print "Matched values: @input{@matches}"; } else { print "none of the conditions were met\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: a simple question...
by Nkuvu (Priest) on Nov 28, 2007 at 18:07 UTC | |
by wind (Priest) on Nov 28, 2007 at 18:18 UTC |