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.
In reply to Re(3): Putting it together
by Arien
in thread H of A optimization
by abitkin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |