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
In reply to Re^4: Date Handling in Perl
by Anonymous Monk
in thread Date Handling in Perl
by joeymac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |