Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello all.
As a user of a perl script with no knowledge of perl, it's a bit tricky trying to locate the exact problem. So here I am seeking wisdom from PerlMonks. Posted below is the code snippet originally from https://github.com/mjpost/dptsg/scripts//annotate_spinal_grammar.pl
while (my $line = <>) { chomp $line; my $tree = build_subtree($line); walk_postorder($tree,[\&mark_heads,\&annotate]); #####offending line's below####### @{$tree->{children}}[0]->{label} =~ s/^\*//; # undo top-level merge print build_subtree_oneline($tree,1), $/; }
I've marked the offending line. Would appreciate being guided through resolving error "Can't use an undefined value as a HASH reference at dptsg/scripts/annotate_spinal_grammar.pl line xx, <> line 1."
Thank you.
|
---|