Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Finding duplicated code in Perl

by toma (Vicar)
on Nov 27, 2003 at 04:28 UTC ( #310472=note: print w/ replies, xml ) Need Help??


in reply to Finding duplicated code in Perl

my %code; my @lines; while(<>) { push @lines, $_; $code{$_}++; } for (@lines) { print "$code{$_}:\t $_"; }
It should work perfectly the first time! - toma


Comment on Re: Finding duplicated code in Perl
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2015-07-07 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls