Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Fatal error only in debug modus

by Ben Win Lue (Friar)
on Dec 28, 2010 at 09:20 UTC ( #879402=perlquestion: print w/replies, xml ) Need Help??
Ben Win Lue has asked for the wisdom of the Perl Monks concerning the following question:

O Wise Ones!

I am a bit at a loss. I'm using a linux test system together with some co-workers. The perl debugger is only used by me and I'm using it only now and then. So nobody recognized when the debugger ceased to work.

Any perl -d call will result in:

Can't modify constant item in scalar assignment at line 0, nea +r "0;" BEGIN not safe after errors--compilation aborted.
Even things like
perl -d -e 'print "X"'
throw this error message. Larger perl scripts, too. The error is always in line 0.
Without -d everything workes fine.

BTW: perl -v is printing:

This is perl, v5.8.8 built for x86_64-linux-thread-multi
Thanks for any hint!

Replies are listed 'Best First'.
Re: Fatal error only in debug modus
by TomDLux (Vicar) on Dec 28, 2010 at 16:04 UTC

    If you make a syntax error in print "X", for example leaving out one of the quotes, it is reported as an error in line 1. So line 0 errors must occur before getting to the expression to evaluate.

    I would check if you have aliased the perl command in some way.

    $ alias perl perl: alias not found

    But you may find it defined to something, possibly involving -e'0=1'.

    As Occam said: Entia non sunt multiplicanda praeter necessitatem.

      Okay, I'll bite --- why would someone want to alias it like that? An obfuscated way to prevent users from running Perl? Practical joke (that would be a good one, might have to remember this one for April 1st)?

      Elda Taluta; Sarks Sark; Ark Arks

      Thank you, brethren,
      for at least having a look at my problem.

      But noboday played an Aprils fool on me, there is no alias. Anyway, with that alias the error should occur without "-d" switch, too.

      Well, I already gave up looking for the reason of the debugging error and I'm spicing my beautiful code with nasty log prints. This way I might not need the debugger.

      Cheers and happy new year!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://879402]
Approved by Old_Gray_Bear
Front-paged by planetscape
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2018-06-20 00:44 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.