Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: RFC: Data::Dumper::Simple

by Aristotle (Chancellor)
on Jul 31, 2004 at 21:18 UTC ( #378982=note: print w/replies, xml ) Need Help??

in reply to Re: RFC: Data::Dumper::Simple
in thread RFC: Data::Dumper::Simple

Note that this strikes me as a much better use of a filter. It's not trying to find substitutable bits inside the source, just generating code from comments (though even being certain about what is a comment or not is not nearly trivial). I'd be even more appreciative if its directive syntax didn't look like code, particularly if it was clearly restricted to things the module can parse with 100% certainty.

If I were to write such a module, I'd wrap the debug statements in POD, because while that is just as non-trivial as comments, pretty much all existing POD parsers misparse source in known, predictable ways.

I don't think the debugging scenario makes brittle approaches excusable; the potential for subtle breakage introduced by filters would be doubly maddening if I'm already looking into another problem. I want to steer particularly clear of Heisenbugs in instrumentation code.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^3: RFC: Data::Dumper::Simple
by BrowserUk (Pope) on Jul 31, 2004 at 21:32 UTC

    I think that the requirement for plings (!) at either end of each comment embedded directive make the parsing fairly unambiguous. The fact that it allows for 2 or more ##s to preceed the directive pleases me as I tend to use 2 most of the time. It enables me to slightly mis-define the comment card in my syntax highlighter which reduces the chance of it mis-recognising $#array and similar as the start of a comment.

    I don't like the POD idea, but then I am not a fan of POD anyway. The need to use 5 lines of source-space to embed a single line of POD has always bugged me immensely.

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

      That is indeed a pain, and a reason I don't tend to interleave POD and code. It's also not an easy problem to solve; the best I can think of is a directive that implies cutting back to code right away. That buys two lines, at least.

      Still, I can't shake the feeling that it shouldn't be hard to write a reasonably easy to use dumper that need not rely on source filters.

      Makeshifts last the longest.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2021-04-22 23:53 GMT
Find Nodes?
    Voting Booth?

    No recent polls found