Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Misprinting combinations / iterator

by tangent (Curate)
on Mar 27, 2012 at 15:36 UTC ( #961960=note: print w/ replies, xml ) Need Help??


in reply to Misprinting combinations / iterator

The $combination variable returned by the iterator is an array reference, so you need to de-reference it in order to print. The following will print each combination on a line, with each element separated by a tab character:

print $output join("\t",@{$combination}) . "\n";
The @{ } construct is what de-references the array reference


Comment on Re: Misprinting combinations / iterator
Download Code
Replies are listed 'Best First'.
Re^2: Misprinting combinations / iterator
by blacknail (Initiate) on Mar 27, 2012 at 16:01 UTC
    Thanks for the explanation, tangent :]

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2015-07-30 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls