>Could someone please help me translate this. All I can figure out for sure
>are the first 2 lines. For a class assignment we need to: Read the
>documentation on the Data::Dumper module (type 'perldoc Data::Dumper' ).
>Use it to display the contents of your data structure. Thanks in advance.
You seem to be pretty much there. O course, it would be a disservice to do
your homework for you, so I'll point you in the direction of how to learn
it yourself.
>1 @c = ('c'); #make ordinary array with value c
>2 $c = \@c; #make a reference to array c
>3 $b = {}; #make an anonymous hash?
All correct so far.
>4 $a = [1, $b, $c];
Anonymous array. Try "perldoc perlref".
>5 $b->{a} = $a; #make hash key, a, variable a?
Yes, we'd say "variable $a"
>6 $b->{b} = $a->[1]; #make hash key, b, var a's 2nd element?
Not as clear an explanation as would convince me you knew what was happening.
>7 $b->{c} = $a->[2];
>8 print Data::Dumper->Dump([$a,$b,$c], [qw(a b c)]);
If you run this, the output should make it easier to understand what the
code is doing.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com