Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: add a line based on maxline length

by Shendal (Hermit)
on Jul 31, 2002 at 19:57 UTC ( [id://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

Log In?
Username:
Password:

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

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

    No recent polls found