The 1 is there because you have to supply some Perl code to -e, but in this case you don't care to do anything, you just want the side effects of the other switches. Using a 1 by itself as your "script" is just like having 1; on a line by itself in a script — it does nothing.
This can be used for such funny command lines as
perl -please textfile # print the contents of the textfile perl -deal # fire up the debugger for interactive fiddling
These are equivalent to
perl -p -l -e '"ase"' textfile perl -d -e '"al"'
where you simply have a string on a line by itself as the only statement in your "code", resulting in a no-op.
Makeshifts last the longest.
In reply to Re^3: perl one-liner doesn't autochomp input
by Aristotle
in thread perl one-liner doesn't autochomp input
by bronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |