Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Those bits of source show how strict vars works, but what I'm more interested (and couldn't figure out) is which part of the code determines whether or not a glob assignment will result in setting the IMPORT flag on the GV.

Well, http://perl5.git.perl.org/perl.git/blob?f=gv.c#l1578 is it I think, HINT_STRICT_VARS means strict is on, and that is where the name/flags are checked  (*name == 'a' || *name == 'b') should be familiar (its $a and $b)

Its not commented/decorated, so my next move would be to fireup gitk or some such gitness to see how that block has changed (if at all) over the years ... and refresh my http://search.cpan.org/dist/illguts/index.html knowledge ... cause whatever I knew once I forgot :)

Then

Peeking at the array is meh

$ perl -e "use Devel::Peek; use strict; BEGIN{*main::foo=\@main::foo; +Dump(\@main::foo)}; print @foo; " SV = IV(0xac90b0) at 0xac90b4 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x99b9fc SV = PVAV(0x3faa8c) at 0x99b9fc REFCNT = 2 FLAGS = () ARRAY = 0x0 FILL = -1 MAX = -1 ARYLEN = 0x0 FLAGS = (REAL) Variable "@foo" is not imported at -e line 1. Global symbol "@foo" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. $ perl -e "use Devel::Peek; use strict; BEGIN{package Pkg; *main::foo= +\@main::foo;};package main; Dump\@foo; " SV = IV(0x3f9a40) at 0x3f9a44 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0xa8d714 SV = PVAV(0x3faaa4) at 0xa8d714 REFCNT = 2 FLAGS = () ARRAY = 0x0 FILL = -1 MAX = -1 ARYLEN = 0x0 FLAGS = (REAL)

Peeking at the glob is more promising

$ perl -e "use Devel::Peek; use strict; BEGIN{*main::foo=\@main::foo; +Dump(*main::foo)}; print @foo; " SV = PVGV(0xa6ad1c) at 0x99b984 REFCNT = 4 FLAGS = (MULTI,IN_PAD) NAME = "foo" NAMELEN = 3 GvSTASH = 0x3f991c "main" GP = 0xac5fac SV = 0x0 REFCNT = 1 IO = 0x0 FORM = 0x0 AV = 0x99ba04 HV = 0x0 CV = 0x0 CVGEN = 0x0 LINE = 1 FILE = "-e" FLAGS = 0xa EGV = 0x99b984 "foo" Variable "@foo" is not imported at -e line 1. Global symbol "@foo" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. $ perl -e "use Devel::Peek; use strict; BEGIN{package Pkg; *main::foo= +\@main::foo;};package main; Dump*foo; " SV = PVGV(0xa6ad3c) at 0x99b994 REFCNT = 2 FLAGS = (MULTI,IN_PAD,IMPORT( AV )) NAME = "foo" NAMELEN = 3 GvSTASH = 0x3f9934 "main" GP = 0xac5fec SV = 0x0 REFCNT = 1 IO = 0x0 FORM = 0x0 AV = 0xa8d714 HV = 0x0 CV = 0x0 CVGEN = 0x0 LINE = 1 FILE = "-e" FLAGS = 0x2a EGV = 0x99b994 "foo"

Something something ... looking at prev link ... something http://perl5.git.perl.org/perl.git?a=search&h=HEAD&st=grep&s=GvIMPORTED

http://search.cpan.org/dist/illguts/index.html#GvFLAGS

http://perl5.git.perl.org/perl.git?a=search&h=HEAD&st=grep&s=IMPORTED\S%2Bon&sr=1
http://perl5.git.perl.org/perl.git/blob?f=gv.h#l178
?imported subs http://perl5.git.perl.org/perl.git/blob?f=gv.c#l399
?imported scalar http://perl5.git.perl.org/perl.git/blob?f=pp_hot.c#l161
?imported glob scalar assignment http://perl5.git.perl.org/perl.git/blob?f=sv.c#l3758
?imported scalar ref http://perl5.git.perl.org/perl.git/blob?f=sv.c#l4234
!SCREAM http://perl5.git.perl.org/perl.git/blob?f=sv.h#l362

360 #define SVprv_PCS_IMPORTED SVp_SCREAM /* RV is a proxy for a con +stant 361 subroutine in another packa +ge. Set the 362 GvIMPORTED_CV_on() if it ne +eds to be 363 expanded to a real GV */

So, next move, somehow gitk/gitness , track IMPORTED\S+on changes ... maybe just grep each major release ..

When lacking understanding, I grep more :D


In reply to Re^3: Creating "Lexical" Symbol Table Aliases (a la "use vars") From The Same Package by Anonymous Monk
in thread Creating "Lexical" Symbol Table Aliases (a la "use vars") From The Same Package by OneTrueDabe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (9)
    As of 2014-09-23 04:59 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (210 votes), past polls