From: Ross Bamford Date: 2005-12-15T18:07:39+09:00 Subject: Re: regular expressions question On Thu, 15 Dec 2005 04:10:17 -0000, Jeff Wood wrote: > Ross Bamford wrote: > >> On Thu, 15 Dec 2005 00:16:52 -0000, Jeff Wood >> wrote: >> >>> You should be able to tell who this message is meant for: >>> >> >> Why not just address me directly? >> >>> PLEASE stop sending out code that uses any of the perl ${x} variables >>> ... >>> >> >> Well, okay. No need to shout though, is there? >> >> Just trying to put a bit back, you know? >> > Because it wasn't *just* directed at you ... there have been other posts > that included those same "warts". > Ok, sorry. I'm kind of paranoid ;) > And I didn't mean to shout, I just meant to exaggerate the please .... > *Please* would have been more appropriate. > I wondered that after I posted. Just my old Fidonet reflexes kicking in I suppose :) Just to say, though, that I tend to feel when someone asks a question, that I should give them all the alternative answers I have, and let them choose what suits them. If we really don't want people to use something (which I don't agree with in this case btw) then the way to do that is to make sure they completely understand that thing - only then can they choose for themselves whether it's good or not. (I'm thinking specifically about the anti-pattern wars that have consumed a lot of good work in Java over the past few years). So anyway, that's what I did. It's just natural I think to start with the shortest way ($1), move to the longer ways ($~[1], $~.captures[0]) and finally the 'long' way (/.../.match etc). I did slip in a subtle hint at the end that MatchData was worth looking up, with the $~.inspect line... Cheers, Ross -- Ross Bamford - rosco@roscopeco.remove.co.uk "\e[1;31mL"