-----Original Message-----
From: Bryan Harris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 14, 2004 3:07 AM
To: Beginners Perl
Subject: s/// w/o RE




A quick question for the wizards--

Is it possible to do a substitution without compiling the pattern at all?

**************************************
#!/usr/bin/perl

$ss = "cool???";
$rs = "cool.";
$_ = "Perl is really cool???";
s/$ss/$rs/g;
print "$_\n";
**************************************

Thanks!

- B

Hi Bryan,

What is 'compiling a pattern'?

you can say this :

s/\Q$ss\E/$rs/g;

cheers,
Jay

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



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


Reply via email to