variable, and hence (usually) saving all globs, not just those that
should be kept.
p4raw-id: //depot/perl@34879
PUTBACK;
ok = doeval(gimme, NULL, runcv, seq);
if ((PERLDB_LINE || PERLDB_SAVESRC)
- && was != (I32)PL_sub_generation /* Some subs defined here. */
+ && was != (U32)PL_breakable_sub_generation /* Some subs defined here. */
&& ok) {
/* Just need to change the string in our writable scratch buffer that
will be used at scope exit to delete this eval's "file" name, to
use strict;
-plan( tests => 19 );
+plan (tests => 21);
+
+$^P = 0xA;
my @before = grep { /eval/ } keys %::;
my $name = 'foo';
for my $sep (' ', "\0") {
- $^P = 0xA;
my $prog = "sub $name {
'Perl${sep}Rules'
$seen{$keys[0]}++;
$name++;
}
+
+is (eval '1 + 1', 2, 'String eval works');
+
+my @after = grep { /eval/ } keys %::;
+
+is (@after, 0 + keys %seen,
+ "evals that don't define subroutines are correctly cleaned up");
+