in reply to Re^2: directories and sub directories and copying or moving hundereds or thousands of files :)
in thread directories and sub directories and copying or moving hundereds or thousands of files :)

if yoru thinking about ... unless something liek this would have worked... See...otherwise its just gonna copy all ove rthe place wont it?

We are rewriting  sub extract_files { to get it down to 20 lines

Will you play along? Write the next line for real

At worst it won't work and you will have wasted 10 minutes

If I do the rewriting, you say "wow great" and then do your own thing anyway

  • Comment on Re^3: directories and sub directories and copying or moving hundereds or thousands of files :)
  • Download Code

Replies are listed 'Best First'.
Re^4: directories and sub directories and copying or moving hundereds or thousands of files :)
by james28909 (Deacon) on Oct 04, 2014 at 07:37 UTC
    hmm. well if i am going to copy a file from dev_flash (folder) i need to read each file in the temp folder, then compare the file i get from searching directories against the filename in the files of the temp folder, then if it matches, copy it to destination.
    foreach my $element($array){ open my $tempfile, '<', $element; foreach $line(<$tempfile>){ if ($line =~ $file_to_copy){ copy ($file_to_copy, "copied_files/$element) } else{ print ''; } }
    i have no idea if that would even work :D
    To me, that is 1 to many of nested foreach loops, but it does look like it would work. ive had bad exeriences with foreach loops and subs :l
        i may have to sleep on this one... haha. i spend a good deal of thinking exactly how i was going to even accomplish this task. let me wake up tomorrow with a fresh pot of coffee and see what i can come up with. cz this is my new hobby. i like programming, i just wish i knew how to do it /better/