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


in reply to Re^4: Introspecting 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?

Anyway, let us know if you'll find something details about that magic. ;-)
You're so lazy, LanX ;) I'm sure you could do it yourself, but if you insist...
# main.pl BEGIN { $^P = 0x400; } use test ();
and
# test.pm my @source = @{ $main::{ '_<' . __FILE__ } }; print for @source; 1;
Now, the thing is, you have to set $^P before the file (test.pm in this case) is even opened. So you can't do it inside test.pm itself, I don't think...

Is that good enough for you?