Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Create a package that exports other packages

by Anonymous Monk
on Aug 06, 2014 at 06:46 UTC ( [id://1096393]=note: print w/replies, xml ) Need Help??


in reply to Create a package that exports other packages

Replies are listed 'Best First'.
Re^2: Create a package that exports other packages
by exilepanda (Friar) on Aug 06, 2014 at 08:06 UTC
    BIG THANKS!! Import::Into works like a charm!!! It goes exactly I would expect and feel really transparent!
    # X.pm package X; sub new { bless{ Name=> "I am X"}, shift} 1; #Y.pm package Y; require Exporter; our @ISA =qw/Exporter/; our @EXPORT_OK = qw/TestY/; sub new {bless{ Name=> "I am Y"}, shift;} sub TestY {print "@_ EXPORT_OK"} 1; #MyStuffs.pm package MyStuffs; use Import::Into; sub import { my $target = caller; X->import::into($target); Y->import::into($target, qw/TestY/); } 1; #main.pl use MyStuffs; use Data::Dumper; my $x = new X; my $y = new Y; print "X dumps: "; print Dumper $x; print "$/$/Y dumps: "; print Dumper $y; print "$/$/"; TestY("I am"); print "$/"; Y::TestY ( "Still" ) ; __END__ X dumps: $VAR1 = bless( { 'Name' => 'I am X' }, 'X' ); Y dumps: $VAR1 = bless( { 'Name' => 'I am Y' }, 'Y' ); I am EXPORT_OK Still EXPORT_OK

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1096393]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2026-03-16 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.