view release on metacpan or search on metacpan
my $self = shift;
my ($class,$name) = @_;
my $key = join ":",$self,$class,$name;
return unless defined $MEMORY_CACHE{$key};
carp "memory_cache hit on $class:$name"
if Ace->debug;
return $MEMORY_CACHE{$key};
}
sub memory_cache_store {
my $self = shift;
croak "Usage: memory_cache_store(\$obj)" unless @_ == 1;
my $obj = shift;
my $key = join ':',$obj->db,$obj->class,$obj->name;
return if exists $MEMORY_CACHE{$key};
carp "memory_cache store on ",$obj->class,":",$obj->name if Ace->debug;
weaken($MEMORY_CACHE{$key} = $obj);
}
sub memory_cache_clear {
my $self = shift;
warn "CACHE BUG! Discarding inconsistent object $obj\n";
warn Data::Dumper->Dump([$obj],['obj']);
$cache->remove($key);
return;
}
warn "cache ",$obj?'hit':'miss'," on '$key'\n" if Ace->debug;
$self->memory_cache_store($obj) if $obj;
$obj;
}
# call as
return unless $obj->name;
my $key = join ':',$obj->class,$obj->name;
my $cache = $self->cache or return;
warn "caching $key obj=",overload::StrVal($obj),"\n" if Ace->debug;
if ($key eq ':') { # something badly wrong
cluck "NULL OBJECT";
}
$cache->set($key,$obj);
}
my $self = shift;
my $obj = shift;
my $key = join ':',$obj->class,$obj->name;
my $cache = $self->cache or return;
carp "deleting $key obj=",overload::StrVal($obj),"\n" if Ace->debug;
$cache->remove($key,$obj);
}
#### END: CACHE AND CARRY CODE ####
}
sub DESTROY {
my $self = shift;
return if caller() =~ /^Cache\:\:/;
warn "$self->DESTROY at ", join ' ',caller() if Ace->debug;
$self->close;
}
#####################################################################
If not provided, $time defaults to localtime().
=head1 OTHER METHODS
=head2 debug()
$debug_level = Ace->debug([$new_level])
This class method gets or sets the debug level. Higher integers
increase verbosity. 0 or undef turns off debug messages.
=head2 name2db()
$db = Ace->name2db($name [,$database])
=cut
# -------------------- AUTOLOADED SUBS ------------------
sub debug {
my $package = shift;
my $d = $DEBUG_LEVEL;
$DEBUG_LEVEL = shift if @_;
$d;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
no warnings;
my $self_package = shift;
# XXX Using parse_arguments here might cause confusion, because the
# subclass's boolean_arguments and paired_arguments can conflict, causing
# difficult debugging. Consider using something truly local.
my ($args, @export_list) = do {
local *boolean_arguments = sub {
qw(
-base -Base -mixin -selfless
-XXX -dumper -yaml
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
no warnings;
my $self_package = shift;
# XXX Using parse_arguments here might cause confusion, because the
# subclass's boolean_arguments and paired_arguments can conflict, causing
# difficult debugging. Consider using something truly local.
my ($args, @export_list) = do {
local *boolean_arguments = sub {
qw(
-base -Base -mixin -selfless
-XXX -dumper -yaml
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AsciiArt2HtmlTable.pm view on Meta::CPAN
}
# optimization
my $optimization = '';
# debugging messages were kept for future reference
# remember that lines and cells are not the exact values, as
# arrays start at index 0 and both lines and cells start at
# position 1
#my $debug = "line $line, cell $cell, ";
if ( $config{'optimization'} ) {
#$debug .= "\nthis is line $line, cell $cell";
# check how many cells we could have on each line from the line we're
# in to the last one
my %we_could_have;
for ( $line .. $#lines ) {
$we_could_have{$_} = _count_in_the_beginning(
$lines[$line]->[$cell],
@{$lines[$_]}[$cell .. $#{$lines[$_]}]
);
#$debug .= "\nwe could have $we_could_have{$_} on line $_";
}
# check, for each line, how many cells an area up to that line would have
my %area;
my %area_width;
for ( $line .. $#lines ) {
my $min = _min( @we_could_have{$line .. $_} );
$area{$_} = (1 + $_ - $line) * $min;
$area_width{$_} = $min;
#$debug .="\nwe could make an area of $area{$_} up to line $_, with a maximum of $area_width{$_} cells per line";
}
# check which is the line that maximizes optimization
my $max_area = _max(values %area);
my $best_line = _max(grep { $area{$_} == $max_area } keys %area);
#$debug .= "\nour best choice seem to be using line $best_line";
# check the are width
my $width = $cell + $area_width{$best_line} - 1;
# clean everything in the area we're about to optimize
#$debug .= "\nwe want to clean everything from lines $line to $best_line and cells $cell to $width";
for my $l ( $line .. $best_line ) {
for my $c ( $cell .. $width ) {
next if ( $l == $line and $c == $cell );
$lines[$l]->[$c] = '';
}
lib/Acme/AsciiArt2HtmlTable.pm view on Meta::CPAN
my $colspan = $area_width{$best_line};
if ( $rowspan > 1 ) { $optimization .= " rowspan=\"$rowspan\"" }
if ( $colspan > 1 ) { $optimization .= " colspan=\"$colspan\"" }
#$debug .= "\n";
}
$lines[$line]->[$cell] = "<td$optimization bgcolor=\"" .
( $config{'colors'}{ $lines[$line]->[$cell] } ||
$config{'colors'}{'default'} ) .
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AsciiArtinator.pm view on Meta::CPAN
%opts = @{$_[0]};
}
my ($PIC, $CODE, $OUTPUT);
if (defined $opts{"debug"} && $opts{"debug"}) {
$DEBUG = 1;
}
if (defined $opts{"art_file"}) {
my $fh;
lib/Acme/AsciiArtinator.pm view on Meta::CPAN
# can run from command line:
#
# perl Acme/AsciiArtinator.pm [-d] art-file code-file [output-file]
#
if ($0 =~ /AsciiArtinator.pm/) {
my $debug = 0;
my $compile_check = 1;
my @opts = grep { /^-/ } @ARGV;
@ARGV = grep { !/^-/ } @ARGV;
foreach my $opt (@opts) {
$debug = 1 if $opt eq '-d';
# $compile_check = 1 if $opt eq '-c';
}
asciiartinate( art_file => $ARGV[0] ,
code_file => $ARGV[1] ,
output => $ARGV[2] || "ascii-art.pl",
debug => $debug ,
'compile-check' => $compile_check );
}
1;
lib/Acme/AsciiArtinator.pm view on Meta::CPAN
=item * Make sure the original code works
Make sure the code compiles and test it to see if it
works like you expect it to
before running the ASCII Artinator. It would be frustrating to
try to debug an artinated script only to later realize that
there was some bug in the original input.
=item * Get rid of comments
This module won't handle comments very well. There's no way
lib/Acme/AsciiArtinator.pm view on Meta::CPAN
=item compile_check => 0 | 1
Runs the Perl interpreter with the C<-cw> flags on the
original code string and asserts that the code compiles.
=item debug => 0 | 1
Causes the ASCII Artinator to display verbose messages
about what it is trying to do while it is doing what it
is trying to do.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AtIncPolice.pm view on Meta::CPAN
} elsif($op->{value}) {
return unless $value;
}
}
# debug type
my $value = $self->_debug_message($args{value}, $op->{debug}, $args{filter});
# debug_value checking
return unless $self->_matching($self->{options}->{debug_value}, $value);
# use scalar/array/hash ?
return unless grep lc($class) eq lc($_) , @{$op->{use}};
# create warning message
my $watch_msg = '';
my $msg = $self->_output_message($class, $value, \%args);
lib/Acme/AtIncPolice.pm view on Meta::CPAN
croak $watch_msg . $msg . "\n";
}
};
watch @INC, (
debug => sub {
my ($self, $things) = @_;
for my $thing (@$things) {
my $ref = ref($thing);
if ($ref) {
return "Acme::AtIncPolice does not allow contamination of \@INC";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AutoLoad.pm view on Meta::CPAN
The default is "lib" in the current directory.
=head2 AUTOLOAD_DEBUG
You can enable verbose debugging to see more how it works or
if you are having trouble with some modules by setting
AUTOLOAD_DEBUG to a true value.
The default is off.
=head2 AUTOLOAD_SRC
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/BOPE.pm view on Meta::CPAN
=head1 DEPENDÊNCIAS
Tu é dependente, mermão????? Se quiser ver o código de debug cheio de frufru, instala o Perl::Tidy que é 100%.
Ah, e se os senhores não tiverem o Filter::Simple instalado, nunca serão...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Beamerang/Logger.pm view on Meta::CPAN
BEAMERNAG_FOO_BAR_BAZ_UPTO
BEAMERANG_FOO_BAR_UPTO
BEAMERANG_FOO_UPTO
BEAMERANG_UPTO
This means you can turn on debugging for as much, or as little as you like, without
having to radically change the code.
=head1 NAMING
=head2 Acme
view all matches for this distribution
view release on metacpan or search on metacpan
package Acme::Beatnik;
use Filter::Simple;
use strict;
use vars qw($VERSION $ip @stack @numbers %reftable %scrabble $debug);
$debug = 0;
%reftable =
(5, \&_push,
6, \&_pop,
7, \&_add,
$VERSION = '0.02';
sub _push
{ $ip++;
print "pushing $numbers[$ip]\n" if $debug;
push(@stack,$numbers[$ip]);
}
sub _pop
{ my $foo = pop @stack;
print "popping $foo\n" if $debug;
return $foo;
}
sub _add
{ my($first,$second) = (pop @stack,pop @stack);
my $sum = $first + $second;
push(@stack,$sum);
print "adding $first and $second and pushing $sum on stack \n" if $debug;
}
sub _input
{ print "accepting user input and pushing onto stack\n" if $debug;
push(@stack,ord(getc));
}
sub _output
{ my $foo = pop @stack;
print "outputting ",chr($foo),"\n" if $debug;
print(chr($foo));
}
sub _subtract
{ my ($first,$second) = (pop @stack,pop @stack);
my $diff = $first - $second;
print "subtraction $first and $second and pushing $diff on stack\n" if $debug;
push(@stack,$diff)
}
sub _swap
{ my $a = pop(@stack);
my $b = pop(@stack);
print "swapping $a and $b\n"if $debug;
push(@stack,$a,$b);
}
sub _duplicate
{ print "duplicating $stack[$#stack]\n" if $debug;
push(@stack,$stack[$#stack]);
}
sub _jump_forward_if_zero
{ my $n = pop(@stack);
$ip++;
if($n == 0)
{ $ip += $numbers[$ip]; print "jump $n words forward\n" if $debug; }
}
sub _jump_forward_if_not_zero
{ my $n = pop(@stack);
$ip++;
if($n != 0)
{ $ip += $numbers[$ip]; print "jump $n words forward\n" if $debug; }
}
sub _jump_back_if_zero
{ my $n = pop(@stack);
$ip++;
if($n == 0) { $ip -= $numbers[$ip]; print "jump $n words backward\n" if $debug; }
}
sub _jump_back_if_not_zero
{ my $n = pop(@stack);
$ip++;
if($n != 0) { $ip -= $numbers[$ip]; print "jump $n words backward\n" if $debug; }
}
sub _halt
{ $ip = $#numbers+1;
print "halting...\n" if $debug;
exit;
}
FILTER
{ $_ =~ s/[^\w\s]//g;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/BeyondPerl/ToSQL.pm view on Meta::CPAN
overload::constant (
integer => \&_integer_handler,
float => \&_float_handler,
);
if(defined $hash{debug}){ $DEBUG = $hash{debug}; }
}
my $OPs = {
lib/Acme/BeyondPerl/ToSQL.pm view on Meta::CPAN
print 9 / 2 , "\n"; # 4.5
# DEBUG MODE
# use Acme::BeyondPerl::ToSQL ({
# dbi => ["dbi:SQLite:dbname=acme_db","",""], debug => 1,
# });
#
# SELECT 1.2000000000000000 - 0.2000000000000000
# SELECT 9.0 / 2.0
# SELECT 2.0 + 5.0
# use Acme::BeyondPerl::ToSQL ({
# dbi => ["dbi:Pg:dbname=$dbname;host=$host", $user, $pass], debug => 1,
# });
#
# SELECT CAST(1.2 AS double precision) - CAST(0.2 AS double precision)
# SELECT CAST(9 AS double precision) / CAST(2 AS double precision)
# SELECT CAST(2 AS double precision) + CAST(5 AS double precision)
lib/Acme/BeyondPerl/ToSQL.pm view on Meta::CPAN
use Acme::BeyondPerl::ToSQL ("dbi:SQLite:dbname=acme_db","","");
use Acme::BeyondPerl::ToSQL
("dbi:Pg:dbname=$dbname;host=$host", $user, $pass, \%opts);
=item Acme::BeyondPerl::ToSQL ({dbi => $arrayref, debug => $true_or_false})
use Acme::BeyondPerl::ToSQL ({
dbi => ["dbi:SQLite:dbname=acme_db","",""],
debug => 1,
});
=back
view all matches for this distribution
view release on metacpan or search on metacpan
#
# $Id: Changes,v 0.4 2006/05/02 11:21:04 dankogai Exp $
#
$Revision: 0.4 $ $Date: 2006/05/02 11:21:04 $
! lib/Acme/Bleach/Numerically.pm
commented out debugging message
0.03 2006/03/23 07:21:28
! lib/Acme/Bleach/Numerically.pm
Fixed minor whitening bug.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Brainfuck.pm view on Meta::CPAN
# Whether or not we accept extra instructions.
our $verbose = 0;
# print out filtered text?
our $debug = 0;
sub import()
{
shift;
foreach (@_)
lib/Acme/Brainfuck.pm view on Meta::CPAN
if (/^verbose$/)
{
$ops .= '~#';
$verbose = 1;
}
if (/^debug$/)
{
$debug = 1;
}
}
}
FILTER_ONLY code => sub
lib/Acme/Brainfuck.pm view on Meta::CPAN
}
$code =~ s/P/\$Acme::Brainfuck::m\[\$Acme::Brainfuck::p\]/g;
substr($ret, $at, $len, $code);
}
$_ = $ret;
print $_ if $debug;
};
1;
__END__
lib/Acme/Brainfuck.pm view on Meta::CPAN
=back
=head2 Debugging
By using the I<debug> pragma like this:
use Acme::Brainfuck qw/debug/;
you can dump out the generated perl code. (Caution: it is not pretty.)
The key to understanding it is that the memory pointer is represented by
I<$p>, and the memory array by I<@m> Therefore the value of the current
memory cell is I<$m[$p]>.
view all matches for this distribution
view release on metacpan or search on metacpan
Buckaroo.pm view on Meta::CPAN
our $VERSION = '1.02';
###############################################################################
# IF YOU WANT TO TURN ON DEBUG MODE
# (and thus see lots of logging lines that explain how things are happening
# as they happen), set debug_mode = 1.
# If you do, you'll need either:
# (1) Perl 5.6 (to get Data::Dumper by default), or
# (2) to have Data::Dumper already installed.
# Data::Dumper is a very, very handy module, but it wasn't in the default Perl
# installation until (I think) Perl 5.6. Perl 5.005 usually don't have it.
# Look on CPAN.ORG for Data::Dumper if you don't have it.
###############################################################################
my $debug_mode = 0;
print("starting script...\n") if $debug_mode;
if ($debug_mode)
{
use Data::Dumper;
}
else
{
Buckaroo.pm view on Meta::CPAN
}
my $header = "Buckaroo Banzai Across The Eigth Dimension " x 2 . "\n";
###############################################################################
# this translation array is just for fun, but also for debugging so you can see
# how characters are encoded as they are encoded.
#
# If you try a new encoding method, use this one and you'll be able to see if
# characters are encoded and decoded correctly.
Buckaroo.pm view on Meta::CPAN
my $in_string = shift;
my $out = "";
$out = Dumper($in_string);
print("Instring=>>$out<<\n") if $debug_mode;
my @in_array = split(//, $in_string);
$out = Dumper(@in_array);
print("in_array=>>$out<<\n") if $debug_mode;
my $i = 0;
my @temparray = ();
foreach my $thischar (@in_array)
{
# translate each character into it's ascii value.
my $num = unpack("c", $thischar);
# change that ascii value into a string from the array...
my $newchar = $xlate_array[$num];
print("char=>>$thischar<<, num=>>$num<<, newchar=>>$newchar<<\n") if $debug_mode;
print("char=>>%s<<, num=>>%s<<, newchar=>>%s<<\n", $thischar, $num, $newchar) if $debug_mode;
push(@temparray, "$newchar");
$i++;
if ($i > 3)
{
push(@temparray, "\n");
$i = 0;
}
}
my $out_string = $header . join("\t", @temparray) . "\n";
print("out_string=>>$out_string<<\n") if $debug_mode;
return $out_string;
}
################################################################################
Buckaroo.pm view on Meta::CPAN
{
my $in_string = shift;;
$in_string =~ s/^$header//g;
print("normalize, got in_string>>$in_string<<\n") if $debug_mode;
my %revhash = ();
my $counter = 0;
foreach my $this_elem (@xlate_array)
{
Buckaroo.pm view on Meta::CPAN
$in_string =~ s/\t\n/\t/g;
$in_string =~ s/\t+/\t/g;
my @in_array = split(/[\t]/, $in_string);
my $in_array_dump = Dumper(@in_array);
print("in_array_dump=>>$in_array_dump<<\n") if $debug_mode;
my @translate_array = ();
my $this_elem = "";
$counter = 1;
foreach $this_elem (@in_array)
{
if (!($this_elem)) { print("Found undefined elem, counter=$counter.\n"); $counter++; next; }
my $ascii_num = $xlate_2_hash{$this_elem} || 0;
my $to_char = pack("c", $ascii_num);
printf("Normalized >>%s<<, ascii_num=>>%s<<, char=>>%s<<, counter=>>%s<<\n", $this_elem, $ascii_num, $to_char, $counter) if $debug_mode;
push(@translate_array, $to_char);
$counter++;
}
my $outtext = join('', @translate_array);
print("Converted back to text=>>$outtext<<\n") if $debug_mode;
return("$outtext");
}
Buckaroo.pm view on Meta::CPAN
{
my $in_string = shift;
my $retval = 0;
print("In has_wordchars\n") if $debug_mode;
if ($in_string =~ /\s/)
{
return $in_string;
}
Buckaroo.pm view on Meta::CPAN
{
my $in_string = shift;
my $retval = 0;
print("In starts_with_header\n") if $debug_mode;
if ($in_string =~ /^$header/)
{
return $in_string;
}
Buckaroo.pm view on Meta::CPAN
{
my $first = shift; # name of module, in this case "Buckaroo.pm"
my $source_filename = $0; # name of file called from (if test.pl does a 'use Acme::Buckaroo;' then this will be "test.pl")
print("Starting \"Buckaroo\" process...\n") if $debug_mode;
# set up some hashes to go to/from encoding scheme.
my $i = 0;
foreach my $this_elem (@xlate_array)
{
Buckaroo.pm view on Meta::CPAN
exit;
}
else
{
#comment this out if you don't care.
print("Past open... ") if $debug_mode;
}
#read entire file in as a string.
my @file_array = <FILE_HANDLE>;
my $file_array_dump = Dumper(@file_array);
print("file_array_dump=>>$file_array_dump<<") if $debug_mode;
my $file_string = join("", @file_array);
# elim anything before the 'use Acme::Buckaroo; line.
$file_string =~ s/use\s*Acme::Buckaroo\s*;\s*\n//;
print("Filestring=>>$file_string<<\n") if $debug_mode;
# no clue why we do this. Anyone know?
#local $SIG{__WARN__} = \&has_wordchars;
if ( (has_wordchars($file_string) ) &&
Buckaroo.pm view on Meta::CPAN
if (!(open(FILE_HANDLE, ">$0")))
{
print("Cannot Buckaroo '$0'\n");
exit;
}
print("past open2...") if $debug_mode;
print(FILE_HANDLE "use Acme::Buckaroo;\n");
my $result = translate($file_string);
print(FILE_HANDLE $result);
print("Done \"Buckaroo-ing!\n");
}
else
{
print("normalizing...\n") if $debug_mode;
my $out_string = normalize($file_string);
print("out_string=>>$out_string<<\n") if $debug_mode;
my $outval = eval($out_string);
print("Outval returned: $outval\n") if $debug_mode;
if ($@)
{
print("Perl Error returned: $@\n");
}
print("No eval error returned.\n") if $debug_mode;
}
print("Finishing...\n") if $debug_mode;
exit;
}
Buckaroo.pm view on Meta::CPAN
converted, but the code will be a somewhat endearing tribute to a
movie, instead of a clean, complete, clearly commented set of lines
of Perl code.
if you want to convert your program BACK into Perl, you must edit the
Acme::Buckaroo.pm module and turn on debugging (change the
line, "my $debug_mode = 0;" to the line, "my $debug_mode = 1;" and then
run the script again. As it executes, it will translate the program
back. Capture the output of this and you have your program back.
Acme::Buckaroo came about because the modules Acme::Buffy, Acme::Morse,
Acme::Pony, and Acme::Bleach were somewhat cryptically written. This
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
no warnings;
my $self_package = shift;
# XXX Using parse_arguments here might cause confusion, because the
# subclass's boolean_arguments and paired_arguments can conflict, causing
# difficult debugging. Consider using something truly local.
my ($args, @export_list) = do {
local *boolean_arguments = sub {
qw(
-base -Base -mixin -selfless
-XXX -dumper -yaml
view all matches for this distribution
view release on metacpan or search on metacpan
devscript/update-data view on Meta::CPAN
my @modules = sort keys %$res;
require Acme::CPANAuthors;
MOD:
for my $mod (@modules) {
log_debug "Processing module $mod ...";
(my $ac_mod = $mod) =~ s/^Acme::CPANAuthors:://;
if (grep { $_ eq $ac_mod } @skiplist) {
log_info "Skipped list $ac_mod";
next MOD;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANLists/PERLANCAR/Assert.pm view on Meta::CPAN
{
summary => 'Assertion',
description => <<'_',
Assertion is a check statement that must evaluate to true or it will abort
program's execution. It is useful during development/debugging:
assert("there must be >3 arguments", sub { @args > 3 });
In production code, compilers ideally do not generate code for assertion
statements so they do not have any impact on runtime performance.
lib/Acme/CPANLists/PERLANCAR/Assert.pm view on Meta::CPAN
=head1 MODULE LISTS
=head2 Assertion
Assertion is a check statement that must evaluate to true or it will abort
program's execution. It is useful during development/debugging:
assert("there must be >3 arguments", sub { @args > 3 });
In production code, compilers ideally do not generate code for assertion
statements so they do not have any impact on runtime performance.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANModules/Assert.pm view on Meta::CPAN
our $LIST = {
summary => 'List of modules to do assertion',
description => <<'_',
Assertion is a check statement that must evaluate to true or it will abort
program's execution. It is useful during development/debugging:
assert("there must be >3 arguments", sub { @args > 3 });
In production code, compilers ideally do not generate code for assertion
statements so they do not have any impact on runtime performance.
lib/Acme/CPANModules/Assert.pm view on Meta::CPAN
This document describes version 0.002 of Acme::CPANModules::Assert (from Perl distribution Acme-CPANModules-Assert), released on 2022-03-08.
=head1 DESCRIPTION
Assertion is a check statement that must evaluate to true or it will abort
program's execution. It is useful during development/debugging:
assert("there must be >3 arguments", sub { @args > 3 });
In production code, compilers ideally do not generate code for assertion
statements so they do not have any impact on runtime performance.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANModules/DumpingDataForDebugging.pm view on Meta::CPAN
our $DATE = '2023-10-29'; # DATE
our $DIST = 'Acme-CPANModules-DumpingDataForDebugging'; # DIST
our $VERSION = '0.002'; # VERSION
our $LIST = {
summary => 'List of modules and tips when dumping data structures for debugging',
description => <<'_',
This list catalogs some of the modules you can you to dump your data structures
for debugging purposes, so the modules will be judged mostly by the
appropriateness of its output for human viewing (instead of other criteria like
speed, footprint, etc).
_
entries => [
lib/Acme/CPANModules/DumpingDataForDebugging.pm view on Meta::CPAN
tags => ['perl'],
description => <<'_',
A modification to Data::Dump which adds color (and color theme) support, as well
as other visual aids like depth and array index/hash pair count indicator. It's
usually my go-to module for debugging.
_
},
{
lib/Acme/CPANModules/DumpingDataForDebugging.pm view on Meta::CPAN
},
],
};
1;
# ABSTRACT: List of modules and tips when dumping data structures for debugging
__END__
=pod
=encoding UTF-8
=head1 NAME
Acme::CPANModules::DumpingDataForDebugging - List of modules and tips when dumping data structures for debugging
=head1 VERSION
This document describes version 0.002 of Acme::CPANModules::DumpingDataForDebugging (from Perl distribution Acme-CPANModules-DumpingDataForDebugging), released on 2023-10-29.
=head1 DESCRIPTION
This list catalogs some of the modules you can you to dump your data structures
for debugging purposes, so the modules will be judged mostly by the
appropriateness of its output for human viewing (instead of other criteria like
speed, footprint, etc).
=head1 ACME::CPANMODULES ENTRIES
lib/Acme/CPANModules/DumpingDataForDebugging.pm view on Meta::CPAN
Author: L<PERLANCAR|https://metacpan.org/author/PERLANCAR>
A modification to Data::Dump which adds color (and color theme) support, as well
as other visual aids like depth and array index/hash pair count indicator. It's
usually my go-to module for debugging.
=item L<Data::Dumper::Compact>
Author: L<MSTROUT|https://metacpan.org/author/MSTROUT>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANModules/Import/CPANRatings/User/davidgaramond.pm view on Meta::CPAN
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-10-29'; # DATE
our $DIST = 'Acme-CPANModules-Import-CPANRatings-User-davidgaramond'; # DIST
our $VERSION = '0.002'; # VERSION
our $LIST = {description=>"This list is generated by scraping CPANRatings (cpanratings.perl.org) user page.",entries=>[{description=>"\nOk, it's not 2004 anymore, I suggest we retire or start to deprecate this module? This module now requires Perl 5....
1;
# ABSTRACT: List of modules mentioned by CPANRatings user davidgaramond
__END__
lib/Acme/CPANModules/Import/CPANRatings/User/davidgaramond.pm view on Meta::CPAN
=item L<Carp::Always>
Author: L<FERREIRA|https://metacpan.org/author/FERREIRA>
Modules like this deserve to be more well-known and should perhaps included in core Perl (or even become a command-line switch). I'm never comfortable with Carp and all the "complexity" of using it. What I wanted is simple, when debugging I...
<br><br>Call me inflicted with Ruby- or Python-envy, but it's been so ridiculous wanting to print out stack traces in Perl. I don't want to have to change/rewrite all my die()'s to croak() or confess()! And what about library codes which use die()?
<br><br>Thank God somebody wrote Carp::Always.
=item L<Data::Dump>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANModules/Import/CPANRatings/User/perlancar.pm view on Meta::CPAN
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-10-29'; # DATE
our $DIST = 'Acme-CPANModules-Import-CPANRatings-User-perlancar'; # DIST
our $VERSION = '0.002'; # VERSION
our $LIST = {description=>"This list is generated by scraping CPANRatings (cpanratings.perl.org) user page.",entries=>[{description=>"\nI'm not sure this really "befits a ::Tiny distribution" just because it's a thin wrapper of something. P...
1;
# ABSTRACT: List of modules mentioned by CPANRatings user perlancar
__END__
lib/Acme/CPANModules/Import/CPANRatings/User/perlancar.pm view on Meta::CPAN
=item L<Dist::Zilla::Plugin::Hook>
Author: L<VDB|https://metacpan.org/author/VDB>
Great for debugging. Just whip up some code in dist.ini to e.g. dump & print some stuffs, etc.
=item L<File::Tail::Dir>
Author: L<JJSCHUTZ|https://metacpan.org/author/JJSCHUTZ>
lib/Acme/CPANModules/Import/CPANRatings/User/perlancar.pm view on Meta::CPAN
=item L<JSON::MultiValueOrdered>
Author: L<TOBYINK|https://metacpan.org/author/TOBYINK>
I guess if you want to switch JSON implementation more easily with JSON, JSON::PP, and JSON::XS, it's better to use JSON::Tiny::Subclassable instead of JSON::Tiny, because the interface is more similar to JSON{::XS,::PP}, although it's not exactly th...
=item L<JSON::Tiny>
Author: L<DAVIDO|https://metacpan.org/author/DAVIDO>
lib/Acme/CPANModules/Import/CPANRatings/User/perlancar.pm view on Meta::CPAN
=item L<Debug::Easy>
Author: L<RKELSCH|https://metacpan.org/author/RKELSCH>
Not as easy as the name might claim. First of all, why do users need to pass B<LINE> explicitly for every call??? Other logging modules will get this information automatically via caller().
<br><br>Levels are a bit confusing: why is debug split to 2 (or 3)?
<br><br>Not as flexible as it should be because the design conflates some things together. For example, most levels output to STDERR but some level (VERBOSE) outputs to STDOUT instead. The output concern and levels should've been separated. Another e...
Rating: 4/10
lib/Acme/CPANModules/Import/CPANRatings/User/perlancar.pm view on Meta::CPAN
=item L<XXX>
Author: L<INGY|https://metacpan.org/author/INGY>
The part that makes this module convenient is that the functions return their original arguments. So when debugging (peppering dump statements), you don't have to change this:
<br><br>return ["some", $expr];
<br><br>to this (taking an example from another dumping module, Data::Dump):
<br><br>my $tmp = ["some", $expr]; dd $tmp; return $tmp;
<br><br>but just this:
<br><br>return YYY ["some", $expr];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANModules/Import/CPANRatings/User/stevenharyanto.pm view on Meta::CPAN
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-10-29'; # DATE
our $DIST = 'Acme-CPANModules-Import-CPANRatings-User-stevenharyanto'; # DIST
our $VERSION = '0.002'; # VERSION
our $LIST = {description=>"This list is generated by scraping CPANRatings (cpanratings.perl.org) user page.",entries=>[{description=>"\n(REMOVED)\n",module=>"Log::Any",rating=>undef},{description=>"\nProvides a thin/lightweight OO interface for \$?, ...
1;
# ABSTRACT: List of modules mentioned by CPANRatings user stevenharyanto
__END__
lib/Acme/CPANModules/Import/CPANRatings/User/stevenharyanto.pm view on Meta::CPAN
<br><br>Having said that, I would like to comment on the design and implementation of this module.
<br><br>1) The choice of Unicode character U+2204 as representation of undef. Unless one does something like 'binmode STDOUT, ":utf8"', with 'say P undef' I am just trading one warning ("Use of uninitialized value") with another (...
<br><br>2) P loads utf8 by default. For ultra-lightweight cases, this is sometimes not desirable. There is currently no way to turn this off.
<br><br>3) The arbitrary choice of three levels deep when printing references. This can be customized but with an unusual syntax. But again, the arbitrary choice of three.
<br><br>4) The "complex" rules of newline printing. p() is like puts, it can optionally add a newline. But unlike puts, the doc says it can also remove newlines. The behavior can also change if the string to be printed ends with 0x83.
<br><br>I might use P for a sprintf/printf replacement, but for debugging values, I'd prefer something "dumber" like Data::Dump::Color (or Data::Printer, if that's your thing).
=item L<Xporter>
Author: L<LAWALSH|https://metacpan.org/author/LAWALSH>
lib/Acme/CPANModules/Import/CPANRatings/User/stevenharyanto.pm view on Meta::CPAN
=item L<Log::AutoDump>
Author: L<CAGAO|https://metacpan.org/author/CAGAO>
This module is simple and to the point. Unfortunately, if you're a user of Log4perl or other logging framework, you'll have to switch just for a single feature (autodumping).
<br><br>An alternative is to use Log::Any, which also features autodumping (via $log->debugf("%s", $complex), $log->warnf(), and friends), while still allowing you to use Log4perl and other frameworks supported by Log::Any.
<br><br>
=item L<List::Pairwise>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANModules/NewDistributions/202001.pm view on Meta::CPAN
summary => "Catch test library http://catch-lib.net",
},
{
description => "Distribution Alien-libdwarf first released by DMOL at 2020-01-25T08:52:26Z.",
module => "Alien::libdwarf",
summary => "DWARF debugging information",
},
{
description => "Distribution Alien-libgeos first released by DMOL at 2020-01-25T09:57:02Z.",
module => "Alien::libgeos",
summary => "geos C++ library (alien, without perl-adapters).",
lib/Acme/CPANModules/NewDistributions/202001.pm view on Meta::CPAN
summary => "Catch test library for XS ",
},
{
description => "Distribution XS-libdwarf first released by DMOL at 2020-01-31T17:34:09Z.",
module => "XS::libdwarf",
summary => "DWARF debugging information for XS modules",
},
{
description => "Distribution XS-libgeos first released by SYBER at 2020-01-31T12:59:53Z.",
module => "XS::libgeos",
summary => "geos C++ library for XS ",
lib/Acme/CPANModules/NewDistributions/202001.pm view on Meta::CPAN
=item * L<Alien::catch> - Catch test library http://catch-lib.net
Distribution Alien-catch first released by SYBER at 2020-01-24T15:25:30Z.
=item * L<Alien::libdwarf> - DWARF debugging information
Distribution Alien-libdwarf first released by DMOL at 2020-01-25T08:52:26Z.
=item * L<Alien::libgeos> - geos C++ library (alien, without perl-adapters).
lib/Acme/CPANModules/NewDistributions/202001.pm view on Meta::CPAN
=item * L<XS::libcatch> - Catch test library for XS
Distribution XS-libcatch first released by SYBER at 2020-01-30T15:57:44Z.
=item * L<XS::libdwarf> - DWARF debugging information for XS modules
Distribution XS-libdwarf first released by DMOL at 2020-01-31T17:34:09Z.
=item * L<XS::libgeos> - geos C++ library for XS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANModules/OneLinerTools.pm view on Meta::CPAN
{
module => 'DD::Dummy',
description => <<'MARKDOWN',
My preference when dumping data structure when debugging Perl application is,
well, Perl format (unlike some others which prefer custom format like
<pm:Data::Printer>). The DD-Dummy distribution provides <pm:DD> module, which in
turn exports `dd` to dump your data structures for debugging using
<pm:Data::Dump>. Another good alternative is <pm:XXX> which by default uses YAML
output but can be changed with this environment variable setting:
PERL_XXX_DUMPER=Data::Dump
MARKDOWN
alternate_modules => ['XXX', 'Data::Printer'],
tags => ['debugging'],
},
{
module => 'Devel::Confess',
description => <<'MARKDOWN',
lib/Acme/CPANModules/OneLinerTools.pm view on Meta::CPAN
% perl -d:Confess ...
% perl -d:Confess=dump ...
MARKDOWN
tags => ['debugging'],
},
{
module => 'Carp::Patch::Config',
description => <<'MARKDOWN',
lib/Acme/CPANModules/OneLinerTools.pm view on Meta::CPAN
<pm:Devel::Confess>). Sometimes you want to customize some Carp parameters like
$Carp::MaxArgNums and $Carp::MaxArgLen from the command-line, and this is where
this module helps.
MARKDOWN
tags => ['debugging'],
},
{
module => 'DBIx::Conn::MySQL',
description => <<'MARKDOWN',
lib/Acme/CPANModules/OneLinerTools.pm view on Meta::CPAN
MARKDOWN
tags => ['database', 'dbi'],
},
{module=>'ojo'},
{module=>'DDP', summary=>'From the Data::Printer distribution', tags=>['debugging']},
{module=>'XXX', tags=>['debugging']},
{module=>'eval', tags=>['debugging']},
{module=>'this_mod', tags=>['module-loading']},
{module=>'lib::filter', tags=>['debugging', 'module-loading']},
],
};
1;
# ABSTRACT: List of modules to make your life easier when writing perl one-liners
lib/Acme/CPANModules/OneLinerTools.pm view on Meta::CPAN
=item L<DD::Dummy>
Author: L<PERLANCAR|https://metacpan.org/author/PERLANCAR>
My preference when dumping data structure when debugging Perl application is,
well, Perl format (unlike some others which prefer custom format like
L<Data::Printer>). The DD-Dummy distribution provides L<DD> module, which in
turn exports C<dd> to dump your data structures for debugging using
L<Data::Dump>. Another good alternative is L<XXX> which by default uses YAML
output but can be changed with this environment variable setting:
PERL_XXX_DUMPER=Data::Dump
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CPANModules_ScenarioR/OrderedHash.pm view on Meta::CPAN
## no critic
package Acme::CPANModules_ScenarioR::OrderedHash;
our $VERSION = 0.004; # VERSION
our $results = do{my$var=[[200,"OK",[{_name=>"participant=Tie::StoredOrderHash",_succinct_name=>"T:S",errors=>1.4e-06,participant=>"Tie::StoredOrderHash",pct_faster_vs_slowest=>0,pct_slower_vs_fastest=>5.16666666666667,rate=>539,samples=>22,time=>1.8...
1;
# ABSTRACT: List of modules that provide ordered hash data type
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
devdata/https_mojolicious.io_blog_2017_12_01_day-1-getting-started view on Meta::CPAN
<a href="/blog/tag/caching/">caching</a>
<a href="/blog/tag/carton/">carton</a>
<a href="/blog/tag/command/">command</a>
<a href="/blog/tag/css/">css</a>
<a href="/blog/tag/dancer/">dancer</a>
<a href="/blog/tag/debugging/">debugging</a>
<a href="/blog/tag/deployment/">deployment</a>
<a href="/blog/tag/development/">development</a>
<a href="/blog/tag/documentation/">documentation</a>
<a href="/blog/tag/example/">example</a>
<a href="/blog/tag/fluent/">fluent</a>
view all matches for this distribution
view release on metacpan or search on metacpan
devdata/https_mojolicious.io_blog_2018_12_01_welcome-mojoconf-recap_ view on Meta::CPAN
<a href="/blog/tag/caching/">caching</a>
<a href="/blog/tag/carton/">carton</a>
<a href="/blog/tag/command/">command</a>
<a href="/blog/tag/css/">css</a>
<a href="/blog/tag/dancer/">dancer</a>
<a href="/blog/tag/debugging/">debugging</a>
<a href="/blog/tag/deployment/">deployment</a>
<a href="/blog/tag/development/">development</a>
<a href="/blog/tag/documentation/">documentation</a>
<a href="/blog/tag/example/">example</a>
<a href="/blog/tag/fluent/">fluent</a>
view all matches for this distribution
view release on metacpan or search on metacpan
devdata/http_advent.perldancer.org_2018_16 view on Meta::CPAN
get '/my/api/route/:guid/:group/:force' => sub {
my $guid = route_parameters->get( 'guid' );
my $group = route_parameters->get( 'group' );
my $force = route_parameters->get( 'force' );
debug "GENERATING XML ONLY FOR $guid";
job_queue->queue_job({
name => "InstantXML",
guid => $guid,
title => "Instant XML Generator",
queue => 'InstantXML',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Capture.pm view on Meta::CPAN
if ($unix_utf8_crlf and $^O eq 'MSWin32') {
binmode($fh, ':unix:encoding(utf8):crlf');
}
else {
# _debug("# requested layers (@{$layers}) for @{[fileno $fh]}\n");
my %seen = ( unix => 1, perlio => 1 ); # filter these out
my @unique = grep { !$seen{$_}++ } @$layers;
# _debug("# applying unique layers (@unique) to @{[fileno $fh]}\n");
binmode($fh, join(":", ":raw", @unique));
}
};
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/CatFS.pm view on Meta::CPAN
option forking => (
is => 'ro',
doc => 'if enable, will fork and exit (default false)',
);
option debug => (
is => 'ro',
doc => 'if enable, will run Fuse::Simple in debug mode (default false)',
);
option cached => (
is => 'ro',
doc => 'if enable, will cached the picture instead choose another each open (default false)',
lib/Acme/CatFS.pm view on Meta::CPAN
}
my $content = try {
LWP::Simple::get($self->cat_url)
} catch {
carp $_ if $self->debug;
};
if($self->cached){
$cached_content = $content
}
lib/Acme/CatFS.pm view on Meta::CPAN
say "Initializing Fuse mountpoint '$mountpoint'... ";
Fuse::Simple::main(
mountpoint => $mountpoint,
debug => $self->debug,
'/' => {
$cat_file => sub {
$self->_get_cat_picture
},
},
lib/Acme/CatFS.pm view on Meta::CPAN
Acme::CatFS
=head1 SYNOPSIS
Acme::CatFS->new(mountpoint => '/tmp/catfs', debug => 0, cat_file => 'kitten.jpg')->run();
=head1 DESCRIPTION
Acme::CatFS will create a Fuse mountpoint and generate one virtual file, a random image of a cat. Will return a different image each time.
lib/Acme/CatFS.pm view on Meta::CPAN
=head2 cat_file
Specify the name of the file. Default is 'cat.jpg'
=head2 debug
If true, will run Fuse::Simple::main in debug mode.
=head2 forking
If true, we will fork then exit.
view all matches for this distribution