Hello Monks!
I can see that my the data is there
"Size: 5But I am unable to cp to the dir. Any ideas?
Max Index: 4
11354
Size: 5
Max Index: 4
11364
Size: 5
Max Index: 4
11352
Size: 5
Max Index: 4
11376
Size: 5
Max Index: 4
"
foreach my $k (keys(%files)){ print "$k\n"; #get the array from the array reference. #See how the reference gets in the has below. my @arr=@{$files{$k}}; print "Size: ",scalar @arr,"\n"; print "Max Index: ", $#arr,"\n"; #skip unless we have 4 files in the array next unless ( scalar my @array) == 4; #look for KOMP maid directory we want to copy to #glob dirs with a regex something like /$k\D/ - lets call it $KOMP_d +ir $komp_dir = maid_dirs($maid); #Create the sequencing sub dir under $KOMP_dir #so now KOMP_dir=KOMP_dir+"/sequencing" mkdir $komp_dir."/seqeuncing/"; $komp_dir=$komp_dir."/sequencing/"; print "$komp_dir\n"; #now iterate through the array, copying the files. You know the mai +d number ($k) foreach my $f(@arr){ copy("$f","$komp_dir.$f"); print "copying $f to $komp_dir\n"; }
In reply to Trouble copying files from an array to new dir by lomSpace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |