Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Having an Issue updating hash of hashes

by 2teez (Vicar)
on Jul 05, 2014 at 18:54 UTC ( [id://1092389]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Having an Issue updating hash of hashes
in thread Having an Issue updating hash of hashes

This bit will stop working once you start getting multi-digit IDs:

$key = $1 if /^ID=(.)/;
Obviously, BUT the OP data set doesn't say otherwise and I don't intend to think for the OP!
Am only using the OP dataset provided with that the line suffices!

Update:

You'll want this instead:

$key = $1 if /^ID=([^\s]+)/;
Otherwise you'll end up silently overwriting previous entries.

And what happens if the OP has two or ID with the same value, even with the code above?! Oops!!
Maybe the OP first intention of using a counter will do for all intent and purpose!

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 02:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found