Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^10: One-liner only checking the first line of the input file

by 1nickt (Canon)
on Nov 12, 2015 at 14:36 UTC ( [id://1147576]=note: print w/replies, xml ) Need Help??


in reply to Re^9: One-liner only checking the first line of the input file
in thread One-liner only checking the first line of the input file

There's also the --output-line-ending flag to perltidy. (See Perltidy).

$ perltidy -ole=unix foo.pl

The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^11: One-liner only checking the first line of the input file
by stevieb (Canon) on Nov 12, 2015 at 16:50 UTC

    That's a nice trick :) Regarding my module, its purpose was to dynamically work with any file, regardless of its endings while on any platform, without clobbering the original endings (it effectively loads up the file using the local platform's record separator, and then writes back to a file with the recsep found in the original file).

    Imagine automatically editing 5,000 files where there is a mix of various line endings. My module eliminates the need to even check each file, they will all be written back to orig endings. This was a scenario I ran into with another one of my modules, so I wrote this one to work around the problem.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 21:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found