Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: perl

by Fastolfe (Vicar)
on Nov 10, 2000 at 00:45 UTC ( #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,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://40814]
[LanX]: yep
[erix]: or Ctrl-U to view current html :P
[LanX]: name not id
[LanX]: id isn't approved AFAIK
[LanX]: name works
erix feels silly for having actually tested that contiguous values make no difference in CLUSTERing a table (At least, in postges)
[LanX]: Perl Monks Approved HTML tags
[LanX]: erix and his postguess ...
[erix]: (Grrres...)
[dabella12]: I have a problem install tK on CeontOs using perl 5.24

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-06-24 13:28 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (557 votes). Check out past polls.