[ale] Quick Perl Q

Geoffrey esoteric at 3times25.net
Tue Nov 23 16:15:55 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" ;

try changing 'localtime($mod)'

to

scalar localtime($mod)

Quick guess, don't have time to play with it right now. :(


-- 
Until later, Geoffrey



More information about the Ale mailing list