Re: search and replace on an array
- From: David Squire <David.Squire@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 16:40:59 +0100
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.
}
}
- Follow-Ups:
- Re: search and replace on an array
- From: ebm
- Re: search and replace on an array
- References:
- search and replace on an array
- From: ebm
- Re: search and replace on an array
- From: David Squire
- search and replace on an array
- Prev by Date: Re: search and replace on an array
- Next by Date: Re: search and replace on an array
- Previous by thread: Re: search and replace on an array
- Next by thread: Re: search and replace on an array
- Index(es):
Relevant Pages
|
|