It's a conditional ternary operator. You can read about it in perlop. An equivalent to Zaxo's
would be this:print exists $search{$_} ? "$_ : Found $_\n" : "$_ : Not Found $_\n";
The result is the same, but the layout is more compact with less duplication.if (exists $search{$_}) { print "$_ : Found $_\n"; } else { print "$_ : Not Found $_\n"; }
In reply to Re^3: searching 2 arrays
by VSarkiss
in thread searching 2 arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |