Grant wrote:
I'd like to switch the " and ' characters in a block of text so that
all " characters become ' and all ' characters become ". The closest
thing I can come up with is the following, but of course it doesn't
work quite right because one is executed after the other:
$code =~ s/"/'/g;
$code =~ s/'/"/g;
Is there any way to switch them simultaneously?
$code =~ tr/"'/'"/;
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/