develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #113962] /r modifier on substitutions - variant returning undef if no match

Thread Next
From:
Ricardo SIGNES via RT
Date:
July 23, 2012 20:14
Subject:
[perl #113962] /r modifier on substitutions - variant returning undef if no match
Message ID:
rt-3.6.HEAD-11172-1343099657-382.113962-15-0@perl.org
On Tue Jul 03 03:01:56 2012, eda@waniasset.com wrote:
> ...
> 
>     my $old = 'cat';
>     (my $new = $old) =~ s/cat/dog/ or die;
> [...]
>     my $new = $old =~ s/cat/dog/R // die;

My feeling is that in this case, the user should simply use the non-r form.  I am open to hear 
more on this, but I think this is not worth the complexity of Yet Another Postfix Modifier.

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=113962

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