New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex "(?{ code })" not working. #7849
Comments
From lidden@yahoo.seCreated by lidden@yahoo.seThe following sub is only working the first time it is called. <code> my @cast; $desc =~ m§I rollerna:\s*(?:([\w ]+)(?:,|)(?{ push @cast, $1; })\s*)+\.§i; print join ' : ', @cast, "\n"; my $rant = 'Blah blah, blah. I rollerna: Peter Weller, Nancy Allen, Ronny Cox. Regi: Paul Verhoeven. (RoboCop)'; get_people($rant); </output> Tried with perl5.8.6, perl5.9.1 and this blead version. /Stefan Lidman Perl Info
|
From @demerphqOn 22 Mar 2005 22:13:23 -0000, via RT lidden @ yahoo. se
The code inside the regex is a closure on the original lexical copy. sub get_people{ our @cast; $desc =~ m§I rollerna:\s*(?:([\w ]+)(?:,|)(?{ push @cast, $1; })\s*)+\.§i; print join ' : ', @cast, "\n"; my $rant = 'Blah blah, blah. I rollerna: Peter Weller, Nancy Allen, get_people($rant); -- |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Wed, Mar 23, 2005 at 11:47:19AM +0100, demerphq wrote:
The behaviour is buggy nevertheless, and I'm still planning to fix it at Dave -- |
From @cpansproutThis has been fixed by the commits leading up to eb58a7e. |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#34547 (status was 'resolved')
Searchable as RT34547$
The text was updated successfully, but these errors were encountered: