Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

bastard's scratchpad

by bastard (Hermit)
on Jun 01, 2004 at 18:45 UTC ( #358379=scratchpad: print w/replies, xml ) Need Help??

the error with use strict is:

Can't use string ("0") as a HASH ref while "strict refs" in use at ./findgroups.pl line 37.

line 37 is marked with a >>>

below the code is what the output needs to look like

my $urlSet = $dbh->selectall_arrayref($statement); my %groups = (); foreach my $line (@$urlSet) { my @grouplist = @$line; my $group = $grouplist[0]; my $statement = qq! SELECT fename,fetype FROM $table where symbol = '$group'; !; my $grouped = $dbh->selectall_arrayref($statement); my @groupedstreetsegments = @$grouped; foreach my $g (@groupedstreetsegments) { my $streetelement = @$g[0]; unless( exists ${$groups{$group}}{$streetelement} ) { $groups{$group}{$streetelement} = 0; } $groups{$group}{$streetelement}++; } }

output

SYMBOL: 0 : 520 (Formerly I- 5): 4 1: 432 1 & 9: 92 1 and 9: 1 10: 8978 10 (Bus Rte): 9 100: 2 101: 2255 104: 91 105: 281 108: 103 10th: 35 11: 45 11 and 81: 10 110: 524 1100: 2 111: 2 111th: 1 113: 49 116: 17 117: 32 118: 278
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-03-08 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (128 votes). Check out past polls.

    Notices?