Re: search and replace on an array



Yeah, I know it can be done that way too, but that's not what I'm
really looking for.
This is a part of a larger script and I'm not going to rewrite the
whole this for this.
do you have any ideas on how to search and replace on an array?

Thanks!

David Squire wrote:
David Squire wrote:

Why do you want to do this? Why not just interpolate the directory path
and filename into a string at the time it is needed, e.g.:

for my $Dir ('c:/path/to', 'd:/new/path') { # note you don't need to use
Windows style slashes
for my $File ('File1', 'File2') {
open my $FileHandle, "$Dir/$File", '<' or die "Can't open
$Dir/$File:$!";

Whoops! That should be:
open my $FileHandle, '<', "$Dir/$File" or die "Can't open $Dir/$File:$!";

# ... do stuff
}
}

.



Relevant Pages

  • Re: Commonly Trojaned Linux services
    ... >> the script was to have a very fast, ... > Dave Wreski ... There is no administration of reports unless there is a problem. ... w33n3r: Yeah. ...
    (comp.os.linux.security)
  • Re: Doctor Who
    ... script had to shoehorn the "breath" idea. ... Oh yeah, they looked cool. ... Frightening to think anybody thought they could be frightening. ... The Zombies always seemed like such a tiny group of badly performing extras, despite the infinite appearance of their prison. ...
    (uk.media.tv.misc)
  • Re: Start Desktop Manager
    ... >> for kde, cde, gdm and xdm but it either does not exist (yeah, I ... > i used to use this script, ... > set the correct DISPLAY and... ... Thanks a lot, Helmut ...
    (comp.unix.solaris)
  • Re: [SLE] Hacking Question
    ... > Yeah, it's either a virus or a script that's been passed around. ... or at least set decent passwords for those accounts? ...
    (SuSE)
  • Re: Need help extracting green urls from google results pages
    ... > I changed some of the green URLs into pink ... > The other effect is what the script originally does (I added the pink ... > (in the script, which I should fix). ... Yeah, that would be helpful. ...
    (alt.internet.search-engines)