in reply to Time Conversion

Modelled using tye's date format, but using the very handy strftime from POSIX to avoid date math and string assembly:
use POSIX qw(strftime); sub uptime { local $/ = " "; open my $fh, '<', '/proc/uptime' or die "Can't open /proc/uptime to read: $!\n"; return scalar <$fh>; } print strftime "Last booted %Y-%m-%d/%H:%M:%S\n", ( localtime( time() - uptime() ) );
I originally wrote it using an $uptime temporary with a do block initializer, then noticed I can basically switch to a sub by substituting sub uptime for my $uptime = do. Either way makes the code self-documenting.

Makeshifts last the longest.