# 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?
In reply to Re^3: Perl linked list (HoH)
by LanX
in thread Perl linked list
by Perl_is_Perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |