http://www.perlmonks.org?node_id=990019


in reply to Re: a loop for creating subroutines?
in thread a loop for creating subroutines?

With this solution, how would my example code look like? Like this?

$mysubs{light}->(10); $mysubs(light_at_time)->($timestamp);

Replies are listed 'Best First'.
Re^3: a loop for creating subroutines?
by LanX (Saint) on Aug 27, 2012 at 16:49 UTC
    I've already shown you three possibilities to call with "arguments".

    I wouldn't try to load unknown subs into main-namespace, that can easily lead to errors.

    Try and see what fits your needs.

    Cheers Rolf