Thanks, ysth!

 > > I'm guessing maybe you meant to have a \ before the $ in "delete $INC..."?
Oops, ya.

 > > The BEGIN baffles me; you can't redefine a BEGIN block, it's run as soon as it's compiled. The ${caller}:: part does absolutely nothing.
That's what I thought, too. The problem really is that at import time, I'm trying to dig into functions of the caller that haven't been compiled into the symbol table at the time. In other words, the list of functions passed to the import represent functions the caller wants me to change, yet because they're called at compile-execution time, too, nothings there. The only function that's assigned at the time was BEGIN, so I gave it a try. With the re-require of the calling package, the functions get assigned to the symbol table and I can change them at my will anytime after that. (did that confuse things more?

 > > Have you tried a glob assignment?
I did, and although that looses the warning - I hit the problem I mention earlier. Essentially, I'm trying to add some aspect-ish slicing to any calling package, where to effectively do so, I need to have the functions already defined - does that make sense? Where if I simply use a GLOB assignment, I overwrite the entire function; which isn't really my goal.

'Caller' example
package Caller; use strict; use warnings; # # The idea being that I want MyPackage to do something # with 'use_this_function'. Because I can't guarentee the # function will be defined at the point of import, I'm trying # to force the compilation of the module in order to get # the assignment in the symbol table so I can change it appropriately # (I use that word lightly here) # use MyPackage qw( use_this_function ); # From earlier example function dont_use_this_function { return; } function use_this_function { return; } 1;


Thanks again for your help!

---------
perl -le '$.=[qw(104 97 124 124 116 97)];*p=sub{[@{$_[0]},(45)x 2]};*d=sub{[(45)x 2,@{$_[0]}]};print map{chr}@{p(d($.))}'

In reply to Re^2: unimport warnings in another package by wazzuteke
in thread unimport warnings in another package by wazzuteke

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.