in reply to How to print Unix newlines in Strawberry Perl on Windows
I defer to the correct answers below.
You can set the output record delimiter ($/ see perlvar for details) like so:
print "default line ending:\n"; { local $/="\n"; print "Unix line ending:\n"; } { local $/="\r\n"; print "Win/DOS line ending:\n"; } { local $/="\r"; print "Antique MAC line ending:\n"; }
Note: Untested, etc... Standard disclaimers apply.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to print Unix newlines in Strawberry Perl on Windows
by BrowserUk (Patriarch) on Feb 20, 2013 at 12:32 UTC | |
|
Re^2: How to print Unix newlines in Strawberry Perl on Windows
by Athanasius (Archbishop) on Feb 20, 2013 at 12:25 UTC |