Hello,
I need to cp the return values to the "$seqdir"
dir, but nothing is happening. Any ideas?
#!/usr/bin/perl use strict; use DateTime; use File::Copy; use File::Find; use File::stat; use Time::localtime; my $now = DateTime->now(time_zone => 'floating'); my $yesterday = $now->subtract(days=>1); my $year = $yesterday->year; my $month = $yesterday->month; my $month_abbr = uc($yesterday->month_abbr);# uppercase string chars my $day = $yesterday->day; my $year_abbr = substr "$year",2,2; my $mdy = $now->strftime("%m-%d-%y"); print "$year\t$year_abbr\t$month\t$month_abbr\t$day\n"; my $root="/Users/mgavi.brathwaite/Desktop/BioinfDev/SequenceAssemblyPr +oject/Sequencing_Results/RESULTS $year/New Version/Amanda Li/$month_a +bbr "."$year"; print "$root\n"; my $seqdir = "/Users/mgavi.brathwaite/Desktop/BioinfDev/SequenceAssemb +lyProject/testdir1"; mkdir $seqdir, 0755; # I want to use File::stat to determine age of dir # to determine if it is recent. This is a filtering # process to determine which files to process my $seq_files = find(\&wanted, $root); copy("$seq_files","$seqdir") or die "File cannot be copied."; sub wanted { my $targetfile = $File::Find::name; next if $targetfile =~ /xls$/; my $mod_time = (-M $targetfile < 1); print "Found it $targetfile\n" if /^(\d+\D\d)_(LacZ|pgK|SD|SU)/; # skip unless mod date is less than one day ago return if ( (-M $targetfile < 1) && (/^(\d+\D\d)_(LacZ|pgK|SD|SU) +/) ); } print "done\n";
In reply to My filtered list is not being returned for cp by lomSpace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |