in reply to Re: Can't use an undefined value as a HASH reference
in thread Can't use an undefined value as a HASH reference
while (my $line = <>) { chomp $line; my $tree = build_subtree($line); print Dumper $tree->{children}[0]; print Dumper $tree; walk_postorder($tree,[\&mark_heads,\&annotate]); @{$tree->{children}}[0]->{label} =~ s/^\*//; # undo top-level merge print build_subtree_oneline($tree,1), $/; }
I did have to use both prints. They gave output below.
$VAR1 = undef; $VAR1 = { 'children' => [] };
Not sure where to go from here. But would the $line input be the cause of the problem? The build_subtree($line) subroutine uses it as input.
Also, the correct link to the original script is here: https://github.com/mjpost/dptsg/blob/master/scripts/annotate_spinal_grammar.pl
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Can't use an undefined value as a HASH reference
by stevieb (Canon) on Aug 25, 2015 at 16:08 UTC | |
by Anonymous Monk on Aug 25, 2015 at 16:32 UTC | |
by Anonymous Monk on Aug 25, 2015 at 16:15 UTC |