On Sun, Jan 13, 2013 at 12:39 AM, Breno G. de Oliveira via RT
<bug-Data-Printer@rt.cpan.org> wrote:
Show quoted text> --------8<--------
> use Module::Load;
> load 'Data::Printer', alias => 'Dumper';
>
> my $x = [1, 42, 99];
> Dumper( $x ); # works just like p()!
> -------->8--------
>
>
> Is that what you meant?
no not exactly, because that won't work in /this/ code that I linked
load $self->_dumper_package, 'Dumper';
you could argue that the problem is that I don't support passing
additional parameters, but I was trying to constrain it to the
specifics. _dumper_package attribute is constrained to /must be a
valid package name/. You can then change the Dumper package name
without modifying my source by passing it to the constructor (I
thought I was allowing via env variable but I guess not, maybe I
should change that). Because most of the Dumper modules support use
Module, Dumper; (or should imo). I couldn't generically write load
Module, alias => Dumper and expect it to work on Data::Dumper.
note: I'm seriously considering writing Dumper::Any due to API
inconsistency issues between Dumper modules.
Show quoted text>>
>> (a side note, I notice the way I call my code with print that it
>> removes color formatting, is it possible to prevent this?)
>
> Sure! just pass:
>
> color => 'always'
>
> as a parameter, just like I did to 'alias' up there.
yeah I missed that in the docs when I first wrote this, I'm kind of
liking how DBIx::QueryLog can set color via an environment variable
(again so I can put this outside of the source as this setting is more
for human users).
--
Caleb Cushing
http://xenoterracide.com