Just for reference, here's a comparison of the internals. Note the additional IMPORT( SV ) in FLAGS.

With package imp;.
C:\>perl -MDevel::Peek -e "BEGIN { require 'imp.pl'}; print Dump(*foo) +" SV = PVGV(0x1950c74) at 0x195aa84 REFCNT = 2 FLAGS = (GMG,SMG,MULTI,IN_PAD,IMPORT( SV )) IV = 0 NV = 0 MAGIC = 0x193716c MG_VIRTUAL = &PL_vtbl_glob MG_TYPE = PERL_MAGIC_glob(*) MG_OBJ = 0x195aa84 NAME = "foo" NAMELEN = 3 GvSTASH = 0x2260dc "main" GP = 0x1950cc4 SV = 0x19307cc REFCNT = 1 IO = 0x0 FORM = 0x0 AV = 0x0 HV = 0x0 CV = 0x0 CVGEN = 0x0 GPFLAGS = 0x0 LINE = 2 FILE = "imp.pl" FLAGS = 0x1a EGV = 0x195aa84 "foo"
Without package imp;.
C:\>perl -MDevel::Peek -e "BEGIN { require 'imp.pl'}; print Dump(*foo) +" SV = PVGV(0x195064c) at 0x1930730 REFCNT = 2 FLAGS = (GMG,SMG,MULTI,IN_PAD) IV = 0 NV = 0 MAGIC = 0x1959054 MG_VIRTUAL = &PL_vtbl_glob MG_TYPE = PERL_MAGIC_glob(*) MG_OBJ = 0x1930730 NAME = "foo" NAMELEN = 3 GvSTASH = 0x2260dc "main" GP = 0x195ecf4 SV = 0x19307cc REFCNT = 1 IO = 0x0 FORM = 0x0 AV = 0x0 HV = 0x0 CV = 0x0 CVGEN = 0x0 GPFLAGS = 0x0 LINE = 1 FILE = "imp.pl" FLAGS = 0xa EGV = 0x1930730 "foo"

In reply to Re^4: How to trick strict like Exporter does (import) by rblasch
in thread How to trick strict like Exporter does by betterworld

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.