in reply to subroutine reference questions
You have to look on the next page. :)
In "Displaying Recursively Defined Data" on page 98, we show you how to do it. The dump_data_for_path routine, which is also recursive. displays the data structure. The code itself is on page 99:
sub dump_data_for_path { my $path = shift; my $data = shift; if (not defined $data) { # plain file print "$path\n"; return; } my %directory = %$data; for (sort keys %directory) { dump_data_for_path("$path/$_", $directory{$_}); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: subroutine reference questions
by convenientstore (Pilgrim) on Sep 01, 2007 at 23:32 UTC |