Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Problem when comparing strings as opposed to numerical values

by moritz (Cardinal)
on Jul 19, 2012 at 19:33 UTC ( #982699=note: print w/replies, xml ) Need Help??


in reply to Re^2: Problem when comparing strings as opposed to numerical values
in thread Problem when comparing strings as opposed to numerical values

You don't need eval for that.

my $re = qr{^(\d+):}; my $data = '123: 45'; if ($data =~ $re) { print "Matched!"; }
  • Comment on Re^3: Problem when comparing strings as opposed to numerical values
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982699]
help
Chatterbox?
[davido]: I find it annoying when I see "People tend to average between X and Y." .....um, that's not an average, that's a range.
[Corion]: Ask about the median ;)
[jdporter]: posts like this one make me realize, ruefully, just how much my mind has deteriorated in recent years/months.
[jdporter]: "When all your nails look like trolls, all your hammers look like trolls."

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2018-06-21 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (118 votes). Check out past polls.

    Notices?