|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Uncommon but Useful Perl Command Line Optionsby hardburn (Abbot) |
| on Jan 28, 2004 at 17:01 UTC ( [id://324810]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
'-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
|
|
||||||||||||||||||||||||