Hello Monks!
I can see that my the data is there

"Size: 5
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
"
But I am unable to cp to the dir. Any ideas?
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"; }

Is my copy syntax wrong? I humbly await the Monks wisdom.


In reply to Trouble copying files from an array to new dir by lomSpace

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.