Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Super Find critic needed

by Skeeve (Vicar)
on Jun 30, 2003 at 12:41 UTC ( #270145=note: print w/ replies, xml ) Need Help??

in reply to Super Find critic needed

This comes to my mind:

  1. Why don't you do the replacements in NameReplace instead of pushing all filenames to a global array?
  2. I'd use
    in favour of your 3 replacements.
I don't know whether or not this will be more efficient (untested, incomplete code):
sub NameReplace { if( $_ =~ /\.(?:html?|cfm|cfml|cgi|js|pl)$/) { my $name = $File::Find::name; open ( F, $name ) || warn "$!: $name\n"; $data=join '',<F>; close (F); if ($data=~ s/\bservername(?:\.aa\.company(?:\.zzzz)?\.com)? +\b/NEWNAME.\com/gi) { if (open (F, ">$name")) { print F,$data; close(F); } else { warn "..." } } } }

Comment on Re: Super Find critic needed
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2015-12-01 00:00 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (788 votes), past polls