diff options
Diffstat (limited to 'thinkperl6/human-seconds.p6')
-rwxr-xr-x | thinkperl6/human-seconds.p6 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/thinkperl6/human-seconds.p6 b/thinkperl6/human-seconds.p6 new file mode 100755 index 0000000..a7b2165 --- /dev/null +++ b/thinkperl6/human-seconds.p6 @@ -0,0 +1,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 +} |