From: Tim Bunce Date: Sun, 30 Sep 2012 08:16:37 +0000 (+0900) Subject: cope with array index name attr being undef X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd0de560f42fd85ebfd34ab5df0726e6397abbcb;p=p5sagit%2FDevel-Size.git cope with array index name attr being undef --- diff --git a/bin/sizeme_store.pl b/bin/sizeme_store.pl index 4acd962..515a782 100755 --- a/bin/sizeme_store.pl +++ b/bin/sizeme_store.pl @@ -104,11 +104,11 @@ sub enter_node { $names[0] = '@_'; \@names; }; - $x->{name} = $padnames->[$index] || "?"; + $x->{name} = (defined $index and $padnames->[$index]) || "?"; $x->{name} =~ s/my\(SVs_PADTMP\)/PADTMP/; # XXX hack for neatness } else { - $x->{name} = "[$index]"; + $x->{name} = "[$index]" if defined $index; } } }