kp2a has asked for the wisdom of the Perl Monks concerning the following question:

program dies first line afer use statement even a blank line with no message except line number how to debug? perl -c reports systax OK both calling and called program

Replies are listed 'Best First'.
Re: dies with no message
by Corion (Patriarch) on Sep 29, 2016 at 20:54 UTC

    Maybe one of the use'd modules calls exit without an error message?

    Alternatively, the module might close STDIN and STDERR so you never get to see those messages.

    Start removing/commenting out use lines

    in your program.

    Also, you mention two programs, one calling and a called program. Maybe the calling program closes STDIN and STDERR of the child, and thus hides the error from you?

Re: dies with no message
by BrowserUk (Patriarch) on Sep 29, 2016 at 21:32 UTC
    how to debug?

    Simplest way I know is: Devel::Trace. It's a single, pure perl file, so installation is as simple and copy&paste if need be; and the just run your script using:

    perl -d:Trace yourScript.pl

    It will trace out all the lines of your script and all the modules it uses, until it terminates; the last line of the trace will tell you where it stopped, and that's 90% of the battle in working out why?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.