in reply to standard perl routine
You have to tell perl to actually use the POSIX module. It's not enough to just put it in your @INC path, you have to specifically tell Perl to use it, as follows:
#!/usr/bin/perl use strict; use warnings; use POSIX; # This line loads the POSIX module and imports pow(). print pow( 2, 3 ); # See? Now it works.
By the way: my $number = pow( 2, 3 ); could be written like this instead: my $number = 2 ** 3;, and that wouldn't require the use of the POSIX module.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: standard perl routine
by rocketboy (Novice) on Apr 30, 2006 at 08:33 UTC | |
by CountZero (Bishop) on Apr 30, 2006 at 09:20 UTC | |
by g0n (Priest) on Apr 30, 2006 at 09:44 UTC |