j.goor has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monks,
Consider my next question a very basic question, purely for my own fun:
What is better or more preferred in the next example (and why?):
A)
B)
I was wandering what 'solution' would be better, since I run into these kind of thing regularly and it made me curious if there would be a 'common' way to handle this.
Rgds,
John
Consider my next question a very basic question, purely for my own fun:
What is better or more preferred in the next example (and why?):
A)
Or:my $T; if ($hour > 12) { $hour -= 12; $T = 'PM'; } else { $T = 'AM'; }
B)
See the detail?my $T = 'AM'; if ($hour > 12) { $hour -= 12; $T = 'PM'; }
I was wandering what 'solution' would be better, since I run into these kind of thing regularly and it made me curious if there would be a 'common' way to handle this.
Rgds,
John
Back to
Seekers of Perl Wisdom