Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Re: LOC

by jsprat (Curate)
on Jul 25, 2002 at 20:13 UTC ( #185318=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: LOC
in thread Counting lines of C code

Or equivalently, (still naive as dws points out, but a few less keystrokes :-)

perl -lne'}{print$.' file1.c file2.c

Update: Massaged one-liner, but still manage to lose by 2 strokes...


Comment on Re: Re: Re: LOC
Download Code
Re: Re: Re: Re: LOC
by Chmrr (Vicar) on Jul 25, 2002 at 20:28 UTC

    If it's a golfin' that ye'll be wantin', just say so!

    perl -ple'}{$_=$.' file1.c file2.c

    Update: Shaved off a semicolon.

    perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-10-02 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (42 votes), past polls