Data-Show
view release on metacpan or search on metacpan
lib/Data/Show.pm view on Meta::CPAN
and all other options to a C<use Data::Show;> by specifying either
a local or a global configuration file.
If a C<use Data::Show> call does not specify an explicit C<'with'> or C<'to'>,
the module looks first for a F<.datashow> file in the current directory,
and then for a F<.datashow> file in the home directory.
The contents of each of these configuration files must be a series of
S<I<key>C<:>I<value>> pairs (in the typical INI format).
The keys can be any valid named argument that can be
passed to a C<use Data::Show> import, except C<'base'>.
As in many other INI config files, you can use C<=> instead of C<:>
if you prefer, and any line that starts with a C<#> is ignored as a comment.
So, for example, you could change the global default plugin (for example, from
C<Data::Pretty> to C<Data::Printer>), and change the default output destination
(from STDERR to the file F<datashow.log> in the current directory), and change
the default styling of output (to something slightly more subtle because you
have an ANSI-256 colour terminal), by creating a F<~/.datashow> file containing
the following lines:
# Change default dumper...
with: Data::Printer
# Change default output target...
to: ./datashow.log
# Change the styling...
showstyle: bold italic ansi75
codestyle: italic ansi246
filestyle: bold italic ansi27
linestyle: bold italic ansi27
gridstyle: ansi27
datastyle: bold white
See the file F<sample.datashow> in the module's distribution for a full example
of a potential F<.datashow> configuration file, in which all the configuration
values happen to be the default values for those options (i.e. installing
F<sample.datashow> as your F<.datashow> should have no effect on the module,
if you're loading it without named arguments).
=head1 DEPENDENCIES
This module only works under Perl 5.10 and later.
The module requires the PPR module.
It will also require any non-core module that is itself required
by a plugin you select.
However, the requested non-core module is not actually I<required>;
if it cannot be loaded, the plugin request will be ignored and
L<a fallback|"Fallbacks"> will be used instead.
=head1 INCOMPATIBILITIES
None reported.
=head1 BUGS AND LIMITATIONS
The module uses a complex PPR-based regex to parse out the call context from the source.
Hence it is subject to the usual limitations of this approach
(namely, that it may very occasionally get the argument list wrong).
Also, because the module uses the PPR module, it will not work under Perl v5.20
(due to bugs in the regex engine under that version of Perl).
No other bugs have been reported.
Please report any bugs or feature requests to
C<bug-data-show@rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org>.
=head1 AUTHOR
Damian Conway C<< <DCONWAY@CPAN.org> >>
=head1 LICENCE AND COPYRIGHT
Copyright (c) 2010-2024, Damian Conway C<< <DCONWAY@CPAN.org> >>. All rights reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
=head1 DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
( run in 1.418 second using v1.01-cache-2.11-cpan-39bf76dae61 )