That's probably because you are using what I sent, rather than what the OP
did:
> C:\>perl -E "s§3(456)7§$1§;"
>
Unrecognized character \x98 in column 16 at -e line 1.
>
> C:\>perl -Mutf8 -E "s§3(456)7§$1§;"
>
Substitution replacement not terminated at -e line 1.
>
> C:\>perl -E "s§3(456)7§§$1§;
On 10-12-05 07:38 PM, Brian Fraser wrote:
You have to tell perl to use UTF-8. Add this line to the top of
your script(s):
use utf8;
See `perldoc utf8` for more details.
Hm, I don't mean to step on your toes or anything, but he is already
using utf8. The problem is with some utf
>
> You have to tell perl to use UTF-8. Add this line to the top of your
> script(s):
> use utf8;
>
> See `perldoc utf8` for more details.
Hm, I don't mean to step on your toes or anything, but he is already using
utf8. The problem is with some utf8 characters being interpreted as a paired
delimi
On 10-12-05 05:58 PM, Brian Fraser wrote:
Well, I have no idea why it does what it does, but I can tell you how to
make it work:
s¶3(456)7¶¶$1¶x;
s§3(456)7§§$1§x;
For whatever reason, Perl is treating those character as an 'opening'
delimiter[0], so that when you write s¶3(456)7¶$1¶;, you are te
Well, I have no idea why it does what it does, but I can tell you how to
make it work:
s¶3(456)7¶¶$1¶x;
s§3(456)7§§$1§x;
For whatever reason, Perl is treating those character as an 'opening'
delimiter[0], so that when you write s¶3(456)7¶$1¶;, you are telling Perl
that the regex part is delimited
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, us
On 10-12-03 09:12 AM, oldyork90 wrote:
Is there any efficiency gained using the modifier /o when used in a
sub?
The /o modifier is done automatically if there's no variable in the
pattern. You would use it when there is one, to inform perl that its
contents will not change during the run of
Is there any efficiency gained using the modifier /o when used in a
sub?
$x = 'a string';
my $status = mysub($x);
sub x {
my ($string) = @_;
if ($string =~ /^somepatternhere/o) {
return 1;
}
return 0;
}
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional
Hi,
On Sunday 05 December 2010 14:55:46 Patrick Dupre wrote:
> Hello,
>
> Can somebody tell me why this example does not work ?
>
> Number found where operator expected at ./Test.pl line 12, near "case 0"
> (Do you need to predeclare case?)
> syntax error at ./Test.pl line 11, near ") {"
>
Hello,
Can somebody tell me why this example does not work ?
Number found where operator expected at ./Test.pl line 12, near "case 0"
(Do you need to predeclare case?)
syntax error at ./Test.pl line 11, near ") {"
Execution of ./Test.pl aborted due to compilation errors.
10 matches
Mail list logo