develooper Front page | perl.perl5.porters | Postings from December 2010

Re: [perl #80030] Matching upper ASCII characters from file in RE patterns

Thread Previous | Thread Next
From:
SADAHIRO Tomoyuki
Date:
December 11, 2010 23:23
Subject:
Re: [perl #80030] Matching upper ASCII characters from file in RE patterns
Message ID:
20101212162246.C70B.CB027F2D@nifty.com

On Sat, 11 Dec 2010 14:43:16 +0100
demerphq <demerphq@gmail.com> wrote:

> On 9 December 2010 08:16, Eric Brine <ikegami@adaelis.com> wrote:
...
> > The effect of "use encoding" on \x escapes in literals and the like is why
> > some people avoid "use encoding".
> 
> Yes, for many including me, it seems rather insane, I guess for some
> it makes sense, but I really wish they had picked a different escape
> to use than remapping \x{}.

Dan kogai, the maintainer of Encode including encoding.pm, said in his blog
entitled "404 Blog Not Found",

  - The encoding pragma has been originally developped for the purpose
    of the transition from localized perl scripts such as jperl (japanized
    perl) to perl 5.8.
    "Use encoding 'UTF-8'" is beyond the scope of its purpose.
    "Use utf8" is enough to write perl codes in UTF-8.

    at 19:15, 22 June 2007
   perl - no encoding; # whenever possible
   http://blog.livedoor.jp/dankogai/archives/50857509.html
   (in Japanese)

  - "Use encoding;" should be used only when you need to rewrite
    an old code to run under a newer perl.

   at 14:30, 08 June 2009
   perl - use encoding; # WA KURO REKISHI
   (translation: perl - use encoding; # is a black history)
   http://blog.livedoor.jp/dankogai/archives/51221731.html
   (in Japanese)

If he had intended encoding.pm mainly for the purpose to make
porting localized codes from byte semantics to unicode semantics
more easily, it would make sense that encoding.pm automatically
converts not only raw literals but also metacharacters such as \xHH,
that have been used earlier than 5.6.

Regards,
SADAHIRO Tomoyuki


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About