Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: time passed calculation

by choroba (Cardinal)
on Jan 27, 2022 at 17:37 UTC ( [id://11140905]=note: print w/replies, xml ) Need Help??


in reply to time passed calculation

I can't reproduce your problem.

But the last comparison is definitely not doing what you think:

$Seen == $CurrentDateTime
Both the values are strings, so the numeric equality will interpret them in numeric context, leaving just the month. So, if you run the check around the midnight of a month break, there will be no output at all.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: time passed calculation
by frank1 (Beadle) on Jan 27, 2022 at 18:48 UTC

    after uploading the script this is the error i get, how can i fix it

    [Thu Jan 27 13:40:19 2022] [error] [pid 21201] mod_cgi.c(175): [client + 197.234.242.191:44580] AH01215: Use of uninitialized value in lc at +(eval 9) line 15.: /usr/home/file.pl [Thu Jan 27 13:40:19 2022] [error] [pid 21201] mod_cgi.c(175): [clien +t 197.234.242.191:44580] AH01215: Validation failed for type named Nu +m declared in package Specio::Library::Builtins (/usr/local/share/per +l/5.26.1/Specio/Library/Builtins.pm) at line 139 in sub named (eval) +with value undef: /usr/home/file.pl [Thu Jan 27 13:40:19 2022] [error] [pid 21201] mod_cgi.c(175): [clien +t 197.234.242.191:44580] AH01215: Trace begun at Specio::Exception->n +ew line 57: /usr/home/file.pl [Thu Jan 27 13:40:19 2022] [error] [pid 21201] mod_cgi.c(175): [clien +t 197.234.242.191:44580] AH01215: Specio::Exception::throw('Specio::E +xception', 'message', 'Validation failed for type named Num declared +in package Specio::Library::Builtins (/usr/local/share/perl/5.26.1/Sp +ecio/Library/Builtins.pm) at line 139 in sub named (eval) with value +undef', 'type', 'Specio::Constraint::Simple=HASH(0x55cf92bf0450)', 'v +alue', undef) called at (eval 226) line 88: /usr/home/file.pl [Thu Jan 27 13:40:19 2022] [error] [pid 21201] mod_cgi.c(175): [clien +t 197.234.242.191:44580] AH01215: DateTime::_check_from_epoch_params( +'epoch', undef) called at /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 +/DateTime.pm line 481: /usr/home/file.pl [Thu Jan 27 13:40:19 2022] [error] [pid 21201] mod_cgi.c(175): [clien +t 197.234.242.191:44580] AH01215: DateTime::from_epoch('DateTime', 'e +poch', undef) called at file.pl line 63: /usr/home/file.pl

      The last line of output seems to say that you are passing undef as the epoch. You need an actual number there, so you need to figure out why you do not have one. Can you duplicate the problem by running file.pl interactively? See the from_epoch() documentation if there is any question about how to call it.

      its funny that it works in chrome, but not working in Fire Fox mozila and Microsoft edage

        i think its my hosting provider had outdated date time module, coz when i downloaded latest one and use lib '.'; error seems to disappear now am getting DateTime::TimeZone version 2.44 required--this is only version 2.19

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-03-28 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found