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. - EricThread Previous | Thread Next