develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #77816] provide originating context of subroutine definitions

Thread Previous
Father Chrysostomos via RT
July 6, 2013 03:34
[perl #77816] provide originating context of subroutine definitions
Message ID:
On Sun Jun 24 11:01:21 2012, sprout wrote:
> I don’t even know what the line number in the GV is for.  Maybe it would
> be acceptable to set it when a sub is defined (after the warning, and if
> CvGV(cv) == gv).  I don’t know.

I do now. :-)

It is used for ‘use once’ warnings.  If the GV is accessed multiple
times; e.g., for $x and then sub x, the GvFILE nad GvLINE fields are
never used.  So it should be safe to overwrite them when defining subs,
for the sake of putting this warning on the right line.


Father Chrysostomos

via perlbug:  queue: perl5 status: open

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About