Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: a loop for creating subroutines?

by mascip (Pilgrim)
on Aug 27, 2012 at 16:43 UTC ( #990019=note: print w/replies, xml ) Need Help??


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 (Bishop) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990019]
help
Chatterbox?
[Corion]: Meh ... Minion really doesn't want to run under the fork() emulation on Windows (which I understand), but has no other way either (which I find inconvenient)
[Corion]: Other than that, it seems really polished

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2018-06-21 15:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (118 votes). Check out past polls.

    Notices?