Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Making tmp copies of files

by shotgunefx (Parson)
on Feb 21, 2006 at 19:07 UTC ( [id://531772]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Making tmp copies of files
in thread Making tmp copies of files

This isn't going to work. $1 isn't defined as no capture has taken place.

Try this.
# For foo.htm => foo.htm.tmp opendir( HTMLSTORIES, "$html_dir") || die "HTML files do not exist: $! +"; @FigureArray = grep{/\.htm$/} readdir ( HTMLSTORIES ); foreach $figfile (@FigureArray) { copy ($figfile, "$figfile.tmp") or die "Can not make temporary cop +y of file [$figfile]: $!"; }
BTW, make copies of the original before overwriting them. The last thing you want to do is blow them all away and realize you don't have backups.


-Lee
"To be civilized is to deny one's nature."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 05:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found