purl’s posterous

« Back to blog

Why ADSL is better than DSL for PERL_UNICODE

% echo 调查资料 | perl -e 's{@{[shift @ARGV]}}{INFO} && print $_ while (<STDIN>)' 资料
调查INFO

% echo 调查资料 | perl -e 's{资料}{INFO} && print $_ while (<STDIN>)'
调查INFO

% echo 调查资料 | PERL_UNICODE=DSL perl -e 's{资料}{INFO} && print $_ while (<STDIN>)'

% echo 调查资料 | PERL_UNICODE=DSL perl -e 's{@{[shift @ARGV]}}{INFO} && print $_ while (<STDIN>)' 资料

% echo 调查资料 | PERL_UNICODE=ADSL perl -e 's{@{[shift @ARGV]}}{INFO} && print $_ while (<STDIN>)' 资料
调查INFO

Comments (0)

Leave a comment...

 
To leave a comment on this posterous, please login by clicking one of the following.
Posterous-login     Connect     twitter