Is -C useless?

Paul LeoNerd Evans leonerd at leonerd.org.uk
Fri Sep 12 00:28:22 BST 2008


On Thu, 11 Sep 2008 15:19:17 +0200
Paul Johnson <paul at pjcj.net> wrote:

> since the standard streams are already set up
>   at this point in the execution of the perl interpreter. You can use
>   binmode() instead to get the desired behaviour.

Waaait a moment.

Why can't -C just call binmode itself?

This is getting stupider by the moment.

I've even tried this; it JustWorks:

 #!/usr/bin/perl
 BEGIN { exec $^X, "-COL", "-f", $0, @ARGV unless ${^UNICODE} }

 print "Hello w\xe9rld\n";

 $ ./test-unicode.pl 
 Hello wérld

-- 
Paul "LeoNerd" Evans

leonerd at leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://london.pm.org/pipermail/london.pm/attachments/20080912/3c988b0e/signature.pgp


More information about the london.pm mailing list