Subject: | mess up the @_ array under Perl debugger. |
When running under the Perl debugger, 'all' or 'any' mess up the @_
array : they seem to introduce a coderef within the array. See the
attached mini-program. Execution results are as follows :
Normal execution
D:/strawberry/perl/bin\perl.exe -w -I../lib d:/SVN/DMWeb-
3.3/DMWeb/lib/DMWeb/Controller/foo.pl
REGEX IS : (?-xism:^..$)
and the result is : 1
Debugger :
DB<1> c
REGEX IS : CODE(0xd32f5c)
REGEX IS : CODE(0xd32f5c)
REGEX IS : CODE(0xd32f5c)
[..crash..]
I'm running Strawberry perl 5, version 12, subversion 1 (v5.12.1) built
for MSWin32-x86-multi-thread
Subject: | bug_more_utils.pl |
use strict;
use warnings;
use List::MoreUtils qw/all any/;
my $data = [qw/ab cd ef/];
sub match_all {
my $dataref = shift;
return any {match($_, @_)} @$dataref;
}
sub match {
my ($data, $regex) = @_;
print STDERR "REGEX IS : $regex\n";
return $data =~ $regex;
}
my $r = match_all($data, qr/^..$/);
print "and the result is : ", $r, "\n";