in reply to Find maximum (Activity) date from array hash.
A few things:
- You will have to dereference $_ : $_->{'Activity Date'}
- = isn't a comparison operator, it is the assignment operator. Use == instead for numerical tests. But you really need eq to check if both dates are the same.
- Finally, to see if one date is before or after another, you cannot use > or <. At least not if you use this date-format. The ISO date format (YYYY-MM-DD) can do that more easy. So either transform your date format into the ISO format of use one of the many Date or DateTime modules on CPAN.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial Deltronics
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Find maximum (Activity) date from array hash.
by Sami_R (Sexton) on Jun 02, 2020 at 23:41 UTC |
In Section
Seekers of Perl Wisdom