Today's date using Perl?

Easiest way to get it in the form of MM/DD/YY for Perl 5.8.8? Thanks

perl -e 'use POSIX qw/strftime/; @x = split /\//, $ARGV[0]; print strftime("%m/%d/%y",localtime)'
1 Like

@bipinajith: Shouldn't you mention from where you got that perl code? And, that code is an overkill for the actual question.

That explains that unnecessary highlighted section.

Attribution and/or a link is always appreciated, but let's not turn this into unnecessary drama (not saying anyone has done that ;)).

balajesuri, what would you suggest as a simpler alternative? printf + localtime and nothing else? Just curious.

Regards,
Alister

I'm sorry I was just trying to help. I just replaced the hard coded input to localtime. Didn't really check the highlighted section.

@stevensw - please note that this code is courtesy of balajesuri. Please thank him for this, I don't deserve it.

@balajesuri - I hope you are happy now.

I believe that forums are for learning by sharing.