http://qs1969.pair.com?node_id=1154489


in reply to Re^5: Introsepcting the current Perl file via DATA, even w/o DATA? (perl5db.pl)
in thread Introspecting the current Perl file via DATA, even w/o DATA?

I found this interesting so I played with it briefly...

# main.pl my @source = @{ $main::{ '_<' . __FILE__ } }; shift @source; # get rid of sub DB::DB{}; print for @source;
and
PERL5DB="sub DB::DB{}" perl -d main.pl

Output:

my @source = @{ $main::{ '_<' . __FILE__ } }; shift @source; # get rid of sub DB::DB{}; print for @source;

Update: I had found @{$main::{'_<'.$filename}} yesterday but didn't have time to play with it.

Update 2: Added shift.