Perl script fails silently at start, can't debug

Discussion in 'Perl Misc' started by Jon Hendry, Mar 7, 2007.

  1. Jon Hendry

    Jon Hendry Guest

    Hi,

    I'm working on some perl scripts - one longish script and some
    short .pm's containing object classes (one each).

    This morning I was able to run the script. After lunch, it stopped
    working for no apparent reason. It just fails, silently.

    If I try running it in the debugger, the script terminates instantly,
    with no error messages.

    perl -wc reveals no problems with any of the files.

    For a while, after experimenting with commenting out use statements, I
    was able to get it to a point where it would fail and report that one
    of the .pm's didn't return true, but that wasn't true either - all the
    pm's included a terminal 1;.

    Has anyone seen this before? Can anyone suggest a course of action? I
    suspect it has something to do with 'use'd code.

    I'm on OS X 10.4.8

    Thanks!
    Jon Hendry, Mar 7, 2007
    #1
    1. Advertising

  2. Jon Hendry

    Uri Guttman Guest

    >>>>> "JH" == Jon Hendry <> writes:

    JH> I'm working on some perl scripts - one longish script and some
    JH> short .pm's containing object classes (one each).

    JH> This morning I was able to run the script. After lunch, it stopped
    JH> working for no apparent reason. It just fails, silently.

    what did you have for lunch? were there any bugs in it?

    JH> If I try running it in the debugger, the script terminates instantly,
    JH> with no error messages.

    JH> perl -wc reveals no problems with any of the files.

    JH> For a while, after experimenting with commenting out use
    JH> statements, I was able to get it to a point where it would fail
    JH> and report that one of the .pm's didn't return true, but that
    JH> wasn't true either - all the pm's included a terminal 1;.

    i trust perl more than i trust what you say. :)

    if perl says one module is false then there must be something in there
    that you don't see at the end. or some other issue you can't see but
    perl can.

    JH> Has anyone seen this before? Can anyone suggest a course of action? I
    JH> suspect it has something to do with 'use'd code.

    no idea. you should try to reduce this to a small example which shows
    the same problems and post that here.

    uri

    --
    Uri Guttman ------ -------- http://www.stemsystems.com
    --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
    Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
    Uri Guttman, Mar 7, 2007
    #2
    1. Advertising

  3. Jon Hendry

    DJ Stunks Guest

    On Mar 7, 2:43 pm, "Jon Hendry" <> wrote:
    > Hi,
    >
    > I'm working on some perl scripts - one longish script and some
    > short .pm's containing object classes (one each).
    >
    > This morning I was able to run the script. After lunch, it stopped
    > working for no apparent reason. It just fails, silently.
    >
    > If I try running it in the debugger, the script terminates instantly,
    > with no error messages.
    >
    > perl -wc reveals no problems with any of the files.
    >
    > For a while, after experimenting with commenting out use statements, I
    > was able to get it to a point where it would fail and report that one
    > of the .pm's didn't return true, but that wasn't true either - all the
    > pm's included a terminal 1;.


    WAG - is it missing the blank line at the end of the file after the 1?

    -jp
    DJ Stunks, Mar 7, 2007
    #3
  4. Jon Hendry

    Jon Hendry Guest

    On Mar 7, 6:20 pm, "DJ Stunks" <> wrote:
    > On Mar 7, 2:43 pm, "Jon Hendry" <> wrote:
    >
    >
    >
    > > Hi,

    >
    > > I'm working on some perl scripts - one longish script and some
    > > short .pm's containing object classes (one each).

    >
    > > This morning I was able to run the script. After lunch, it stopped
    > > working for no apparent reason. It just fails, silently.

    >
    > > If I try running it in the debugger, the script terminates instantly,
    > > with no error messages.

    >
    > > perl -wc reveals no problems with any of the files.

    >
    > > For a while, after experimenting with commenting out use statements, I
    > > was able to get it to a point where it would fail and report that one
    > > of the .pm's didn't return true, but that wasn't true either - all the
    > > pm's included a terminal 1;.

    >
    > WAG - is it missing the blank line at the end of the file after the 1?
    >
    > -jp


    Hm. Lemme check.
    Jon Hendry, Mar 7, 2007
    #4
  5. Jon Hendry

    Jon Hendry Guest

    On Mar 7, 6:22 pm, "Jon Hendry" <> wrote:
    > On Mar 7, 6:20 pm, "DJ Stunks" <> wrote:
    >
    >
    >
    > > On Mar 7, 2:43 pm, "Jon Hendry" <> wrote:

    >
    > > > Hi,

    >
    > > > I'm working on some perl scripts - one longish script and some
    > > > short .pm's containing object classes (one each).

    >
    > > > This morning I was able to run the script. After lunch, it stopped
    > > > working for no apparent reason. It just fails, silently.

    >
    > > > If I try running it in the debugger, the script terminates instantly,
    > > > with no error messages.

    >
    > > > perl -wc reveals no problems with any of the files.

    >
    > > > For a while, after experimenting with commenting out use statements, I
    > > > was able to get it to a point where it would fail and report that one
    > > > of the .pm's didn't return true, but that wasn't true either - all the
    > > > pm's included a terminal 1;.

    >
    > > WAG - is it missing the blank line at the end of the file after the 1?

    >
    > > -jp

    >
    > Hm. Lemme check.


    Aha! Something seems to have gone wonky with line endings. There were
    blank lines, but they weren't being treated as such.

    (I ran a diff between two versions of the script, neither of which
    worked anymore, and diff complained about the lack of a newline at the
    end of the files, even though there visually appeared to be.)

    Thanks!

    It kinda works now, except for instance \n's aren't being treated as
    newlines in the output. But at least I can see that it's doing
    something.
    Jon Hendry, Mar 7, 2007
    #5
  6. Jon Hendry

    Jon Hendry Guest

    On Mar 7, 6:39 pm, "Jon Hendry" <> wrote:
    > On Mar 7, 6:22 pm, "Jon Hendry" <> wrote:
    >
    >
    >
    > > On Mar 7, 6:20 pm, "DJ Stunks" <> wrote:

    >
    > > > On Mar 7, 2:43 pm, "Jon Hendry" <> wrote:

    >
    > > > > Hi,

    >
    > > > > I'm working on some perl scripts - one longish script and some
    > > > > short .pm's containing object classes (one each).

    >
    > > > > This morning I was able to run the script. After lunch, it stopped
    > > > > working for no apparent reason. It just fails, silently.

    >
    > > > > If I try running it in the debugger, the script terminates instantly,
    > > > > with no error messages.

    >
    > > > > perl -wc reveals no problems with any of the files.

    >
    > > > > For a while, after experimenting with commenting out use statements, I
    > > > > was able to get it to a point where it would fail and report that one
    > > > > of the .pm's didn't return true, but that wasn't true either - all the
    > > > > pm's included a terminal 1;.

    >
    > > > WAG - is it missing the blank line at the end of the file after the 1?

    >
    > > > -jp

    >
    > > Hm. Lemme check.

    >
    > Aha! Something seems to have gone wonky with line endings. There were
    > blank lines, but they weren't being treated as such.
    >
    > (I ran a diff between two versions of the script, neither of which
    > worked anymore, and diff complained about the lack of a newline at the
    > end of the files, even though there visually appeared to be.)
    >
    > Thanks!
    >
    > It kinda works now, except for instance \n's aren't being treated as
    > newlines in the output. But at least I can see that it's doing
    > something.


    Just for posterity, changing the file encoding in Xcode back to
    'Western (Mac OS Roman)' from 'Non-lossy ASCII' fixed the problem with
    the \n's.
    Jon Hendry, Mar 7, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ronald Fischer

    JSP silently fails to compile

    Ronald Fischer, Oct 13, 2003, in forum: Java
    Replies:
    9
    Views:
    530
    John C. Bollinger
    Oct 21, 2003
  2. Ben Phillips

    SwingWorker.execute() silently fails?

    Ben Phillips, Oct 8, 2008, in forum: Java
    Replies:
    3
    Views:
    611
    Ben Phillips
    Oct 9, 2008
  3. Leslie Viljoen

    SQL Server DBI insert silently fails

    Leslie Viljoen, Jul 28, 2006, in forum: Ruby
    Replies:
    2
    Views:
    215
    Leslie Viljoen
    Jul 28, 2006
  4. Bill H
    Replies:
    3
    Views:
    142
    Bill H
    Sep 18, 2007
  5. Phil Powell
    Replies:
    21
    Views:
    211
    Randy Webb
    Apr 19, 2006
Loading...

Share This Page