Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Package level scope callbacks.

by Limbic~Region (Chancellor)
on Jul 31, 2004 at 17:12 UTC ( #378946=note: print w/replies, xml ) Need Help??


in reply to Package level scope callbacks.

BrowserUk,
I am likely to be completely off base, but wouldn't a closure do what you wanted? I guess I don't really understand what you mean, but just in case:
package Foo; use strict; use warnings; sub Hello_World { print "Hello Word\n"; } my $callback = sub { Hello_World(); }; sub Bar { $callback->(); print "This is the actual 'would be' exported sub\n"; } 1; # Some script that uses it #!/usr/bin/perl use strict; use warnings; use Foo; Foo::Bar();

Cheers - L~R

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2021-05-13 18:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (140 votes). Check out past polls.

    Notices?