From: Rafael Garcia-Suarez Date: Thu, 18 Sep 2003 21:29:23 +0000 (+0000) Subject: Perlfaq nits from Iain Truskett. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f0d19b68a1c8d6c2dc3a5b85d4616bcdecd73ff9;p=p5sagit%2Fp5-mst-13.2.git Perlfaq nits from Iain Truskett. (from the perlfaq-workers list) p4raw-id: //depot/perl@21283 --- diff --git a/pod/perlfaq2.pod b/pod/perlfaq2.pod index 54627ea..8649ca8 100644 --- a/pod/perlfaq2.pod +++ b/pod/perlfaq2.pod @@ -69,7 +69,7 @@ approaches are doomed to failure. One simple way to check that things are in the right place is to print out the hard-coded @INC that perl looks through for libraries: - % perl -e 'print join("\n",@INC)' + % perl -le 'print for @INC' If this command lists any paths that don't exist on your system, then you may need to move the appropriate libraries to these locations, or create diff --git a/pod/perlfaq4.pod b/pod/perlfaq4.pod index e2054e4..70af877 100644 --- a/pod/perlfaq4.pod +++ b/pod/perlfaq4.pod @@ -2003,13 +2003,17 @@ Assuming that you don't care about IEEE notations like "NaN" or if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/) { print "a C float\n" } -You can also use the L module on -the CPAN, which exports functions that validate data types -using these and other regular expressions, or you can use -the C module from CPAN which has regular -expressions to match various types of numbers. - -If you're on a POSIX system, Perl's supports the C +There are also some commonly used modules for the task. +L (distributed with 5.8) provides access to perl's +internal function C for determining +whether a variable looks like a number. L +exports functions that validate data types using both the +above and other regular expressions. Thirdly, there is +C which has regular expressions to match +various types of numbers. Those three modules are available +from the CPAN. + +If you're on a POSIX system, Perl supports the C function. Its semantics are somewhat cumbersome, so here's a C wrapper function for more convenient access. This function takes a string and returns the number it found, or C for input that @@ -2032,7 +2036,7 @@ if you just want to say, ``Is this a float?'' sub is_numeric { defined getnum($_[0]) } -Or you could check out the L module on the CPAN +Or you could check out the L module on the CPAN instead. The POSIX module (part of the standard Perl distribution) provides the C and C for converting strings to double and longs, respectively. diff --git a/pod/perlfaq8.pod b/pod/perlfaq8.pod index e2ea3e7..2fceab1 100644 --- a/pod/perlfaq8.pod +++ b/pod/perlfaq8.pod @@ -1163,7 +1163,7 @@ See Perl's L for more information. use lib "$FindBin::Bin"; use your_own_modules; -=head2 How do I add a directory to my include path at runtime? +=head2 How do I add a directory to my include path (@INC) at runtime? Here are the suggested ways of modifying your include path: