in reply to Re: Introsepcting the current Perl file via DATA, even w/o DATA?
in thread Introspecting the current Perl file via DATA, even w/o DATA?
> Why do you think so?
Because the filepointer is in sync with the parsing phases of Perl. There is an explicit warning not to read DATA at BEGIN or use phases because the end of file isn't reached yet.
And testing showed that in this cases you can readline the currently processed source line resp. the next one.
Not finding the handle in the main stash doesn't mean it doesn't exist somewhere else (probably hidden somewhere in B )
update
- Using a neutral source filter might be another option to fill @lines ...
- IIRC is the debugger keeping the content source files in similar arrays, maybe I should have again a look into perl5db.pl.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In Section
Seekers of Perl Wisdom