Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^10: Variable number of foreach loops

by abhay180 (Acolyte)
on Nov 29, 2013 at 05:31 UTC ( #1064897=note: print w/replies, xml ) Need Help??

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

Dude, Not sure what i have repeated again and asked for code...i showed you. Not sure how else you want to represent. The arguments i am passing to print_comb() function can create "variable" number of arrays. So i should be able to pass this variable-arrays to gen_loops(). I cannot have a static call like:
and i want it like...
gen_loops($count, < "$count" number of arrays>)
Not sure if i am able to explain. Anyways i have figured it out in some round-about manner. Thanks for your help.

Replies are listed 'Best First'.
Re^11: Variable number of foreach loops
by BrowserUk (Pope) on Nov 29, 2013 at 08:54 UTC

    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.
      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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064897]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2018-07-18 07:16 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (383 votes). Check out past polls.