Front page | perl.perl5.porters |
Postings from January 2005
/(?{...})/ bug?
Thread Next
From:
Torsten Foertsch
Date:
January 28, 2005 12:40
Subject:
/(?{...})/ bug?
Message ID:
200501282140.35849.torsten.foertsch@gmx.net
Hi,
I expect the program below to print "klaus" three times. But it prints only
one "klaus". If I change the "my $pos=pos" to "$pos=pos". It works as
expected. Is that a bug? Or is it documented somewhere?
Thanks,
Torsten
#!/usr/bin/perl
use strict;
sub parse {
my $str=shift;
use re 'eval';
my $regexp;
$regexp=qr{
(klaus)
(?{
my $pos=pos;
})
}xs;
while( $str=~/$regexp/g ) {
my $x=$1;
warn "$x\n";
}
}
my $s="hallo klaus blub klaus bla klaus otto";
parse( $s );
Thread Next
-
/(?{...})/ bug?
by Torsten Foertsch