Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Re: Re: duplicate lines in array

by Fletch (Bishop)
on Jan 23, 2004 at 15:01 UTC ( [id://323575]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: duplicate lines in array
in thread duplicate lines in array

Bah, you call that golfing? :) You used multi-letter variable names and more than one space.

/(H\(\d+\))/&&push@{$c{$1}},"$_\n"for@r; print map@{$c{$_}},grep$#{$c{$_}},keys%c;

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: duplicate lines in array
by Skeeve (Parson) on Jan 23, 2004 at 15:15 UTC
    How comes you missed this?
    /H\(\d+\)/&&push@{$c{$&}},$_.$/for@r;
    You could even save "keys" because no value will be a key:
    print map@{$c{$_}},grep$#{$c{$_}}>0,%c;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-24 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found