Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Perl ARRAY() result

by bliako (Monsignor)
on Jan 13, 2019 at 21:58 UTC ( [id://1228497]=note: print w/replies, xml ) Need Help??


in reply to Perl ARRAY() result

if you want to print the contents of an array just do:

my @array = (1,2,3); print join(',', @array);

in the code you posted try replacing

print "@$_\n", [ @$included, $nextValue ]
with print join(", ", @{[ @$included, $nextValue ]})."\n"

Edit:btw, your code does not return anything in @results. Instead of printing inside your sub, try pushing each new result to the @results array by replacing said print statement with push(@results, [ @$included, $nextValue ]). Then at the end of your code (after Solve() returns) do  print join(",", @$_)."\n" foreach @results

I was wondering what @$_ in print "@$_\n", [ @$included, $nextValue ] was all about...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1228497]
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-03-28 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found