behd has asked for the wisdom of the Perl Monks concerning the following question:
use DBI; use strict; my $ndata = "\\\\MYSERVER\\C\$\\Temp"; my $line; my $ndir; my $dblist = `dir $ndata /s`; my @dbline = split /\n/, $dblist; foreach $line (@dbline) { # if ($line =~ m/(??{$ndata})/) { # don't work # if ($line =~ m/$ndata/) { # don't work if ($line =~ m/\\\\MYSERVER\\C\$\\Temp/) { # works BUT I want to u +se $var !!! $ndir = $'; print "$ndir\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pattern matching and interpolation...
by ikegami (Patriarch) on Jun 14, 2006 at 15:55 UTC |