FAQ
Hello,

I have a script that has been generating a strange error that I can't seem to find the source. In the script, at the top, we have the following to help trouble shoot it if any errors:

#!/usr/bin/perl
BEGIN { open (STDERR, ">./scriptname_error.log"); }

In the error_log file it generates we keep seeing the following error:

Invalid offset:

And that's it. Normally it will indicate the line#, date, detailed error, etc., like in the apache error_log file. but this is all it shows. This is a cron script also.

Any ideas or help with this error would be much appreciated.

TIA,

Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Search Discussions

  • Shawn H Corey at Feb 14, 2011 at 5:04 pm

    On 11-02-14 11:10 AM, Mike Blezien wrote:
    Invalid offset:

    And that's it. Normally it will indicate the line#, date, detailed error, etc., like in the apache error_log file. but this is all it shows. This is a cron script also.
    "Invalid offset" is not a Perl error message. Try scanning your script
    for the phrase.

    To list all error messages:
    #!/usr/bin/perl

    use strict;
    use warnings;

    for my $i ( 0 .. 256 ){
    $! = $i;
    printf "%4d: %s\n", 0+$!, "$!";
    }
    __END__


    --
    Just my 0.00000002 million dollars worth,
    Shawn

    Confusion is the first step of understanding.

    Programming is as much about organization and communication
    as it is about coding.

    The secret to great software: Fail early & often.

    Eliminate software piracy: use only FLOSS.
  • Rob Dixon at Feb 15, 2011 at 4:29 am

    On 14/02/2011 16:10, Mike Blezien wrote:
    I have a script that has been generating a strange error that I can't
    seem to find the source. In the script, at the top, we have the
    following to help trouble shoot it if any errors:

    #!/usr/bin/perl
    BEGIN { open (STDERR, ">./scriptname_error.log"); }

    In the error_log file it generates we keep seeing the following
    error:

    Invalid offset:

    And that's it. Normally it will indicate the line#, date, detailed
    error, etc., like in the apache error_log file. but this is all it
    shows. This is a cron script also.

    Any ideas or help with this error would be much appreciated.
    Searching my own Perl libraries, I find that exactly this error would be
    produced by a call to DateTime::TimeZone->new with an undefined value
    for the 'name' parameter. My version validates the parameters to the
    call and produces a more informative error message, but it is very
    likely that you have an earlier version that doesn't do that.

    HTH,

    Rob
  • Mike Blezien at Feb 15, 2011 at 8:57 am
    ----- Original Message -----
    From: "Rob Dixon" <rob.dixon@gmx.com>
    To: <beginners@perl.org>
    Cc: "Mike Blezien" <mickalo@frontiernet.net>
    Sent: Monday, February 14, 2011 10:29 PM
    Subject: Re: Unable to determine error source

    On 14/02/2011 16:10, Mike Blezien wrote:

    I have a script that has been generating a strange error that I can't
    seem to find the source. In the script, at the top, we have the
    following to help trouble shoot it if any errors:

    #!/usr/bin/perl
    BEGIN { open (STDERR, ">./scriptname_error.log"); }

    In the error_log file it generates we keep seeing the following
    error:

    Invalid offset:

    And that's it. Normally it will indicate the line#, date, detailed
    error, etc., like in the apache error_log file. but this is all it
    shows. This is a cron script also.

    Any ideas or help with this error would be much appreciated.
    Searching my own Perl libraries, I find that exactly this error would be
    produced by a call to DateTime::TimeZone->new with an undefined value
    for the 'name' parameter. My version validates the parameters to the
    call and produces a more informative error message, but it is very
    likely that you have an earlier version that doesn't do that.

    HTH,

    Rob
    Rob,

    yes that was exactly it. finally found it after some extensive digging throught
    the script.

    Thx's

    Mike

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedFeb 14, '11 at 4:11p
activeFeb 15, '11 at 8:57a
posts4
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase