zee12 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: relative paths...
by AppleFritter (Vicar) on Aug 13, 2014 at 09:28 UTC

    Without having looked at this in detail, I'd say you simply got your paths wrong. What does the directory hierarchy look like?

    You also don't need to shell out to copy files, BTW; there's modules like File::Copy and Win32 (which contains a CopyFile() function) for that purpose.

Re: relative paths...
by frozenwithjoy (Priest) on Aug 13, 2014 at 09:28 UTC

    Hi there. It's hard for me to tell exactly what you want with no code formatting, but let me recommend a few things.

    For converting absolute path to relative path, you should use something like abs2rel from File::Spec.

    For copying files, you should use copy/cp from File::Copy.

    Edit: Use of File::Spec or Path::Class will also make your paths much less prone to errors related to dealing with weird Windows backslashes.

Re: relative paths...
by Anonymous Monk on Aug 13, 2014 at 11:08 UTC
Re: relative paths...
by aitap (Curate) on Aug 13, 2014 at 10:07 UTC
    Maybe your relative copy command fails because your current directory (use Cwd 'getcwd'; print getcwd(), "\n";) is different from what you expect?
Re: relative paths...
by poj (Abbot) on Aug 13, 2014 at 12:21 UTC
    mkdir "$dir1\\BC_TESTCASES" will fail if $dir1 does not exist.
    Consider using File::Path, for example
    #!perl use strict; use File::Path 'make_path'; my $dir = 'xyz1'; make_path("$dir/BC_TESTCASES",{verbose=>1}) or warn "$!";
    poj