azaria has asked for the wisdom of the Perl Monks concerning the following question:
I expect to get -$dir1="D:\\Windows\\programs1"; $dir2="D:\\Windows\\programs2"; $file1 = ="D:\\Windows\\programs1\\a.txt"; ($file2 = $file1) =~ s/$dir1/$dir2/esg; print "file1 -> $file1\n"; print "file2 -> $file2\n";
but i got -file1 -> D:\Windows\programs1\a.txt file2 -> D:\Windows\programs2\a.txt
Any idea ?file1 -> D:\Windows\programs1\a.txt file2 -> D:\Windows\programs1\a.txt
Thanks in advance
azaria
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem in substitution
by ccn (Vicar) on Dec 08, 2008 at 07:31 UTC | |
|
Re: problem in substitution
by poolpi (Hermit) on Dec 08, 2008 at 09:00 UTC | |
|
Re: problem in substitution
by rminner (Chaplain) on Dec 08, 2008 at 13:16 UTC | |
|
Re: problem in substitution
by spmlingam (Scribe) on Dec 08, 2008 at 10:56 UTC |