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

Re: The Unicode Bug still bites?

Thread Previous | Thread Next
From:
Eric Brine
Date:
December 25, 2011 16:48
Subject:
Re: The Unicode Bug still bites?
Message ID:
CALJW-qGXJh+Avr249ht4+n5UXfcj9FWQ6AdqOEUchyKTGay7gA@mail.gmail.com
On Sun, Dec 25, 2011 at 6:55 PM, Father Chrysostomos <sprout@cpan.org>wrote:

>
> On Dec 25, 2011, at 3:25 PM, Eric Brine wrote:
>
>
>
> On Sun, Dec 25, 2011 at 9:46 AM, Father Chrysostomos <sprout@cpan.org>wrote:
>
>> Yves wrote:
>> > On 14 April 2011 02:51, Tom Christiansen <tchrist@perl.com> wrote:
>> > > What *do* people use quotemeta for if not for regexes??
>> >
>> > It tends to escape things reasonably well for a number of purposes.
>>
>> Such as file names in backticks.
>>
>
> Nit: quotemeta is not perfect at generating shell literals. It fails for
> carriage returns.
>
> I meant line feed, sorry.


> $ perl -e' print quotemeta "\cm\cj"'|hexdump
> 0000000 5c 0d 5c 0a
> 0000004
>

Now try using the result as a file name. "\"+NL doesn't mean NL to sh, it's
a line break that's not a statement break.

quotemeta is already broken wrt creating sh literals.

- Eric

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