Beefy Boxes and Bandwidth Generously Provided by pair Networks Russ
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: add a line based on maxline length

by Shendal (Hermit)
on Jul 31, 2002 at 19:57 UTC ( #186579=note: print w/ replies, xml ) Need Help??


in reply to add a line based on maxline length

Is this what you're looking for?

use strict; my $max = 0; foreach (<DATA>) { s/(\r|\032)$//; $max = length($_) if length($_) > $max; } print " " x $max; __DATA__ This is my file it doesn't have a blank line at the end of it based on the maxline count of the file that it read.

Cheers,
Shendal


Comment on Re: add a line based on maxline length
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-04-17 01:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (437 votes), past polls