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
In reply to Re: Package level scope callbacks.
by Limbic~Region
in thread Package level scope callbacks.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |