[tpm] Regex question
Olaf Alders
olaf.alders at gmail.com
Fri Oct 19 22:46:52 PDT 2012
On 2012-10-20, at 12:02 AM, Liam R E Quin wrote:
> [resending from the right account - I hate the Evolution mailer sometimes. I should switch to Inteligent Design]
>
> On Fri, 2012-10-19 at 21:43 -0400, Chris Jones wrote:
>
>> Kitchen Area 1C Spc zn 2750. 1400. 0.249 1.000
>> Kitchen Area 1C Pl zn 0. 0. 0.000 0.000
>
>> my @zoneLine = split /[\w\s{0,25)$]/+\w{4}/, $inLine;
>
> This is muddled thinking. Take off your shoes, drink a cup of tea, and
> try again :-)
>
> Someone else suggested using unpack but I'd probably stick with regular
> expressions if you can take the time to get used to them, because
> they're really really useful an powerful once you have tamed them.
In the long run the experience with regexes may be more useful day to day, but I think unpack is actually quite well suited to this problem. "perldoc perlpacktut" expands nicely on the example Tom gave. In this case, at least, unpack is probably less noisy.
Olaf
--
Olaf Alders
olaf.alders at gmail.com
http://www.wundercounter.com
http://twitter.com/wundercounter
866 503 2204 (Toll free - North America)
416 944 8306 (direct)
More information about the toronto-pm
mailing list