Subject: | assert is not usable in debugger or command line |
On the command line:
% perl -e 'use Devel::Assert -all; sub foo { assert(1 == 1); print
"done\n"; }; foo()'
forced to realloc PL_linestr for line use Devel::Assert -all; sub foo {
assert; print "done\n"; }; foo()
, bailing out before we crash harder at
/usr/lib/perl5/site_perl/5.8.8/Devel/Assert/Parser.pm line 100.
%
%
% perl -e 'use Devel::Assert; sub foo { assert(1 == 1); print "done\n";
}; foo()'
done
%
In the debugger:
% perl -de0
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(-e:1): 0
DB<1> use Devel::Assert -all
DB<2> sub foo { assert(1 == 1); print "done\n"; }
forced to realloc PL_linestr for line ($@, $!, $^E, $,, $/, $\, $^W) =
@saved;package main; $^D = $^D | $DB::db_stop;
sub foo { assert; print "done\n"; };
;, bailing out before we crash harder at
/usr/lib/perl5/site_perl/5.8.8/Devel/Assert/Parser.pm line 100.
at /usr/lib/perl5/site_perl/5.8.8/Devel/Assert/Parser.pm line 100
Devel::Assert::Parser::inject('Devel::Assert::Parser=HASH(0x8f890f8)',
'(1 == 1, 0)') called at /usr/lib/perl5/site_perl/5.8.8/Devel/Assert.pm
line 109
Devel::Assert::parse_assert('assert', 90) called at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Devel/Declare.pm
line 279
Devel::Declare::linestr_callback('const', 'assert', 90) called
at (eval 23)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2
eval '($@, $!, $^E, $,, $/, $\\, $^W) = @saved;package main; $^D
= $^D | $DB::db_stop;
sub foo { assert; print "done\\n"; };
;' called at /usr/lib/perl5/5.8.8/perl5db.pl line 628
DB::eval called at /usr/lib/perl5/5.8.8/perl5db.pl line 3410
DB::DB called at -e line 1
DB<3> foo()
Undefined subroutine &main::foo called at (eval
24)[/usr/lib/perl5/5.8.8/perl5db.pl:628] line 2.
DB<4> q
%
This is perl, v5.8.8 built for i386-linux-thread-multi, and running on
Centos 5.3