Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Problem w/overloading and Carp::confess

by blakem (Monsignor)
on Nov 14, 2001 at 05:36 UTC ( [id://125197]=note: print w/replies, xml ) Need Help??


in reply to Problem w/overloading and Carp::confess

Adding a 'fallback' => 0 to your use statement prevents the deep recursion, but I don't think it will solve the actual problem.... (just pushes it further down the line a bit) Anyway, I could be wrong....:
use overload '""' => \&asString, 'fallback' => 0;

-Blake

Replies are listed 'Best First'.
Re: Re: Problem w/overloading and Carp::confess
by slagel (Novice) on Nov 14, 2001 at 06:13 UTC
    Thanks...Interesting results:
    Operation `.=': no method found, left argument in overloaded package P, right argument has no overloaded magic at /usr/local/geospiza/ +lib/perl5/5.6.1/Carp/Heavy.pm line 91.
    Looks as if in longmess() the string concat being done to turn the "arg" into something printable is lost... I was thinking that putting a check in longmess to see if stringify is overloaded and then calling overload::StrVal(), but I don't want to change Carp.
      Apparently the recursion is being caused by
      if (ref $_) { # ...<snip>... $_ .= '';
      in Carp.pm (or Carp/Heavy.pm).

      I recommend that you copy Carp.pm to MyCarp.pm, and hack away at it. And maybe submit a patch when you're done.

      -- Frag.
      --
      "Just remember what ol' Jack Burton does when the earth quakes, the poison arrows fall from the sky, and the pillars of Heaven shake. Yeah, Jack Burton just looks that big old storm right in the eye and says, "Give me your best shot. I can take it."

        Before submitting patches, I suggest downloading the development version of Perl because it may be (read has been) changed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://125197]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-16 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found