DB<105> print 30+($_+($_>7))%2 for 1..12 31 30 31 30 31 30 31 31 30 31 30 31 DB<106> print 30+($_+($_>7))%2-2*($_==2) for 1..12 31 28 31 30 31 30 31 31 30 31 30 31 DB<113> print ((30,31,28)[($_+($_>7))%2-($_==2)]) for 1..12 31 28 31 30 31 30 31 31 30 31 30 31 30 31
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
In reply to Re^2: How do you remember the number of days in each month?
by LanX
in thread How do you remember the number of days in each month?
by chacham
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |