From owner-freebsd-questions@FreeBSD.ORG Fri Oct 9 23:08:48 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 328771065679 for ; Fri, 9 Oct 2009 23:08:48 +0000 (UTC) (envelope-from steve@ibctech.ca) Received: from smtp.ibctech.ca (v6.ibctech.ca [IPv6:2607:f118::b6]) by mx1.freebsd.org (Postfix) with SMTP id C581E8FC13 for ; Fri, 9 Oct 2009 23:08:47 +0000 (UTC) Received: (qmail 10436 invoked by uid 89); 9 Oct 2009 23:08:40 -0000 Received: from unknown (HELO ?IPv6:2607:f118::5?) (steve@ibctech.ca@2607:f118::5) by 2607:f118::b6 with ESMTPA; 9 Oct 2009 23:08:40 -0000 Message-ID: <4ACFC288.6050104@ibctech.ca> Date: Fri, 09 Oct 2009 19:08:56 -0400 From: Steve Bertrand User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Lars Eighner References: <200910091026.n99AQPUv014685@lurza.secnetix.de> <20091009134605.F95011@qroenaqrq.6qbyyneqvnyhc.pbz> In-Reply-To: <20091009134605.F95011@qroenaqrq.6qbyyneqvnyhc.pbz> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Oliver Fromme , freebsd-questions@freebsd.org Subject: Re: for perl wizards. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 23:08:48 -0000 Lars Eighner wrote: > On Fri, 9 Oct 2009, Warren Block wrote: > >> On Fri, 9 Oct 2009, Oliver Fromme wrote: >> >>> Gary Kline 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. Given that it seems as though you do know what you are doing (which makes me believe that you actually have the ability to provide valuable input), why would you be so negative? You have the answers. Why not use your energy in sharing it with a positive spin? Steve ps. 'twas tough resisting feeding the troll regarding the Perl comments. However, those who use it know the truth, and those who haven't will eventually learn the truth.