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

Re: Fwd: [perl #6011] /imsx not visible inside (??{})

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
June 5, 2012 15:33
Subject:
Re: Fwd: [perl #6011] /imsx not visible inside (??{})
Message ID:
20120605223332.GC2625@cancer.codesimply.com
* Leon Timmermans <fawaka@gmail.com> [2012-06-05T18:24:20]
> On Wed, Jun 6, 2012 at 12:20 AM, Leon Timmermans <fawaka@gmail.com> wrote:
> >
> > I think /(??{ $some_pattern_string })/ should do the same as
> > /$some_pattern_string/, so I would see this as a bug.

Do you think this is also a bug?

  use 5.16.0;
  my $str = 'foo';

  my $sub_re = '(f)';

  $str =~ /(??{ $sub_re })/;
  my $lazy_1 = $1;

  $str =~ /$sub_re/;
  my $eager_1 = $1;

  say "LAZY1: $lazy_1";
  say "EAGER: $eager_1";

Produces:

  LAZY1: 
  EAGER: f

-- 
rjbs


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