in reply to Re^2: Bug with "last successfully matched regular expression" (empty regex)
in thread Bug with "last successfully matched regular expression" (empty regex)
DB<52> @list= ("a".."c","DBIC","A".."C","DANCER","a".."c"); DB<53> sub ff { print $_[0]} DB<54> grep { ff(/DBIC/ .. /DANCER/) } @list; 0000000000 DB<55> grep { my $x=(/DBIC/ .. /DANCER/); ff($x) } @list; 12345E0
ff() evaluates the range operator in list context!
applying prototypes solves this "problem":
DB<182> @list= ("a".."c","DBIC","A".."C","DANCER","a".."c"); DB<183> sub ff ($) { print $_[0]} DB<184> grep { ff(/DBIC/ .. /DANCER/) } @list; 12345E0
Cheers Rolf ( ...banging his head against the table...)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Bug with "last successfully matched regular expression" (empty regex) (list context)
by tye (Sage) on Feb 24, 2012 at 20:49 UTC | |
|
Re^4: Bug with "last successfully matched regular expression" (empty regex)
by choroba (Cardinal) on Feb 24, 2012 at 15:40 UTC | |
by LanX (Saint) on Feb 24, 2012 at 15:48 UTC |