[Israel.pm] difference between -0 and -0777

Gaal Yahas gaal at forum2.org
Mon Nov 15 13:47:07 PST 2004


On Mon, Nov 15, 2004 at 06:10:06PM +0000, Mikhael Goikhman wrote:
> > They mean the NUL character, ASCII 0.
> > 
> > I'd consider this to be a bug in perlrun; do you feel like sending a
> > perlbug?
> 
> I am not sure where you see a bug in perlrun man page. Compare:
> 
>   /bin/echo -e 'a\000b\000c\000d' | perl -n -e 'print "[$_]\n"' | cat -A
>   /bin/echo -e 'a\000b\000c\000d' | perl -n0 -e 'print "[$_]\n"' | cat -A
>   /bin/echo -e 'a\000b\000c\000d' | perl -n00 -e 'print "[$_]\n"' | cat -A
>   /bin/echo -e 'a\000b\000c\000d' | perl -n0x0 -e 'print "[$_]\n"' | cat -A
>   /bin/echo -e 'a\000b\000c\000d' | perl -n0777 -e 'print "[$_]\n"' | cat -A
> 
> All works as advertised. And if you want the output of the first and the
> last commands to be different, replace "c" with "\012" in echo.

(Replying also to Offer:)

Sorry, confusing 0777 and 000 was just a simple thinko on my part.

What I meant about the bug in perlrun was simply that a "null character"
was presumably supposed to mean NUL byte, i.e. ASCII zero. This in turn
seems like a simple typo in the man page.

-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/



More information about the Perl mailing list