in reply to Re: How to use -0 (zero) option in perl
in thread How to use -0 (zero) option in perl

There's no reason to use -0777 in that example.

perl -0777 -ne'print' in.txt

and

perl -ne'print' in.txt

produce the same output. The difference is the former only loops once since it loaded the entire file into memory at once. The latter reads and prints a line at a time.

You can see the difference in the following:

perl -0777 -nle'print "[[[$_]]]"' in.txt

and

perl -nle'print "[[[$_]]]"' in.txt

Replies are listed 'Best First'.
Re^3: How to use -0 (zero) option in perl
by perldesire (Scribe) on Jul 08, 2009 at 06:35 UTC
    Thank you so much for your reply.