about summary refs log tree commit diff
path: root/thinkperl6/human-seconds.p6
blob: a7b216543890455c898adc179ac320d16ed7e61f (plain) (blame)
1
2
3
4
5
6
7
8
#!/usr/bin/env perl6
# Exercise 4.1
sub MAIN(Int $seconds=240_000) {
    put 'Days: ', $seconds div 86400;
    put 'Hours: ', $seconds div 3600 % 24;
    put 'Minutes: ', $seconds div 60 % 60;
    put 'Seconds: ', $seconds % 60
}