in reply to DateTime throwing an error

Whenever I heard 'x stopped working', my first reaction is, 'OK -- what changed?'

Typically, software works one way only. When you change something, a different result is possible. Therefore, you must have changed something (or you're on a shared host, and someone installed, removed or changed one of the modules).

All we know so far is that when you run your script you get some sort of a compile error. Where?

Compilation failed in require at line 8.
Oh. OK, so what's on line 8? You haven't shown us. That early in the file, it might be a module's use statement. If that were the case, I'd try to just compile the module from that line, and see if that works.

Let us know what happens!

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^2: DateTime throwing an error
by nachtmsk (Acolyte) on Apr 16, 2021 at 03:12 UTC
    Hi Alex,

    Thanks for the reply. Your right, something had to have changed. But it wasn't the script. After I made the post I looked at the errors more carefully; in particular the error with the most information.

    Unrecognized character \x0E; marked by <-- HERE after warnings;<-- HERE near column 14 at /usr/local/share/perl/5.28.1/Role/Tiny/ line 4.

    I opened file at the end of that path "". Then I looked at line 4. Sure enough there was some odd control character there. In fact there were odd control characters peppered through the file. But the strange this is the timestamp on the file was from 2019. So it was the original timestamp of the installed file (my script was made in 2021). Fortunately, I have a copy of this same file ( on another Linux box I have that was built at the same time. I checked that file and it had no control characters. I swapped it out with the (corrupted) one. Then ran my script - and it was fine. No more errors.

    My problem is solved but what I don't understand is how the file got corrupt (maybe a power surge or power outage?). But what I really don't understand is how that file from 2019 ( was changed but the filetimestamp didn't change. Maybe a corruption doesn't always trigger a timestamp update?

    Thanks again for the reply. I was going to write that I had it solved just as I saw your post.


      what I don't understand is how the file got corrupt

      Time for a filesystem check (fsck) and a check of the disks (smartctl). If a RAID is involved, also check the RAID for errors (cat /proc/mdstat for a Linux SW RAID).


      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        Yeah, will do.

        I should have mentioned: this is part of a security application I wrote to run on a series of Raspberry Pi's. They each take a picture in a certain area and move it over to the main Pi which processes the images into a DB and finally into a simple web page which this Pi hosts.

        The "hard drive" of this Pi is actually a micro SD card. So no Raid or anything fancy.

      > I don't understand is how the file got corrupt (maybe a power surge or power outage?)

      Sounds like it was purposefully edited somehow. Or some well aimed sun spots. Let's go with that :)