diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-20 14:46:15 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-20 14:46:15 +0000 |
commit | b5b6f21045162f5187f396c06212333eaec75130 (patch) | |
tree | 05d08399410bbbcfae600f35fa6702e8026cec22 /pod/perlfaq4.pod | |
parent | 39183afa3a8d91875ee7007072321656ff8315ad (diff) | |
download | perl-b5b6f21045162f5187f396c06212333eaec75130.tar.gz |
A bit of self-promotion from David Wheeler <david@wheeler.net> :-)
p4raw-id: //depot/perl@16713
Diffstat (limited to 'pod/perlfaq4.pod')
-rw-r--r-- | pod/perlfaq4.pod | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pod/perlfaq4.pod b/pod/perlfaq4.pod index aeb7c14c19..5ee6a6f16a 100644 --- a/pod/perlfaq4.pod +++ b/pod/perlfaq4.pod @@ -1920,6 +1920,10 @@ Assuming that you don't care about IEEE notations like "NaN" or if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/) { print "a C float\n" } +Or you could check out the L<Data::Types|Data::Types> module on the CPAN, +which exports functions that validate data types using these and other regular +expressions. + If you're on a POSIX system, Perl's supports the C<POSIX::strtod> function. Its semantics are somewhat cumbersome, so here's a C<getnum> wrapper function for more convenient access. This function takes @@ -1943,9 +1947,9 @@ if you just want to say, ``Is this a float?'' sub is_numeric { defined getnum($_[0]) } -Or you could check out the String::Scanf module on CPAN instead. The -POSIX module (part of the standard Perl distribution) provides the -C<strtod> and C<strtol> for converting strings to double and longs, +Or you could check out the L<String::Scanf|String::Scanf> module on the CPAN +instead. The POSIX module (part of the standard Perl distribution) provides +the C<strtod> and C<strtol> for converting strings to double and longs, respectively. =head2 How do I keep persistent data across program calls? |