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...
and# main.pl BEGIN { $^P = 0x400; } use test ();
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...# test.pm my @source = @{ $main::{ '_<' . __FILE__ } }; print for @source; 1;
Is that good enough for you?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Introsepcting the current Perl file via DATA, even w/o DATA? (perl5db.pl)
by Mr. Muskrat (Canon) on Feb 05, 2016 at 16:37 UTC | |
by LanX (Saint) on Feb 05, 2016 at 17:05 UTC | |
Re^6: Introspecting the current Perl file via DATA, even w/o DATA? (perl5db.pl)
by LanX (Saint) on Feb 05, 2016 at 16:19 UTC |
In Section
Seekers of Perl Wisdom