From owner-freebsd-questions@FreeBSD.ORG Fri Oct 9 12:56:45 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 B61841065679 for ; Fri, 9 Oct 2009 12:56:45 +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 3D2958FC18 for ; Fri, 9 Oct 2009 12:56:45 +0000 (UTC) Received: (qmail 87853 invoked by uid 89); 9 Oct 2009 12:56:34 -0000 Received: from unknown (HELO ?IPv6:2607:f118::5?) (steve@ibctech.ca@2607:f118::5) by 2607:f118::b6 with ESMTPA; 9 Oct 2009 12:56:34 -0000 Message-ID: <4ACF3315.1020802@ibctech.ca> Date: Fri, 09 Oct 2009 08:56:53 -0400 From: Steve Bertrand User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Lars Eighner References: <20091009083516.GA60096@thought.org> <20091009043751.P92438@qroenaqrq.6qbyyneqvnyhc.pbz> In-Reply-To: <20091009043751.P92438@qroenaqrq.6qbyyneqvnyhc.pbz> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gary Kline , FreeBSD Mailing List 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 12:56:45 -0000 Lars Eighner wrote: > > On Fri, 9 Oct 2009, 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're kidding, aren't you? Have you not ever overlooked something like a misplaced apostrophe? The OP came with nearly workable code, in which I can tell that he spent some time researching and toying with before asking for help. > And finally, there are tons of perl forums, > mailing lists, and newsgroups. Pick one to ask perl questions. Why? The OP is not looking for help identifying why a complex subroutine is doing something unexpected. He is asking how to modify portions of his file system on FreeBSD using the command line. Would you have been so harsh if he was asking how to do it with sed? awk? I for one welcome these Perl questions. I've asked them here before, and for simple tasks, will ask them here again. Steve