Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 wandering the Monastery: (9)
As of 2014-09-17 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (98 votes), past polls