[EMAIL PROTECTED] wrote:
>
> What is the difference between:
>
> $arg = "foo \(bar\)";
> and
> $arg = 'foo \(bar\)';
Interpolation. Read the "Quote and Quote-like Operators" section of the
perlop document.
perldoc perlop
> when using like:
>
> s/$arg/bleah/;
>
> One works, one doesn't.
> Why?
Are you trying to match a literal '(' character?
my $arg = "foo (bar)";
s/\Q$arg\E/bleah/;
Or even better, compile the regular expression first:
my $arg = qr/foo \(bar\)/;
s/$arg/bleah/;
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]