Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: A simple grouping of list items

by ruzam (Curate)
on Jul 08, 2012 at 03:15 UTC ( #980537=note: print w/replies, xml ) Need Help??

in reply to A simple grouping of list items

What the heck, just for fun, some minor code changes for faster execution.

caveat: not tested, not benchmarked, maybe not even syntactically correct, could cause different output :)

my $previous = ""; # skip $item variable # 'for' just looks funny in this use foreach (@list) { # regex once instead of twice # no extra work shuffling $previous back and forth until needed if (m/^(.+)\: .+/ and $1 ne $previous) { $previous = $1; # take the sleep hit on the first item to save time later # (maybe even 5 seconds worth if you have a lot of items) sleep(5); } print $_; }

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2020-10-29 03:08 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (267 votes). Check out past polls.