Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Extracting non-consecutive but related items from an array.

by TedPride (Priest)
on Jun 15, 2005 at 20:22 UTC ( #467047=note: print w/ replies, xml ) Need Help??


in reply to Extracting non-consecutive but related items from an array.

use strict; use warnings; my %h; while (<DATA>) { chomp; @_ = split /, /, $_, 2; push @{$h{lc($_[0])}}, $_[1]; } for (sort keys %h) { print "$_\n"; print " $_\n" for sort @{$h{$_}}; print "\n"; } __DATA__ server_A, Perl, UK server_A, Word, UK server_A, Outlook, UK server_A, Excel, UK server_B, Reuters, NL server_B, TradeXL, NL server_B, Thompsons, NL server_B, Bloomberg, NL server_B, Tibco, NL server_c, BasketLink, USA server_c, Evolution, USA server_c, Lotus, USA server_c, TIB, USA server_A, Python, UK


Comment on Re: Extracting non-consecutive but related items from an array.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-12-26 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls