Perl script fails silently at start, can't debug

J

Jon Hendry

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!
 
U

Uri Guttman

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
 
D

DJ Stunks

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
 
J

Jon Hendry

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.
 
J

Jon Hendry

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,880
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top