alling a subroutine from a reference
assuming for a second you are talking about a reference such as
| stuff before
my $sref = \&foo
| stuff after
then you would call it thusly:
| later
&($sref)( arg1....argn);
|
where "arg1...argn" would be replaced by the arguments you want passed to the sub.
Here is a more complete example:
#!/usr/bin/perl -w
use strict;
my $sref=\&foo;
&{$sref};
exit(0);
sub foo {
print "This is foo.\n";
}
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg