1 warn "Legacy library @{[(caller(0))[6]]} will be removed from the Perl core distribution in the next major release. Please install it from the CPAN distribution Perl4::CoreLibs. It is being used at @{[(caller)[1]]}, line @{[(caller)[2]]}.\n";
4 # This library is no longer being maintained, and is included for backward
5 # compatibility with Perl 4 programs which may require it.
6 # This legacy library is deprecated and will be removed in a future
10 # tchrist@convex.com (Tom Christiansen)
15 # &assert('$var > 10', $var, $othervar, @various_info);
17 # That is, if the first expression evals false, we blow up. The
18 # rest of the args, if any, are nice to know because they will
19 # be printed out by &panic, which is just the stack-backtrace
20 # routine shamelessly borrowed from the perl debugger.
23 &panic("ASSERTION BOTCHED: $_[0]",$@) unless eval $_[0];
31 print "\npanic: @_\n";
33 exit 1 if $] <= 4.003; # caller broken
35 # stack traceback gratefully borrowed from perl debugger
39 my ($p,$f,$l,$s,$h,$a,@a,@frames);
40 for ($i = 0; ($p,$f,$l,$s,$h,$w) = caller($i); $i++) {
43 if (/^StB\000/ && length($_) == length($_main{'_main'})) {
44 $_ = sprintf("%s",$_);
48 s/([^\0]*)/'$1'/ unless /^-?[\d.]+$/;
49 s/([\200-\377])/sprintf("M-%c",ord($1)&0177)/eg;
50 s/([\0-\37\177])/sprintf("^%c",ord($1)^64)/eg;
53 $w = $w ? '@ = ' : '$ = ';
54 $a = $h ? '(' . join(', ', @a) . ')' : '';
55 push(@frames, "$w&$s$a from file $f line $l\n");
57 for ($i=0; $i <= $#frames; $i++) {