in reply to Re: array confusion
in thread array confusion
Why use a regexp when you want equality?
if ( grep { $_ eq $system1 } @system_name ) { ...
Going back to the original question: This is a situation where a hash would be more appropriate:
my %system_name = ( box1 => 1, box2 => 1 ); # ... if ( $system_name{$system1} ) { ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: array confusion
by Anonymous Monk on Jul 05, 2004 at 11:00 UTC | |
by edan (Curate) on Jul 05, 2004 at 11:11 UTC |