in reply to Re^4: if modifier of a print statement
in thread if modifier of a print statement
I dunno what got my brain working on the ternary operator idea, maybe it was the "and" or "&&" stuff? (no pun intended). I normally don't use this syntax in Perl code.
The main point here is that this is a simple "if","else" condition, not a more complex construction with "and" and "next". That's it! That concept is stunning in its simplicity.
# I think the if/else is better and I think # we agree on that. The if/else can be written like this, but # nobody cares! Let's just stop talking about it! # It simply does NOT matter. We are beating a dead horse if # we worry about this: # /no_proc/ ? print "$_\n" # : print "$_ : in proc\n" ; # # some very few extra parens results in this: # It is crystal clear, there are no "ands, nexts" # that is the MAIN point! # if (/no_proc/) { print "$_\n"; } else { print "$_ : in proc\n" ; }
|
|---|