in reply to s/// and variable interpolation
prints somefile.txt. Also, note the use of \Q...\E to escape meta characters from the interpolated string.$ScriptPath = q(\\SERVER\C\$\APP\BIN); $file = "$ScriptPath\\somefile.txt"; $file =~ s/\Q$ScriptPath\E\\//; print $file;
|
|---|