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

Re^2: Error(?): "CV isn't complete"?

by BrowserUk (Patriarch)
on Nov 16, 2004 at 19:21 UTC ( [id://408215]=note: print w/replies, xml ) Need Help??


in reply to Re: Error(?): "CV isn't complete"?
in thread Error(?): "CV isn't complete"?

It appears that if you pass a globref that has a code component to Devel::Size::total_size(), and warnings are enabled, it always issues the "CV isn't complete" message.

Which seems like a non-useful behaviour to me?

#! perl -slw use strict; use Devel::Size qw[ total_size ]; our $GLOB; *GLOB = sub{ print "@_" }; print total_size \*GLOB; __END__ P:\test>junk CV isn't complete 291

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re: Error(?): "CV isn't complete"?
by benizi (Hermit) on Nov 19, 2004 at 00:31 UTC

    IIRC, it's because Devel::Size is not able to compute a real "size" for CV's. See the "Bugs" section of Devel::Size. It returns a minimum size, and throws a warning to let you know somethings not 100% accurate.

      Nicely spotted, Thanks++.

      I thought that I was misunderstanding the XS code when it appeared to be issuing the error unconditionally.

      I never even looked at the "bugs" section. I think that's because I took the error "CV isn't complete", to mean that there was something wrong with the CV itself, rather than something wrong with the way Devel::Size was using or reporting it.

      Maybe the message should read "Size for CV is incomplete", that would at least give some clue as to where and what the message meant.

      Even better if it read "Devel::Size: Sizes for CVs are incomplete".

      Indeed, I will change mine to read that way, and offer it as a patch to the owner. Along with something that I feel is sadly lacking from the documentation of many (almost all?). A simple section headed:

      Messages: warning and error texts originating from this module.

      It would make it a lot easier to find if such texts were in the POD (and generated HTML). I did a grep of my local Perl directory before posting the OP, but I didn't find it because I had the PPM version of the module, which doesn't contain the source. It does contain the HTML though.


      Examine what is said, not who speaks.
      "But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
      "Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
        Note that you can disable this warning by:
        $Devel::Size::warn = 0
        though I see I forgot to document that.

        This is the sort of thing that, in general, warrants a bug report. (The only reason I noticed the thread here was sheer boredom -- if there's an email address in the docs for a module behaving oddly, and I double-checked and there was, firing off mail isn't out of order...)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-18 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found