could you please post the assignemts to these variables
Main Topics
Browse All TopicsI have created a grade book for myself to record my student's math grades. I want to compare the date that I gave the assignment with the quarter's beginning and ending date to show all grades for a given quarter.
...
if ( $assgndate >= $begdate && $assigndate <= $enddate).....
I have used Date::Manip to assist me with the comparison but when I few the error logs
I get error the following type of messages:
[ERROR]{ARGUMENT 20043xxxx is numeric in ge ( >=)...
I also get the same reply for the <= comparison, too
The script does work. I was just curious is there a better, hopefully easier, way to compare dates?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: TintinPosted on 2004-03-21 at 17:24:30ID: 10646136
If you are using ISO date formats, then you don't need a big, clumsy module like Date::Manip (unless you are doing other complicated date comparisons)
So if you have:
$assigndate=20040301;
$begdate=20040101;
$enddate=20041201;
Then doing
if ($assigndate >= $begdate and $assigndate <= $enddate) {
print "$assigndate is within the begin and end dates\n";
}
The error message you mention (although you missed a *very* important word, ie: "is" should be "isn't") is caused by one of the variables being non-numeric.
For example:
$ cat date
$a=20040101;
print if ($a >= 'a');
$ perl -w date
Argument "a" isn't numeric in numeric ge (>=) at date line 2.
Use of uninitialized value in print at date line 2.