in reply to Re^2: searching 2 arrays
in thread searching 2 arrays
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"; }
|
|---|