in reply to To Pattern Match or not to Pattern Match
The "operator to state if nothing matches" might be grep. Something like:
for my $user_id (@cdwv_list) { my ($names) = grep(/^\Q$user_id/, @names); if ($names) { ($name) = $names =~ /\/([\w\s]+)\|/; } else { print "$userid does not exist in name list\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: To Pattern Match or not to Pattern Match
by Anonymous Monk on Mar 04, 2005 at 00:35 UTC |