in reply to How to keep the line breaks in the arguments when I invoke Perl?

Perl does not remove line breaks.

ccn@asus:perl -le 'print $ARGV[0]' '123
> 456
> 789'
123
456
789
ccn@asus:~$ 

May be your shell strips them?

  • Comment on Re: How to keep the line breaks in the arguments when I invoke Perl?

Replies are listed 'Best First'.
Re^2: How to keep the line breaks in the arguments when I invoke Perl?
by eye (Chaplain) on Dec 06, 2008 at 06:56 UTC
    Common shells (like bash, sh, csh, and ksh) use white space as a delimiter on the command line unless it is escaped or quoted. Thus,
    $ echo 'abc \ > def' abc def $ echo abc \ > def abc def $
    In a shell with a command history (like bash), you can see the shell's normalization in the command history.