=back
-But for now, let's look at some of the general issues common to all
-of these types of data structures.
+But for now, let's look at general issues common to all
+these types of data structures.
=head1 REFERENCES
for $i (1..10) {
@list = somefunc($i);
- $counts[$i] = scalar @list;
+ $counts[$i] = scalar @list;
}
Here's the case of taking a reference to the same memory location
well as the C<x> command to dump out complex data structures. For
example, given the assignment to $LoL above, here's the debugger output:
- DB<1> X $LoL
+ DB<1> x $LoL
$LoL = ARRAY(0x13b5a0)
0 ARRAY(0x1f0a24)
0 'fred'
2 'elroy'
3 'judy'
-There's also a lower-case B<x> command which is nearly the same.
-
=head1 CODE EXAMPLES
-Presented with little comment (these will get their own man pages someday)
+Presented with little comment (these will get their own manpages someday)
here are short code examples illustrating access of various
types of data structures.
}
# print the whole thing sorted by number of members and name
- foreach $family ( sort {
+ foreach $family ( sort {
@{$HoL{$b}} <=> @{$HoL{$a}}
||
$a cmp $b
} keys %HoL )
{
- print "$family: ", join(", ", sort @{ $HoL{$family}), "\n";
+ print "$family: ", join(", ", sort @{ $HoL{$family} }), "\n";
}
=head1 LISTS OF HASHES
# append new members to an existing family
%new_folks = (
wife => "wilma",
- pet => "dino";
+ pet => "dino",
);
for $what (keys %new_folks) {
print $rec->{LOOKUP}{"key"};
($first_k, $first_v) = each %{ $rec->{LOOKUP} };
- $answer = &{ $rec->{THATCODE} }($arg);
- $answer = &{ $rec->{THISCODE} }($arg1, $arg2);
+ $answer = $rec->{THATCODE}->($arg);
+ $answer = $rec->{THISCODE}->($arg1, $arg2);
# careful of extra block braces on fh ref
print { $rec->{HANDLE} } "a string\n";
Berkeley DB have size limitations, but beyond that, you also have problems
with how references are to be represented on disk. One experimental
module that does partially attempt to address this need is the MLDBM
-module. Check your nearest CPAN site as described in L<perlmod> for
+module. Check your nearest CPAN site as described in L<perlmodlib> for
source code to MLDBM.
=head1 SEE ALSO
=head1 AUTHOR
-Tom Christiansen E<lt>F<tchrist@perl.com>E<gt>
+Tom Christiansen <F<tchrist@perl.com>>
Last update:
Wed Oct 23 04:57:50 MET DST 1996