Although / is the default regex delimiter in Perl, you can use different punctuation in that role to avoid "leaning toothpick syndrome":$fileline =~ s/$line.shtml"-->/$line.shtml"-->\n<SCRIPT language="Java +Script" SRC="http:\/\/mygreatwebsite.net\/cgi-bin\/gcountdir\/gcount. +pl?0=$line"> <\/SCRIPT>/
or even, if you want to get fancy:$fileline =~ s#$line.shtml"-->#$line.shtml"-->\n<SCRIPT language="Java +Script" SRC="http://mygreatwebsite.net/cgi-bin/gcountdir/gcount.pl?0= +$line"> </SCRIPT>#
$fileline =~ s[$line.shtml"-->] [$line.shtml"-->\n<SCRIPT language="JavaScript" SRC="htt +p://mygreatwebsite.net/cgi-bin/gcountdir/gcount.pl?0=$line"> </SCRIPT +>]
Edit: 1Just to clarify, I referred to the regex in question as a "travesty" solely to echo the OP's description of the code it came from as "the below travesty". I would not normally consider it nearly bad enough to qualify as such.
In reply to Re: What's the deal with apostrophes?
by dsheroh
in thread What's the deal with apostrophes?
by tallCoolOne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |