[Brisbane-pm] Still Struggling With Regex Syntax

Martin Jacobs martin_jacobs at optusnet.com.au
Sun Apr 15 21:33:48 PDT 2007


Hi folks,

I still don't get it (quite).

The story so far...

I have split my rainfall record, and the right-most scalar is $rain.

I now want to make sure that $rain holds a numeric value, without any  
whitespace, newlines or other nasties.

If I try

$rain = ($rain =~ m|\d+\.?\d*|);

It returns 1, which, presumably, is the number of times it gets a match.

What's the right syntax for saying 'make $rain contain the numeric  
values in $rain"?


Regards,
Martin
Visit my website...
http://web.mac.com/martin_jacobs1


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/brisbane-pm/attachments/20070416/1ed8d3c8/attachment.html 


More information about the Brisbane-pm mailing list