Instead of removing strict (!), Why not just make strict code clean?
my ($mday, $mon, $year) = (localtime(time))[3, 4, 5]; $mon += 1; $year += 1900; printf "%02d/%02d/%02d\n", $mday, $mon, $year % 100;
Maybe even better (as a more familiar one, looking at someone who asked in terms of Bash):
# At the top, under use strict; use POSIX qw/strftime/; # then later... my $date = strftime "%d/%m/%y", localtime; print "$date\n";
A funny coincidence: Perl Training Australia publishes semi-regular tips (you can get them by email or online), and only today is new at strftime .
Telemachus
source share