You have to escape the ampersand, so

s/&/and/;

becomes

s/\&/and/;

HT

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Jeff
Zanzinger
Sent: Saturday, February 28, 2004 11:48 AM
To: [EMAIL PROTECTED]
Subject: "&" substitution

How can I match the "&" symbol?

$_ = "test & test";
s/&/and/; # expect test and test but get test & test

thanks,

Jeff



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.596 / Virus Database: 379 - Release Date: 2/26/2004



_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to