Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
laziness, impatience, and hubris
 
PerlMonks  

Re^5: cp in perl

by Hofmator (Curate)
on Nov 08, 2006 at 07:27 UTC ( #582811=note: print w/ replies, xml ) Need Help??


in reply to Re^4: cp in perl
in thread cp in perl

Well, sadly (or happily) the copy function also works with a directory as the 2nd parameter, copying the 1st parameter into the directory given by the 2nd - and not just file to file. Furthermore, the module gives the possibilty to export functions named 'cp' and 'mv', just like corresponding *nix functions.

These factors make it (sadly!) more probable that copy is assumed to do something it does NOT do, i.e. copy @files, $dir.

Btw, move has the same problems, simply moving its 1st onto its 2nd parameter, silently ignoring any other arguments.

-- Hofmator

Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


Comment on Re^5: cp in perl
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://582811]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (15)
As of 2014-04-16 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (430 votes), past polls