in reply to Re^3: Date Handling in Perl
in thread Date Handling in Perl
It's the ternary operator you've botched.
my $subst; for my $hour (5, 12) { $hour > 10 ? $subst = 0 : $subst = 86400; print $subst, "\n"; } for my $hour (5, 12) { $subst = $hour > 10 ? 0 : 86400; print $subst, "\n"; } ## output 86400 86400 86400 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Date Handling in Perl
by aitap (Curate) on Jul 11, 2012 at 17:11 UTC |