in reply to Origin of 'md5sum' and 'sh' logs

This can be irrelevant to your current problems but can save you on future problems: -M $filepath can return a negative age too! :    -M  Script start time minus file modification time, in days. (see -X).

Secondly, you are creating "exception" being some kind of hash with a key also called "exception" and then in your last code you compare $exception as a string. I would doublecheck that this $exception is indeed $exception->{'exception'} and not the original hash exception.

Thirdly and most importantly, the first chunk of code you showed has an if-statement which the first branch returns nothing. So your "age" exceptions are not returned. The second branch does return an exception HASH though.

Perhaps, place my $exception; after if( -e $filepath), then go through all your exception if-checks, remove all other my $exception... and finally return $exception only if it is defined. To achieve a state of lift-off you need to insert two more closing curly brackets.

Replies are listed 'Best First'.
Re^2: Origin of 'md5sum' and 'sh' logs
by drw (Novice) on Feb 26, 2019 at 19:11 UTC

    So, you hit the nail on the head with the "exception" hash on point number two. It's weird that this hasn't come up with the other modules.

    In the interest of making everything clear for future users, I am going to make sure that any reference to the $exception hash and the $exception->{exception} scalar value is made explicit. It would seem that the original programmer only had to worry about the $exception merely being defined, and in my ignorance, ignored the value of the $exception->{exception} value, even though I was defining it in my return.

    I've only been working with perl for the past few months, sop if my vocabulary is off, please excuse me. Thank you for bringing that to my attention though, this has solved my problem.