in reply to Re^3: Dynamically searching subdirs with titles based on year,month, and date
in thread Dynamically searching subdirs with titles based on year,month, and date

It's squawking about your strftime. In a new script, try just this:
use strict; use warnings; use POSIX qw(strftime); my ($m, $y) = strftime ("%b %Y", localtime) =~ m|(\S+)\s(\S+)|; print "$m $y";

That should get you further...

Update:

Replies are listed 'Best First'.
Re^5: Dynamically searching subdirs with titles based on year,month, and date
by lomSpace (Scribe) on Jan 20, 2009 at 16:24 UTC
    Thanks, that has moved me closer to the finish line.
Re^5: Dynamically searching subdirs with titles based on year,month, and date
by lomSpace (Scribe) on Jan 20, 2009 at 17:47 UTC
    Hello,
    use strict; use warnings; use POSIX qw(strftime); my ($m, $y) = strftime ("%b %Y", localtime) =~ m|(\S+)\s(\S+)|; print "$m $y";
    when used in:
    #!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime); my $Results = strftime ("Results %m-%d-%y", localtime) =~ m|(\S+)\s(\S ++)|; print "$Results\n"; #my ($m, $y) = strftime ("%b %Y", localtime) =~ m|(\S+)\s(\S+)|; #print "$m $y\n"; my $root='/home/mgavi/testdir1'; my $seqdir = "/home/mgavi/testdir2/SeqAssembly"; opendir (my $dh, $root); #chdir($newdir); my @files=readdir $dh; for my $f (@files){ my $mod_time=-M $root."/".$f; #skip unless modification date is less than one day ago next if $f eq '.' || $f eq '..' || $mod_time > 1.0; print $f,"\t",$mod_time,"\t",ctime(stat($root."/".$f)->mtime),"\n" +; copy("$f","$seqdir"); } closedir $dh;

    returns:
    1

    I am looking for "Results 01-16-9-09A" to be returned because
    that is the most recent dir in "JAN 2009" directory.