Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003910]
[ambrus]: 1nickg: obviously the gamers don't know. but anyway, I need the whole room backlit, because watching a monitor in a dark room (like many people do) is tiring for my eyes, even more so than doing it in a lit room.
[1nickt]: ambrus I agree. I suspect one's eyes are always trying to adjust across the boundary between very bright and very dark ... like a camera's autofocus struggling to choose the target.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-03-27 14:00 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.