Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!pacbell.com!ames!uhccux!munnari.oz.au!metro!usage.csd.unsw.oz.au!spectrum!cameron From: cameron@usage.csd.oz (Cameron Simpson,foo) Newsgroups: comp.lang.perl Subject: Re: unpack and endianness Message-ID: <887@usage.csd.unsw.oz.au> Date: 7 Oct 90 06:24:49 GMT References: <9847@jpl-devvax.JPL.NASA.GOV> Sender: news@usage.csd.unsw.oz.au Reply-To: cameron@spectrum.cs.unsw.oz.au (Cameron Simpson) Distribution: comp Organization: none Lines: 25 From article <9847@jpl-devvax.JPL.NASA.GOV>, by lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall): | In article <885@usage.csd.unsw.oz.au> cameron@spectrum.cs.unsw.oz.au (Cameron Simpson) writes: | : From article <9821@jpl-devvax.JPL.NASA.GOV>, by lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall): | : | $_[0] =~ s/([\0-\377])([\0-\377])/$2$1/g; | : | : Um, why can't I write | : $_[0] =~ s/(.)(.)/$2$1/g; | | Because . doesn't match \n. Goes back and Rs the FM more closely. Oh the embarrassment. | [\0-\377] is the most efficient way to match | everything currently. Maybe \e should match everything. Nah. What's wrong with [^]? | And \E would of course match nothing. :-) Correspondingly, []. Haven't tried it yet (does so). Ouch. The ] at the start of the pattern is taken as part of the range. A feature. Well, it was a nice idea... - Cameron Simpson cameron@spectrum.cs.unsw.oz.au "To every problem there is a simple, obvious, wrong solution."