#!/usr/bin/perl use strict; use warnings; use File::stat; use Date::Format; my $arg=$ARGV[0] // ''; if(not $arg) { print "b what??\n"; exit; } if(not -f $arg) { print "I can't see your file '$arg'\n"; exit; } my $mtime=stat($arg)->mtime; my $date=time2str('%Y-%m-%d',$mtime); my $add='_'.$date; my $target=$arg; $target=~s|\.([^.]+)$|$add.$1|; my $s="/bin/cp -a $arg $target"; if(-f $target) { print "$target is already there.\n"; } #print "$s\n"; system($s);