Carp always produces stack trace, even without 'verbose' 
Author Message
 Carp always produces stack trace, even without 'verbose'

Calling carp() always gives a stack trace, but none of the reasons
given in the Carp manual page seem to apply.

% perl -MCarp -e 'sub h { carp "hello" } h()'
hello at -e line 1
        main::h() called at -e line 1
% echo $PERL5OPT

% perl -v

This is perl, version 5.005_03 built for i386-linux

(It's the perl that comes with Red Hat Linux 6.2.)

How do I stop carp() from printing a stack trace?  I definitely didn't
ask for one.

--
Ed Avis



Wed, 09 Apr 2003 03:00:00 GMT  
 Carp always produces stack trace, even without 'verbose'

Quote:

>% perl -MCarp -e 'sub h { carp "hello" } h()'
>hello at -e line 1
>        main::h() called at -e line 1

It happens in 5.6, too.

Quote:
>How do I stop carp() from printing a stack trace?  I definitely didn't
>ask for one.

I have no clue to WHY it does this, but it only seems to be happening if
the sub is in the same packake as your sub call.

        #! perl -w
        package X;
        h();
        sub h {
            use Carp;
            carp "hello"
        }
-->
        hello at test.pl line 6
                X::h() called at test.pl line 3

Compare this to:

        # perl -w
        X::h();
        package X;
        sub h {
            use Carp;
            carp "hello"
        }
-->
        hello at test.pl line 2

I guess this is for debugging your package?

But I'm not sure I like this. It's like something that Microsoft would
come up with. ;-)

--
        Bart.



Thu, 10 Apr 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Regular Expression - Always seems simple/I always fight 'em

2. ExtUtils:MakeMaker missing 'use Carp'

3. how to produce a 'beep'?

4. problem - 'if' condition is always true

5. Whats the meaning of this stack trace

6. How to go up stack trace?

7. Any way to automatically stack trace on die?

8. verbose 'make test' to explain t/ftp 'Error 29'?

9. Perl equivalent to C's TRACE

10. CGI.pm: saving query values without the '%20's

11. installing modules without 'make'

12. Installing modules without 'make'

 

 
Powered by phpBB® Forum Software