Harry Putnam wrote:
Harry Putnam <rea...@newsguy.com> writes:

However, using your suggestion:
  > $code->($var1, $var2);

Something I forgot to ask about that.

What if more than 1 of referenced sub routines needed vars passed in
but the needed vars were not the same?

I'm guessing that using $code->() is not such a good idea.  Whatever
data any subroutines may need, should have been supplied before the
`dispatch table' is called.

my %dispatch = (
  1 => sub { foo( $var1, $var2 ) },
  2 => sub { bar( $var3, $var4 ) },
);


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

Eliminate software piracy:  use only FLOSS.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to