Giter Site home page Giter Site logo

data-debug's Introduction

NAME

Data::Debug

VERSION

version 0.03

SYNOPSIS

use Data::Debug; # auto imports debug, debug_warn
use Data::Debug qw(debug debug_text caller_trace);

my $hash = {
    foo => ['a', 'b', 'Foo','a', 'b', 'Foo','a', 'b', 'Foo','a'],
};

debug $hash; # or debug_warn $hash;

debug;

debug "hi";

debug $hash, "hi", $hash;

debug \@INC; # print to STDOUT, or format for web if $ENV{REQUEST_METHOD}

debug_warn \@INC;  # same as debug but to STDOUT

print FOO debug_text \@INC; # same as debug but return dump

# ALSO #

use Data::Debug qw(debug);

debug; # same as debug

DESCRIPTION

Uses the base Data::Dumper of the distribution and gives it nicer formatting - and allows for calling just about anytime during execution.

Calling Data::Debug::set_deparse() will allow for dumped output of subroutines if available.

perl -e 'use Data::Debug;  debug "foo", [1..10];'

See also Data::Dumper.

Setting any of the Data::Dumper globals will alter the output.

NAME

Data::Debug - allows for basic data dumping and introspection.

SUBROUTINES

debug

Prints out pretty output to STDOUT. Formatted for the web if on the web.

It also returns the items called for it so that it can be used inline.

my $foo = debug [2,3]; # foo will contain [2,3]
debug_warn

Prints to STDERR.

debug_text

Return the text as a scalar.

debug_plain

Return a plainer string as a scalar. This basically just avoids the attempt to get variable names and line numbers and such.

If passed multiple values, each value is joined by a newline. This has the effect of placing an empty line between each one since each dump ends in a newline already.

If called in void context, it displays the result on the default filehandle (usually STDOUT).

caller_trace

Caller trace returned as an arrayref. Suitable for use like "debug caller_trace". This does require at least perl 5.8.0's Carp.

AUTHORS

Originally this was borrowed from CGI::Ex (written by Paul Seamons). It has since had many customizations and optimizations by various people.

AUTHOR

[ 'Paul Seamons <[email protected]>', 'Russel Fisher <[email protected]>' ]

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Paul Seamons.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

data-debug's People

Contributors

geistberg avatar jayceh avatar neybar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.