Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Regular Expressions

by toolic (Bishop)
on Nov 15, 2012 at 01:25 UTC ( #1003910=note: print w/replies, xml ) Need Help??


in reply to Regular Expressions

I don't think you nedd a nasty regex:
use warnings; use strict; use Scalar::Util qw(looks_like_number); while (<DATA>) { chomp; my $temp = $_; my $unit = lc chop $temp; if (looks_like_number($temp)) { print "temp = $temp : unit = $unit\n"; } } __DATA__ 55F 77c foo +0.4F

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003910]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2017-07-25 05:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (363 votes). Check out past polls.