[ABE.pm] arg isn't numeric?
Phil Lawrence
prlawrence at lehigh.edu
Wed Feb 11 10:30:36 CST 2004
Anyone see why I'm getting this error? (source at bottom) Shouldn't
the strings auto-convert to numeric?
> date_algo.pl '2000-05-07', '2003-11-26', 10
Argument "07," isn't numeric in subroutine entry at ./date_algo.pl line
13 (#1)
(W numeric) The indicated string was fed as an argument to an operator
that expected a numeric value instead. If you're fortunate the message
will identify which operator was so unfortunate.
Argument "26," isn't numeric in subroutine entry at ./date_algo.pl line
13 (#1)
begin: 2000-05-07,
end: 2003-11-26,
per: 10
delta: 1298
intrvl: 130
SOURCE:
#!/usr/local/bin/perl
use warnings;
use diagnostics;
use strict;
use POSIX;
use Date::Calc qw( :all );
my $begin = shift();
my $end = shift();
my $per = shift();
my $delta = Delta_Days( split('-',$begin), split('-',$end) );
my $intrvl = ceil($delta / $per);
print "begin: ", $begin, "\n";
print "end: ", $end, "\n";
print "per: ", $per, "\n";
print "delta: ", $delta, "\n";
print "intrvl: ", $intrvl, "\n";
More information about the ABE-pm
mailing list