Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re(3): Putting it together

by Arien (Pilgrim)
on Aug 30, 2002 at 21:30 UTC ( [id://194261]=note: print w/replies, xml ) Need Help??


in reply to Re: Re(ALL): Putting it together
in thread H of A optimization

Well, in that case...

my (%edge, @seen); while (<STDIN>) { $seen[$2]++ or push @{$edge{$1}}, $2 if /(\d+)\D+(\d+)/; # push @{$edge{$1}}, $2 if /(\d+)\D+(\d+)/ and not $seen[$2]++; }

— Arien

Edit: added the commented alternative.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://194261]
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 2025-02-07 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (94 votes). Check out past polls.