It's better to just silence it in Deparse rather than stopping
B::PMOP::reflags from returning undef because of a non-constant regexp.
That way, we keep the possibility to test for this situation, and it stays
in line with B::PMOP::pregcomp.
Also bump $B::Deparse::VERSION.
PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED),
($] < 5.009 ? 'PMf_SKIPWHITE' : 'RXf_SKIPWHITE'),
($] < 5.011 ? 'CVf_LOCKED' : ());
-$VERSION = 0.93;
+$VERSION = 0.94;
use strict;
use vars qw/$AUTOLOAD/;
use warnings ();
}
# handle special case of split(), and split(' ') that compiles to /\s+/
+ # Under 5.10, the reflags may be undef if the split regexp isn't a constant
$kid = $op->first;
if ( $kid->flags & OPf_SPECIAL
and ( $] < 5.009 ? $kid->pmflags & PMf_SKIPWHITE()
- : $kid->reflags & RXf_SKIPWHITE() ) ) {
+ : ($kid->reflags || 0) & RXf_SKIPWHITE() ) ) {
$exprs[0] = "' '";
}
require feature;
feature->import(':5.10');
}
-use Test::More tests => 83;
+use Test::More tests => 84;
use Config ();
use B::Deparse;
@a = reverse @a;
@b = reverse @b;
();
+####
+my($r, $s, @a);
+@a = split(/foo/, $s, 0);
+$r = qr/foo/;
+@a = split(/$r/, $s, 0);
+();