dalgetty has asked for the wisdom of the Perl Monks concerning the following question:
Why is the -> necessary in $source->{$node}, and why the %$ and @$ symbols instead of just % and @?foreach my $node(keys (%$source)) { my $elem=$source->{$node}; my $count=0; foreach my $attr (@$elem) { $self->print.="\n\n$node $count\n\n"; if ($count<1) {$self->nodename=$node;} foreach my $subnode(keys(%$attr)) { $self->print.=$subnode."\t".$attr->{$subnode}."\n"; } $count++; } }
Forgive my ignorance, and peace be with youforeach $label (keys %contact) { print"$label:$contact{$label}\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The Drivel is in the Details
by jZed (Prior) on May 29, 2007 at 22:24 UTC | |
by Anonymous Monk on May 29, 2007 at 22:28 UTC | |
by Random_Walk (Prior) on May 30, 2007 at 22:48 UTC | |
|
Re: The Drivel is in the Details
by FunkyMonk (Bishop) on May 29, 2007 at 22:40 UTC | |
|
Re: The Drivel is in the Details
by blazar (Canon) on May 29, 2007 at 23:01 UTC | |
|
Re: The Drivel is in the Details
by BenHopkins (Sexton) on May 31, 2007 at 04:10 UTC | |
|
Re: The Drivel is in the Details
by chexmix (Hermit) on May 31, 2007 at 18:45 UTC |