Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Perl5 version

by sleepingsquirrel (Chaplain)
on Aug 04, 2004 at 17:30 UTC ( [id://380051]=note: print w/replies, xml ) Need Help??


in reply to Perl6::Rules Rules

Just for the heck of it, I'd thought I'd throw out the perl5 version...
$oporm = qr{[+-]?}; $digit = qr{\d}; $fixed = qr{ $oporm $digit+ \.? $digit* | $oporm $digit* \.? $digit+ }x; $scino = qr{ $fixed [eE] $oporm $digit+ | $fixed | $digit+ }x; sub is_scino { my $num = shift; if ($num =~ m/^$scino$/) { $num = $num + 0; # is this really necessary? return $num; } return undef; } sub is_fixed { my $num = shift; if ($num =~ m/^$fixed$/) { $num = $num + 0; return $num; } return undef; }


-- All code is 100% tested and functional unless otherwise noted.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://380051]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-25 15:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found