develooper Front page | perl.perl5.porters | Postings from February 2008

Re: [PATCH t/op/pat.t] Re: Change 33313 causing failures

Thread Previous | Thread Next
From:
Matthew Persico
Date:
February 15, 2008 14:04
Subject:
Re: [PATCH t/op/pat.t] Re: Change 33313 causing failures
Message ID:
9ea6aaa80802151404q47217f51ue2c86b30afdaecb9@mail.gmail.com
On Feb 15, 2008 6:03 AM, Abigail <abigail@abigail.be> wrote:
> On Thu, Feb 14, 2008 at 02:17:57PM -0500, Jerry D. Hedden wrote:
[snip-age throughout]
> There's a typo that causes havoc. Here's a fix.
>
>
>
> -    if ($s = ~/(?<D>(?<A>foo)\s+(?<B>bar)?\s+(?<C>baz))/) {
> +    if ($s =~ /(?<D>(?<A>foo)\s+(?<B>bar)?\s+(?<C>baz))/) {

In an effort to understand, I digress:

In the line that was in error what the heck got assigned to $s? As I
understand it, the only modifiers that are allowed in front of a RE
are i,m,s or x so shouldn't a syntax error have been thrown? Under
perl 5.10.0:

$  perl -e '
> $s=0;
>  $s = ~/(?<D>(?<A>foo)\s+(?<B>bar)?\s+(?<C>baz))/;
> print $s;'
4294967295


-- 
Matthew O. Persico

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About