in reply to Not able to use native linux commands in a perl script

Special attention to the documents re File::Copy, highlighted by toolic!

There are -- occasionally -- valid reason for using shelling to system commands rather than using Perl functions (modules). What you've described is NOT one of them.

And, as others noted, we can't be much (reliable) help without knowing what your code looks like and what error message you're receiving.

  • Comment on Re: Not able to use native linux commands in a perl script

Replies are listed 'Best First'.
Re^2: Not able to use native linux commands in a perl script
by JavaFan (Canon) on Dec 13, 2010 at 21:43 UTC
    I find File::Copy an excellent reason to use system. Things I cannot do with File::Copy:
    1. Preserve the execute bit.
    2. Copy more than one file at a time.
    3. Recursively copy.
    4. Use any of the other arguments of cp.
    5. Use scp with a mostly similar syntax as cp for copying to different machines.
    Luckely the destructiveness doing of File::Copy::copy("file1", "file2", "dir") has been fixed in 5.12.

    I never use File::Copy anymore. I've spend way too much time fighting it. system "cp" never, ever surprises me, and always just works.