![]() |
Perl script fails silently at start, can't debug
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! |
Re: Perl script fails silently at start, can't debug
>>>>> "JH" == Jon Hendry <jonhendry_usenet@mac.com> 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 ------ uri@stemsystems.com -------- http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org |
Re: Perl script fails silently at start, can't debug
On Mar 7, 2:43 pm, "Jon Hendry" <jonhendry_use...@mac.com> 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 |
Re: Perl script fails silently at start, can't debug
On Mar 7, 6:20 pm, "DJ Stunks" <DJStu...@gmail.com> wrote:
> On Mar 7, 2:43 pm, "Jon Hendry" <jonhendry_use...@mac.com> 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. |
Re: Perl script fails silently at start, can't debug
On Mar 7, 6:22 pm, "Jon Hendry" <jonhendry_use...@mac.com> wrote:
> On Mar 7, 6:20 pm, "DJ Stunks" <DJStu...@gmail.com> wrote: > > > > > On Mar 7, 2:43 pm, "Jon Hendry" <jonhendry_use...@mac.com> 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. |
Re: Perl script fails silently at start, can't debug
On Mar 7, 6:39 pm, "Jon Hendry" <jonhendry_use...@mac.com> wrote:
> On Mar 7, 6:22 pm, "Jon Hendry" <jonhendry_use...@mac.com> wrote: > > > > > On Mar 7, 6:20 pm, "DJ Stunks" <DJStu...@gmail.com> wrote: > > > > On Mar 7, 2:43 pm, "Jon Hendry" <jonhendry_use...@mac.com> 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. |
| All times are GMT. The time now is 06:59 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.