Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I agree that it would be nice to have more level of control over autovivification. As tye suggests, sometimes only one level of autovivification is desired. Someone else might want at most two levels, such as when working with 2D arrays.

A debugger could be enhanced with an object that could provide this level of checking. This debugging object would contain a pointer to a variable whose autovivification is being monitored. Perl's debugger hooks could check autovivification constraints on a line-by-line basis at run-time. After the program starts working, the run-time checking could easily be turned off.

This is the sort of problem that I have trouble debugging with print statements, but I can easily debug with the ptkdb debugger. I just put the hash in the watch variable window and see how it grows. Or, if the data structure being monitored is too large, I put something like scalar(keys %myhash) in the watch window.

I've already been flamed each time that I have mentioned debuggers, so maybe we can skip that part this time!

It should work perfectly the first time! - toma

In reply to Re: non-autovivifing hash by toma
in thread non-autovivifing hash by bobdeath

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2023-12-08 20:06 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (37 votes). Check out past polls.