Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^11: Variable number of foreach loops

by BrowserUk (Patriarch)
on Nov 29, 2013 at 08:54 UTC ( [id://1064920]=note: print w/replies, xml ) Need Help??


in reply to Re^10: Variable number of foreach loops
in thread Variable number of foreach loops

Had the question been phrased as:

I have a fixed number of arrays to permute, but I want to be able to pick a (sub)selection of those arrays at runtime using a string argument.

Then I might have come up with something like:

But then, if you'd taken the time to understand what you were trying to do, enough that you could express it clearly, you could probably have arrived at the solution yourself.

FWIW: The problem you are having has little or nothing to do with how to call a subroutine, and everything to do with how to use or avoid symbolic references. (Read all three parts!)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^12: Variable number of foreach loops
by abhay180 (Sexton) on Nov 29, 2013 at 11:48 UTC
    Thanks for Pe(a)rl(s) of wisdom! I cannot agree more. Yes, i think i went too voyeuristic by using symbolic references instead of the usual hashes and array-of-arrays.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1064920]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 18:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found