in reply to Re: error in copy folder recursively
in thread error in copy folder recursively

hii Perlbotics
i have tried your suggestion but the error prevails only replacing File/copy/recursive.pm to File/Ncopy.pm
how to install File::Ncopy then

Replies are listed 'Best First'.
Re^3: error in copy folder recursively
by Athanasius (Archbishop) on Jul 04, 2015 at 08:54 UTC

    Hello mrityunjaynath,

    No, stick with the File::Copy::Recursive module. File::NCopy is deprecated, according to its own documentation:

    File::NCopy - Deprecated module. Use File::Copy::Recursive instead.

    To learn how to install modules, see the Monastery’s Installing Modules tutorials. If you already have App::cpanminus installed, the process is as simple as entering:

    >cpanm File::Copy::Recursive

    from the command line.

    Another point: Where does $newpath come from? You need to declare and initialise it before it’s used:

    ... my $newpath = ...; # Provide an initial value here my $source_dirrtl = $newpath . "/rtl"; ...

    Hope that helps,

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Re^3: error in copy folder recursively
by marto (Cardinal) on Jul 04, 2015 at 08:56 UTC

    I'm not sure you understand what people and perl are telling you. The perl error means that File::Copy::Recursive is not installed. The module documentation explains how to install it. Use the cpan method so that dependencies are also installed.

    Later in your code you have:

    my $cp = File::NCopy->new(recursive => 1);

    Your code does not have a use line for this module, like you do have for the other modules.

    I wouldn't recommend manually moving modules around unless you understand what you are doing. In addition I would suggest you take a step back and review the code you've posted.

      you may be right... i am new to perl ..
      as i said i have a source_folder containing some folders and files , i want to copy this folder and its subfolder and files to a target_directory. is there a way around for this thing....
      i am able to copy files but not subfolder

Re^3: error in copy folder recursively
by hippo (Archbishop) on Jul 04, 2015 at 08:48 UTC