14 END { unlink @tmpfiles }
16 my $filename = 'swdtest.tmp';
18 open my $f, ">$filename"
19 or skip( "Can't write temp file $filename: $!" );
20 print $f <<'__SWDTEST__';
22 sub bar { $_[0] * $_[0] }
26 $s += Bar::bar($_) for 1..$_[0];
32 push @tmpfiles, $filename;
33 $| = 1; # Unbufferize.
35 switches => [ '-Ilib', '-d:switchd' ],
36 progfile => $filename,
38 like($r, qr/^main,swdtest.tmp,9;Foo,swdtest.tmp,5;Foo,swdtest.tmp,6;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Bar,swdtest.tmp,2;Bar,swdtest.tmp,2;$/i);