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

[perl #77816] provide originating context of subroutine definitions

Thread Previous
From:
Father Chrysostomos via RT
Date:
July 6, 2013 03:34
Subject:
[perl #77816] provide originating context of subroutine definitions
Message ID:
rt-3.6.HEAD-2552-1373081629-1102.77816-15-0@perl.org
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
https://rt.perl.org:443/rt3/Ticket/Display.html?id=77816

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About