[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [PATCH] Data::Dumper.pm
Tim Bunce wrote:
> 0 - warn and generate a sub { die ... }
> 1 - warn and generate a sub { }
> 2 - warn and output via B::Deparse
> 3 - output via B::Deparse with no warning (except any from via B::Deparse)
>
> Personally, I'd rather the default was 0.
I'd imagine that it would be better to maintain the current output
(i.e., sub { "DUMMY" }) than suddenly have code dying in dumped data
structures, but option zero is definitely the path of least pain.
> Of course ideally some of that functionality should live in B::Deparse.
> It should be possible to ask B::Deparse to croak if it can't be reasonably
> sure it's generated code will behave in the same way as the original.
I think B::Deparse is already *reasonably* sure that its generated code
will behave the same way as the original. It works in test cases so the
only time a real clanger will come along is when an exception crops up.
Other than testing it in as many situations as possible I can't see any
way that B::Deparse is going to become any more convinced that it's code
will do the same thing as the original.
Perhaps Deparse could programmatically become sure that the syntax is ok
by running it through eval, but beyond that I don't see it having many
other options.
Regards,
James.
--
James A. Duncan
Technical Programmer, ebookers.com Plc.
ICQ: 21304370
Email: james@ebookers.com
Phone: +44 (0) 207 757 2672
Mobile: +44 (0) 789 990 5763
- Follow-Ups from:
-
Tim Bunce <Tim.Bunce@ig.co.uk>
"Matthias Urlichs" <smurf@noris.net>
Larry Wall <larry@wall.org>
- References to:
-
James Duncan <james@ebookers.com>
Gurusamy Sarathy <gsar@activestate.com>
Tim Bunce <Tim.Bunce@ig.co.uk>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]