in reply to Conditional style (if, &&) query
$_ eq $target && last foreach @value;
The second I like especially if the 'function' is a flow control keyword like next,last or redo or return. Also where there is no else and the if is expected to most often succeed, or on the contrary where I want to stylistically emphasize something. Like
The third I would do if I thought there was the slightest possibility I would need to have an else or multiple statements. Having said that, generally if there is no need for an else block my reasoning for using the second form usually already applies.die "Whoa! Bad Majo" if $bad_mojo;
Oh yeah, if IIRC this type of stuff is covered in perlstyle quite nicely I thought.
HTH
Yves
--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)
|
|---|