Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Deleting records from an array

by Lotus1 (Vicar)
on Dec 22, 2014 at 14:20 UTC ( [id://1111023]=note: print w/replies, xml ) Need Help??


in reply to Deleting records from an array

You could avoid the loop within a loop issue if you would loop through the array one time and lookup the hash elements as you go. Instead of doing

if ($fields[3] =~ $key) {
you can do
if( defined( $coll_key_hash{$fields[3]} ){
to check if the array element is in the hash.

You didn't provide an example of your data but from your code it looks like it would work this way. Even with the approach of deleting array elements as they are used you would be rehashing (har har) a lot of data.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found