Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: perl

by Fastolfe (Vicar)
on Nov 10, 2000 at 00:45 UTC ( [id://40814]=note: print w/replies, xml ) Need Help??


in reply to perl

A one-liner that will do this:
perl -ne '$count++ unless /\S/; print "$count\n" if eof' <filename

Replies are listed 'Best First'.
Re^2: perl
by Random_Walk (Prior) on Sep 03, 2004 at 07:49 UTC
    A slightly shorter version perl -pe '$c++ unless /\S/}{$_=$c' Cheers,
    Random.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-24 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found