in reply to Passing subroutines as arguments
Assuming that you have a reference to a subroutine in $sub,
will invoke that subroutine without arguments, and&$sub(); or $sub->();
will invoke it with arguments.&$sub(1, 2, "grapefruit"); or $sub->(1, 2, "grapefruit");
Which form you choose is a matter of style.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing subroutines as arguments
by dragonchild (Archbishop) on May 08, 2003 at 19:53 UTC | |
by dws (Chancellor) on May 08, 2003 at 20:01 UTC | |
by linux454 (Pilgrim) on May 09, 2003 at 14:03 UTC |