What, you don't know what operating you are running?

At any rate, you may or may not have read that tutorial I listed by now but for anybody else lurking around as Anonymous you might consider doing this to see for yourself what might be wrong:

use strict; use warnings; use File::Copy; use File::Find; use Cwd qw|cwd|; my $modem_build_ms = 'I have no clue what should go into model_build_m +s'; my $modem_build_location; my $dir=$ARGV[0]; my $currdir = Cwd::cwd(); print $dir; opendir(DIR, "$dir") || die "Error in opening dir $dir $!"; #die "Bad directory" unless (-d $dir); print "\n$modem_build_ms\n"; my %files = map {$_ => 1} qw(data.txt datascript.pl); find(sub { copy($File::Find::name, $currdir) or die "Can't cp $File::Find::na +me : $! " . Cwd::cwd() if delete $files{$_}; }, $dir); close DIR; __END__ Notice how the output says this: I have no clue what should go into model_build_ms Can't cp ./other/data.txt : No such file or directory C:/Temp/abba/oth +er at (eva l 24) line 20.

I ran this code like this C:\Temp\abba>perl  runall.pl ./other which means that somewhere somebody moved me down into the target folder. If you run this with the argument to the script as the FULL file path however c:/temp/abba/other the code runs as expected.


In reply to Re^3: Error while Copying files from a directory to cwd by Anonymous Monk
in thread Error while Copying files from a directory to cwd by Anonymous Monk

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.