Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: Hashes, Arrays, and Confusion -- In a bit over my head!

by tangent (Curate)
on Mar 30, 2012 at 01:38 UTC ( #962512=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Hashes, Arrays, and Confusion -- In a bit over my head!
in thread Hashes, Arrays, and Confusion -- In a bit over my head!

This does not print out any results for key or errors (lines 211 and 212)
Riales used this to get the $key:
$key =~ /^LOGGED IN (\w+) GET/; $key = $1;
Whereas you are using this:
$key =~ s/LOGGED IN //; $key =~ s/ GET //; $key =~ s/ POST //; $key = $1;
In your version you need to leave out the last line: $key = $1
How do I grab all of the col1_vals together in order to run an average
Riales code
my $calcd = calculate_stuff($seen{$key}->{col1_vals});
covers this. All of the col1_vals are now in $seen{$key}->{col1_vals} which is an array reference - if you print that out you will see:
foreach my $key (keys %seen) { my $col1_vals = $seen{$key}->{col1_vals}; print "@$col1_vals\n"; }


Comment on Re^4: Hashes, Arrays, and Confusion -- In a bit over my head!
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://962512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-05 18:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls