Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Oct 2009 13:47:43 -0500 (CDT)
From:      Lars Eighner <luvbeastie@larseighner.com>
To:        Warren Block <wblock@wonkity.com>
Cc:        Oliver Fromme <olli@lurza.secnetix.de>, freebsd-questions@freebsd.org
Subject:   Re: for perl wizards.
Message-ID:  <20091009134605.F95011@qroenaqrq.6qbyyneqvnyhc.pbz>
In-Reply-To: <alpine.BSF.2.00.0910090731450.28005@wonkity.com>
References:  <200910091026.n99AQPUv014685@lurza.secnetix.de> <alpine.BSF.2.00.0910090731450.28005@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 9 Oct 2009, Warren Block wrote:

> On Fri, 9 Oct 2009, Oliver Fromme wrote:
>
>> Gary Kline <kline@thought.org> wrote:
>> >
>> >         Whenever I save a wordpeocessoe file [OOo, say] into a
>> >         text file, I get a slew of hex codes to indicate the char to be
>> >         used.  I'm looking for a perl one-liner or script to translate
>> >         hex back into ', ", -- [that's a dash), and so forth.  Why does
>> >         this fail to trans the hex code to an apostrophe?
>> >
>> >         perl -pi.bak -e 's/\xe2\x80\x99/'/g'
>> 
>> You need to escape the inner quote character, of course.
>> I think sed is better suited for this task than perl.
>
> That's twice now people have suggested sed instead of perl.  Why?  For many 
> uses, perl is a better sed than sed.  The regex engine is far more powerful 
> and escapes are much simpler.

Because sed is stable and perl is getting all OO and flaky.  Sed will work
like sed for so long as there are unix-like systems.  It is not clear that
perl is going to continue to work.

-- 
Lars Eighner
http://www.larseighner.com/index.html
8800 N IH35 APT 1191 AUSTIN TX 78753-5266




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091009134605.F95011>