Skip Menu |
 

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 33659
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: DDUMONT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.2808_01
Fixed in: (no value)



Subject: Module::Build breaks if Data::Dumper::Terse is set
Download (untitled) / with headers
text/plain 635b
Hello For Config::Model::Xorg, I need to generate perl data structure in files with Data::Dumper. Currently, I use the Terse option of Data::Dumper in Build.PL (yes, I know about the warnings, but Terse is ok for simple data structures). If I leave Data::Dumper::Terse, Module::Build will generate a corrupted build_param file. I'm not asking to reverse the change that was done in Module::Build 0.2808_01, but could you please test the value of Data::Dumper::Terse in Module::Build::Dumper and bail out if this value is set ? This would tremendously help in figuring out what is wrong when generated data is not correct. Thanks
Subject: Re: [rt.cpan.org #33659] Module::Build breaks if Data::Dumper::Terse is set
Date: Thu, 28 Feb 2008 11:34:00 -0800
To: bug-Module-Build [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Dominique Dumont via RT wrote: Show quoted text
> For Config::Model::Xorg, I need to generate perl data structure in > files with Data::Dumper. Currently, I use the Terse option of > Data::Dumper in Build.PL (yes, I know about the warnings, but Terse is > ok for simple data structures). > > If I leave Data::Dumper::Terse, Module::Build will generate a > corrupted build_param file. > > I'm not asking to reverse the change that was done in Module::Build > 0.2808_01, but could you please test the value of Data::Dumper::Terse > in Module::Build::Dumper and bail out if this value is set ? > > This would tremendously help in figuring out what is wrong when > generated data is not correct.
Might make sense for Module::Build to set up its own Data::Dumper object, configure it how it needs and then just hang onto it and use that. That would avoid having to worry about users setting globals. -- s7ank: i want to be one of those guys that types "s/j&jd//.^$ueu*///djsls/sm." and it's a perl script that turns dog crap into gold.
Download (untitled) / with headers
text/plain 780b
On Thu Feb 28 14:39:43 2008, schwern@pobox.com wrote: Show quoted text
> Might make sense for Module::Build to set up its own Data::Dumper > object, > configure it how it needs and then just hang onto it and use that. > That would > avoid having to worry about users setting globals.
On the other hand, re-inventing the wheel might be counter-productive. Thing is, the code in Module::Build::Dumper is done in a way which cannot work when Data::Dumper::Terse is set. So the best solution is either: - to bail out when Data::Dumper::Terse == 1 - to do a "local $Data::Dumper::Terse = 1" before calling Data::Dumper On my side, I've added a local $Data::Dumper::Terse =0 in my own Build.PL: http://search.cpan.org/src/DDUMONT/Config-Model-Xorg-0.510/Build.PL This works perfectly well now. HTH
Subject: Re: [rt.cpan.org #33659] Module::Build breaks if Data::Dumper::Terse is set
Date: Fri, 29 Feb 2008 00:16:30 -0800
To: bug-Module-Build [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Dominique Dumont via RT wrote: Show quoted text
> Queue: Module-Build > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=33659 > > > On Thu Feb 28 14:39:43 2008, schwern@pobox.com wrote:
>> Might make sense for Module::Build to set up its own Data::Dumper >> object, >> configure it how it needs and then just hang onto it and use that. >> That would >> avoid having to worry about users setting globals.
> > On the other hand, re-inventing the wheel might be counter-productive.
I think you misinterpreted "set up its own Data::Dumper object". By that I mean... my $dumper = Data::Dumper->new; $dumper->Terse(0); $self->{dumper} = $dumper; And then call $self->{dumper}->Dump($stuff); instead of Dumper($stuff). That means we don't have to sprinkle the Module::Build code with local $Data::Dumper::Terse = 0. Actually it turns out there is already a wrapper around Data::Dumper, but it's done as a class method and doesn't set Terse. -- 44. I am not the atheist chaplain. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
Download (untitled) / with headers
text/plain 258b
On Fri Feb 29 03:17:08 2008, schwern@pobox.com wrote: Show quoted text
> I think you misinterpreted "set up its own Data::Dumper object".
Oops. I definitely did misunderstand your statement. :o) Thanks for the clarification. Your proposal does make sense. All the best.
Download (untitled) / with headers
text/plain 380b
I've just committed this patch: --- lib/Module/Build/Dumper.pm (revision 10853) +++ lib/Module/Build/Dumper.pm (working copy) @@ -9,7 +9,7 @@ sub _data_dump { my ($self, $data) = @_; return ("do{ my " - . Data::Dumper->new([$data],['x'])->Purity(1)->Dump() + . Data::Dumper->new([$data],['x'])->Purity(1)->Terse(0)->Dump() . '$x; }') } -Ken


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.