On 11/7/07, Charlie Farinella <[EMAIL PROTECTED]> wrote:
snip
> perl -w -i -p -e "s/testtext/'<% \$bURL %>'/g" test.html
snip

 In this case the text that Perl sees is

BEGIN { $^I = ""; }
BEGIN { $^W = 1; }
LINE: while (defined($_ = <ARGV>)) {
    s/testtext/'<% $bURL %>'/g;
}
continue {
    print $_;
}

because the shell removed one level of escapes.  You could use two
levels of escapes:

perl -MO=Deparse -w -i -p -e "s/testtext/'<% \\\$bURL %>'/g"
BEGIN { $^I = ""; }
BEGIN { $^W = 1; }
LINE: while (defined($_ = <ARGV>)) {
    s/testtext/'<% \$bURL %>'/g;
}
continue {
    print $_;
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to