in reply to Re^2: Perl linked list
in thread Perl linked list
# 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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl linked list (HoH)
by Perl_is_Perl (Initiate) on Mar 31, 2015 at 19:17 UTC |