Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Perl linked list (HoH)

by LanX (Saint)
on Mar 31, 2015 at 18:37 UTC ( [id://1122035]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl linked list
in thread Perl linked list

OK, I ran the following code

# you can use print for debugging purposes, e.g. # print "this is a debug message\n"; use Data::Dumper; sub solution { my ($L)=@_; print Dumper $L; # write your code in Perl 5.14 }

and got this output, which clarifies that the implementation is done with hashes of hashes

(sorry indentation lost while copying)

Running solution... Compilation successful. Example test: [1, 1, 1, 1] Output (stderr): WARNING: producing output may seriously slow down your code! Output:

$VAR1 = {
next => {
next => {
next => {
next => undef,
value => 1
},
value => 1
},
value => 1
},
value => 1
};

Reading the confusing text reveals that those lazy people didn't even try to use proper Perl terminology.

Pointer? Dictionary? Empty? WTF?

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)

PS: Je suis Charlie!

Replies are listed 'Best First'.
Re^4: Perl linked list (HoH)
by Perl_is_Perl (Initiate) on Mar 31, 2015 at 19:17 UTC
    Thanks for your help LanX, once Known the data structure, everything make sense now!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-20 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found