| Newsgroups |
perl.cvs.perlfaq |
| Message-ID |
<[email protected]> |
cvsuser 02/05/20 09:50:09
Modified: . perlfaq4.pod
Log:
===> How do I determine whether a scalar is a number/whole/integer/float?
faq sync with 5.8 docs.
* added a blurb about Data::Types
* added an L<> around String::Scanf
Revision Changes Path
1.24 +8 -4 perlfaq/perlfaq4.pod
Index: perlfaq4.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq4.pod,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -w -r1.23 -r1.24
--- perlfaq4.pod 20 May 2002 16:45:46 -0000 1.23
+++ perlfaq4.pod 20 May 2002 16:50:08 -0000 1.24
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq4 - Data Manipulation ($Revision: 1.23 $, $Date: 2002/05/20 16:45:46 $)
+perlfaq4 - Data Manipulation ($Revision: 1.24 $, $Date: 2002/05/20 16:50:08 $)
=head1 DESCRIPTION
@@ -1921,6 +1921,10 @@
if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/)
{ print "a C float\n" }
+You can also use 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
@@ -1944,9 +1948,9 @@
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?