[ale] Quick Perl Q

Geoffrey esoteric at 3times25.net
Tue Nov 23 16:54:26 EST 2004


Jonathan Rickman wrote:
> -------------------------
> #!/usr/bin/perl -w
> 
> use strict ;
> use POSIX ;
> use File::Copy ;
> use File::Basename ;
> use File::stat ;
> 
> 
> chdir "/vm1/share/users/cl"
>    or die "BZZZT $!\n" ;
> 
> for my $file (<*.EMB>)
>   { my ($name,$path,$suffix) = fileparse($file,"\.EMB") ;
>     my $mod = (stat $file)[9];
>     my $datestamp = strftime("-%Y%m%d-%H%M%S",localtime($mod)) ;
>     copy $file,"/vm1/share/users/cl/$name$datestamp$suffix"
>       or warn "Cannot copy $file $!\n" ;
>   }
> --------------------------

I think the problem is the '-' in the format.

-- 
Until later, Geoffrey



More information about the Ale mailing list