princepawn has asked for the wisdom of the Perl Monks concerning the following question:
Uncaught exception from user code: Can't call method "walk" on unblessed reference at treewalk.pl lin +e 28. main::walk('ARRAY(0x15b220)') called at treewalk.pl line 34
#!/bin/env perl use strict; use warnings; use diagnostics; my $tree = [ "Accomplishments in the past week" => 'accomplishments.txt', "Plans for the next week" => [ General => 'plans.txt', Vacations => 'vacations.txt', Classes => 'classes.txt' ], "Outstanding issues" => 'issues.txt' ]; sub walk { my $t = shift ; while (my ($key, $val) = splice @$t, 0, 2) { if (!ref($val)) { print "$key => $val\n"; } else { walk $val; ##### PROBLEM LINE } } } walk $tree;
Edit: 2001-03-03 by neshura
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Why was indirect object syntax inferred here?o
by japhy (Canon) on Feb 17, 2001 at 01:40 UTC | |
Re: Why was indirect object syntax inferred here?o
by eg (Friar) on Feb 17, 2001 at 01:38 UTC |