> > Keeping with the use of $_, replace the following 'print map' statement to > the following: > > >>> print map "$_\n", @wanted; > > > foreach ( @wanted ){ > print "$_:\n"; > foreach ( values %{ $href->{ $_ } } ){ > print "\t$_\n"; > } > } > > ** OUTPUT ** > > 149: > 2 > 2 > 1 > 1 > 1 > 2 > 2 > 077: > ND > ND > ND > ND > ND > ND > ND >
I'm getting this error that I'm not sure how to fix: $> ./datalink.pl > out.txt Can't use string ("389/1024") as a HASH ref while "strict refs" in use at ./datalink.pl line 41, <$SUM> line 4060. code snippet: my $href = %data; sub ND_or_multiple { my %uniq; for (values %{$href->{$_[0]}}) { return 1 if $_ eq 'ND'; $uniq{$_}++; return 1 if keys %uniq > 1; } return ''; } my @wanted = grep ND_or_multiple($_), keys %$href; # <-- line 41 foreach ( @wanted ) { print "$_:\n"; foreach (values %{ $href->{ $_ } } ){ print "\t$_\n"; } } -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/