in reply to Re: conditional print. Is correct to use it?
in thread conditional print. Is correct to use it?
Is more about style. I'm in the middle of an iteration. The known route would be:
put an if loop before -> to fix $variable -> and then print "something $variable something"... to a file.
I'm exploring to include the loop directly inside the print line. Start printing "something" to a file -> then include a mini loop to check the current status of the variable and then finish printing "something".
what strategy would be more correct in your opinion? "if(true){a} else {b}" or just (a||b)
(are both equally correct?)
Note: (About why not write just: my $fo; I have a bunch of variables to initialize. Some are expected to be numeric, other will receive a chain. I want to remind who is who. This is the reason to express specifically the empty chain here. (i.e: my $fo = q{}; my $bar = 0;... instead to just write: my ($fo, $bar)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: conditional print. Is correct to use it? (updated)
by AnomalousMonk (Archbishop) on Oct 28, 2020 at 19:29 UTC |