Your question is a little ambiguous... but maybe you're looking for
a non-interactive tracing facility, as provided by the Perl debugger. E.g.
$ cat 794362.pl
#!/usr/bin/perl
use strict;
use warnings;
print "Hello world!\n";
$ PERLDB_OPTS="AutoTrace NonStop frame=2" perl -d 794362.pl
entering CODE(0x65f740)
3: use strict;
3: use strict;
3: use strict;
entering strict::import
28: shift;
29: $^H |= @_ ? bits(@_) : $default_bits;
exited strict::import
exited CODE(0x65f740)
entering CODE(0x65f780)
4: use warnings;
4: use warnings;
4: use warnings;
entering warnings::import
336: shift;
338: my $catmask ;
339: my $fatal = 0 ;
340: my $no_fatal = 0 ;
342: my $mask = ${^WARNING_BITS} ;
344: if (vec($mask, $Offsets{'all'}, 1)) {
349: push @_, 'all' unless @_;
351: foreach my $word ( @_ ) {
352: if ($word eq 'FATAL') {
361: $mask |= $catmask ;
362: $mask |= $DeadBits{$word} if $fatal ;
363: $mask &= ~($DeadBits{$word}|$All) if $no_fatal ;
369: ${^WARNING_BITS} = $mask ;
exited warnings::import
exited CODE(0x65f780)
Package 794362.pl.
6: print "Hello world!\n";
Hello world!
(See perldebug for what other options you might want to set via the env variable PERLDB_OPTS)
P.S.: Don't ask (me) why "3: use strict;" / "4: use warnings;" are being printed three times. I don't know... — but maybe
someone else does :)
|