The perlop document under "s/PATTERN/REPLACEMENT/msixpogce" says "Any 
non-whitespace delimiter may replace the slashes."

I take this to mean that any non-whitespace character may be used instead of a 
slash.

However, I am finding that some non-whitespace characters cause errors. For 
example, using a "¶" or "§" character instead of a slash causes an error, such 
as "Bareword found where operator expected" or "Number found where operator 
expected". When I use a "/", "#", or ",", I get no error. Here is a script that 
demonstrates this problem:

#!/usr/bin/perl -w
use warnings 'FATAL', 'all';
use strict;
use utf8;
my $string = '123456789';
print "The original string is $string\n";
$string =~ s§3(456)7§$1§;
print "The amended string is $string\n";



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to