|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Uncommon but Useful Perl Command Line Optionsby hardburn (Abbot) |
| on Jan 28, 2004 at 22:01 UTC ( #324810=note: print w/ replies, xml ) | Need Help?? |
|
'-l' has a dual nature - on input it behaves like chomp(), automatically removing newline characters, while on output, as we've seen, it becomes the anti-chomp, adding newlines. For completeness, I would mention that '-l' is implemented by messing with $\ and $/:
Also, you can specifiy a different character (in octal) on the command line for -l to use for $\ (output records):
-0 can also take an octal number, but this time it sets $/ (input records):
---- : () { :|:& };: Note: All code is untested, unless otherwise stated
In Section
Tutorials
|
|
||||||||||||||||||||