view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
*{"${package}::$field"} = $sub;
return $code if defined wantarray;
}
sub default_as_code {
require Data::Dumper;
local $Data::Dumper::Sortkeys = 1;
my $code = Data::Dumper::Dumper(shift);
$code =~ s/^\$VAR1 = //;
$code =~ s/;$//;
return $code;
}
inc/Spiffy.pm view on Meta::CPAN
# Debugging support
#===============================================================================
sub spiffy_dump {
no warnings;
if ($dump eq 'dumper') {
require Data::Dumper;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Indent = 1;
return Data::Dumper::Dumper(@_);
}
require YAML;
$YAML::UseVersion = 0;
return YAML::Dump(@_) . "...\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
eg/ssh-add.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Beanstalk;
use JSON;
use Data::Dumper;
use feature 'say';
my $bs = AnyEvent::Beanstalk->new
(server => 'localhost',
encoder => sub { encode_json(shift) });
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/CacheDNS.pm view on Meta::CPAN
use strict;
use warnings;
use base 'AnyEvent::DNS';
use Data::Dumper;
our $VERSION = '0.08';
# Detect AnyEvent >= 6.0.1
my $IS_AE_6X = version->can("parse")
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/CallbackStack.pm view on Meta::CPAN
our $VERSION = '0.12';
use utf8;
use feature 'say';
use common::sense;
use Data::Dumper::Simple;
use AnyEvent;
use constant DEBUG => $ENV{ANYEVENT_CALLBACKSTACK_DEBUG};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/ClickHouse.pm view on Meta::CPAN
use AnyEvent::HTTP;
use URI;
use URI::QueryParam;
use Scalar::Util qw/looks_like_number/;
use Data::Dumper;
our $headers;
$headers->{'User-agent'} = 'Mozilla/5.0 (compatible; U; Perl-AnyEvent-ClickHouse;)';
$headers->{'Te'} = undef;
$headers->{'Referer'} = undef;
view all matches for this distribution
view release on metacpan or search on metacpan
t/04-check.t view on Meta::CPAN
use strict;
use warnings;
use AnyEvent;
use AnyEvent::ConnPool;
use Data::Dumper;
use Test::More;
my $global_counter = 0;
my $cv = AnyEvent->condvar();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Connection/Util.pm view on Meta::CPAN
}
return;
}
sub dumper (@) {
eval { require Data::Dumper;1 } or return @_;
no strict 'refs';
*{ caller().'::dumper' } = sub (@) {
my $s = Data::Dumper->new([@_])
#->Maxdepth(3)
->Terse(1)
->Indent(1)
->Purity(0)
->Useqq(1)
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
*{"${package}::$field"} = $sub;
return $code if defined wantarray;
}
sub default_as_code {
require Data::Dumper;
local $Data::Dumper::Sortkeys = 1;
my $code = Data::Dumper::Dumper(shift);
$code =~ s/^\$VAR1 = //;
$code =~ s/;$//;
return $code;
}
inc/Spiffy.pm view on Meta::CPAN
# Debugging support
#===============================================================================
sub spiffy_dump {
no warnings;
if ($dump eq 'dumper') {
require Data::Dumper;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Indent = 1;
return Data::Dumper::Dumper(@_);
}
require YAML;
$YAML::UseVersion = 0;
return YAML::Dump(@_) . "...\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/DNS/EtcHosts.pm view on Meta::CPAN
use AnyEvent ();
use AnyEvent::Socket ();
use constant DEBUG => $ENV{PERL_ANYEVENT_DNS_ETCHOSTS_DEBUG};
use if DEBUG, 'Data::Dumper';
our $GUARD;
=head1 IMPORTS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Discord.pm view on Meta::CPAN
class AnyEvent::Discord 0.7 {
use Algorithm::Backoff::Exponential;
use AnyEvent::Discord::Payload;
use AnyEvent::WebSocket::Client;
use Data::Dumper;
use JSON qw(decode_json encode_json);
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
lib/AnyEvent/Discord.pm view on Meta::CPAN
$self->_socket($socket);
# If we send malformed content, bail out
$socket->on('parse_error', sub {
my ($c, $error) = @_;
$self->_debug(Data::Dumper::Dumper($error));
die $error;
});
# Handle reconnection
$socket->on('finish', sub {
view all matches for this distribution
view release on metacpan or search on metacpan
use Module::Build 0.3601;
my %module_build_args = (
"build_requires" => {
"Data::Dumper" => 0,
"File::Find" => 0,
"File::Temp" => 0,
"Module::Build" => "0.3601",
"Test::More" => 0,
"strict" => 0,
view all matches for this distribution
view release on metacpan or search on metacpan
xt/perlcritic.rc view on Meta::CPAN
[-Variables::ProhibitPunctuationVars]
# We want to be able to use Carp::Verbose in our tests scripts, so
# we add Carp to the whitelist
[Variables::ProhibitPackageVars]
#packages = Data::Dumper File::Find FindBin Log::Log4perl Carp
#[-ValuesAndExpressions::ProhibitEmptyQuotes]
# I really don't think q{/} is more readable than '/'...
#[-ValuesAndExpressions::ProhibitNoisyQuotes]
view all matches for this distribution
view release on metacpan or search on metacpan
ok $obj, "Constructor";
my $phase = 0;
$obj->do(require => 'Data::Dumper', cb => sub {
$phase++;
diag explain \@_ unless ok $_[0] eq 'ok', 'require Data::Dumper';
$obj->do(
module => 'Data::Dumper',
args => [ [ 1, 2, 3 ]],
cb => sub {
my ($s, $o) = @_;
diag explain \@_ unless ok $s eq 'ok', 'Data::Dumper created';
$phase++;
$o->Indent(0, sub { ok $_[0] eq 'ok', 'dumper->Indent(0)' });
$o->Terse(1, sub { ok $_[0] eq 'ok', 'dumper->Terse(1)' });
$o->Useqq(1, sub { ok $_[0] eq 'ok', 'dumper->Useqq(1)' });
my $cv = condvar AnyEvent;
my $obj = new AnyEvent::ForkObject;
ok $obj, "Constructor";
$obj->do(require => 'Data::Dumper', cb => sub {
diag explain \@_ unless ok $_[0] eq 'ok', 'require Data::Dumper';
$obj->do(
module => 'Data::Dumper',
args => [ [ 1, 2, 3 ]],
cb => sub {
my ($s, $o) = @_;
ok $s eq 'ok', 'Data::Dumper created';
undef $obj;
$o->Dump(0, sub {
my ($st, $ob) = @_;
ok $obj, "Constructor";
kill KILL => $obj->{pid};
waitpid $obj->{pid}, 0;
$obj->do(require => 'Data::Dumper', cb => sub {
diag explain \@_ unless ok $_[0] eq 'fatal', 'Child was killed';
my $t;
$t = AE::timer 0.3, 0 => sub {
undef $t;
$cv->send;
}
});
my $dont_call_if_destroyed = 1;
$obj2->do(require => 'Data::Dumper', cb => sub {
diag explain \@_;
$dont_call_if_destroyed = 0;
});
kill KILL => $obj2->{pid};
undef $obj2;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
*{"${package}::$field"} = $sub;
return $code if defined wantarray;
}
sub default_as_code {
require Data::Dumper;
local $Data::Dumper::Sortkeys = 1;
my $code = Data::Dumper::Dumper(shift);
$code =~ s/^\$VAR1 = //;
$code =~ s/;$//;
return $code;
}
inc/Spiffy.pm view on Meta::CPAN
# Debugging support
#===============================================================================
sub spiffy_dump {
no warnings;
if ($dump eq 'dumper') {
require Data::Dumper;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Indent = 1;
return Data::Dumper::Dumper(@_);
}
require YAML;
$YAML::UseVersion = 0;
return YAML::Dump(@_) . "...\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
sub event {
my ($self, $event, @args) = @_;
# if ($self->{verbose}) {
# use Data::Dumper;
# print Data::Dumper
# ->new ([[$event, @args]])
# ->Pair ("=>")
# ->Useqq (1)
# ->Indent (0)
# ->Terse (1)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Gearman/WorkerPool.pm view on Meta::CPAN
package AnyEvent::Gearman::WorkerPool;
# ABSTRACT: Managing Worker's lifecycle with Slots
our $VERSION = '1.0'; # VERSION
use Log::Log4perl qw(:easy);
use Data::Dumper;
use Moose;
use Storable qw(freeze thaw);
use AnyEvent;
use AnyEvent::Gearman::Worker;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
*{"${package}::$field"} = $sub;
return $code if defined wantarray;
}
sub default_as_code {
require Data::Dumper;
local $Data::Dumper::Sortkeys = 1;
my $code = Data::Dumper::Dumper(shift);
$code =~ s/^\$VAR1 = //;
$code =~ s/;$//;
return $code;
}
inc/Spiffy.pm view on Meta::CPAN
# Debugging support
#===============================================================================
sub spiffy_dump {
no warnings;
if ($dump eq 'dumper') {
require Data::Dumper;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Indent = 1;
return Data::Dumper::Dumper(@_);
}
require YAML;
$YAML::UseVersion = 0;
return YAML::Dump(@_) . "...\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
*{"${package}::$field"} = $sub;
return $code if defined wantarray;
}
sub default_as_code {
require Data::Dumper;
local $Data::Dumper::Sortkeys = 1;
my $code = Data::Dumper::Dumper(shift);
$code =~ s/^\$VAR1 = //;
$code =~ s/;$//;
return $code;
}
inc/Spiffy.pm view on Meta::CPAN
# Debugging support
#===============================================================================
sub spiffy_dump {
no warnings;
if ($dump eq 'dumper') {
require Data::Dumper;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Indent = 1;
return Data::Dumper::Dumper(@_);
}
require YAML;
$YAML::UseVersion = 0;
return YAML::Dump(@_) . "...\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Groonga/Result.pm view on Meta::CPAN
package AnyEvent::Groonga::Result;
use strict;
use warnings;
use base qw( Class::Accessor::Fast );
use AnyEvent::Groonga::Result::Select;
use Data::Dumper;
use Encode;
__PACKAGE__->mk_accessors($_) for qw( data posted_command );
sub new {
lib/AnyEvent/Groonga/Result.pm view on Meta::CPAN
sub dump {
my $self = shift;
{
no warnings 'redefine';
local *Data::Dumper::qquote = sub { return shift; };
local $Data::Dumper::Useperl = 1;
return encode( "utf8", decode( "utf8", Dumper( $self->data ) ) );
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
HEAD => "https://www.google.com",
headers => { "user-agent" => "MySearchClient 1.0" },
timeout => 30,
sub {
my ($body, $hdr) = @_;
use Data::Dumper;
print Dumper $hdr;
}
;
Example: do another simple HTTP GET request, but immediately try to
view all matches for this distribution
view release on metacpan or search on metacpan
benchmark.pl view on Meta::CPAN
#!/usr/bin/env perl
use common::sense; #new features in perl
use Getopt::Long; # to command line parsing
use AnyEvent::HTTP; # use for http requests and etc. methods
use POSIX; # POSIX related stuff
use Data::Dumper; # to debug data
use AnyEvent::CacheDNS ':register'; # dns requests caching
my $DEBUG = 0; #Debug mode. Default is false (0)
my $verbose = 0; #to view the each connection result
my $timeout = 60;
my $count = 30000; #default number of requests
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/I3.pm view on Meta::CPAN
say "Currently, you use " . @{$workspaces} . " workspaces";
A somewhat more involved example which dumps the i3 layout tree whenever there
is a workspace event:
use Data::Dumper;
use AnyEvent;
use AnyEvent::I3;
my $i3 = i3();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/I3X/Workspace/OnDemand.pm view on Meta::CPAN
use AnyEvent::I3 qw(:all);
use List::Util qw(first any);
use File::Spec::Functions qw(catfile);
use Data::Compare;
use Data::Dumper;
use X11::Protocol;
use Proc::ProcessTable;
use IO::Select;
field $i3;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/proxy.pl view on Meta::CPAN
use AE;
use AnyEvent::IRC::Server;
use AnyEvent::IRC::Client;
use Lingua::JA::Gal;
use opts;
use Data::Dumper;
opts my $port => 'Int';
my $ircd = AnyEvent::IRC::Server->new(
port => $port,
view all matches for this distribution
view release on metacpan or search on metacpan
samples/debug_console view on Meta::CPAN
use common::sense;
use IO::Handle;
use AnyEvent;
use AnyEvent::IRC::Client;
use AnyEvent::IRC::Util qw/mk_msg parse_irc_msg encode_ctcp/;
use Data::Dumper;
my ($nick, $server, $port) = @ARGV;
my $c = AnyEvent->condvar;
my $stdout = AnyEvent::Handle->new (fh => \*STDOUT);
samples/debug_console view on Meta::CPAN
if ($line =~ /^!/) {
my $r = eval $line;
if ($@) {
warn "eval error: $@\n";
} else {
$Data::Dumper::Terse = 1;
$stdout->push_write ("result: " . Data::Dumper::Dumper ($r));
}
} else {
my $msg = parse_irc_msg ($line);
$con->send_msg ($msg->{command}, @{$msg->{params}});
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/02-prima-http.t view on Meta::CPAN
my $server = Test::HTTP::LocalServer->spawn();
my $mw = Prima::MainWindow->new();
use Data::Dumper;
my $res;
my $timer;
my $web_request;
my $answer;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Inotify/Simple.pm view on Meta::CPAN
$self->handle_move_to($relative, $event->cookie);
$handled = 1;
}
if (!$handled){
require Data::Dumper;
local $Data::Dumper::Maxdepth = 2;
Carp::cluck "BUGBUG: Unhandled event: ".
Data::Dumper->Dump($event);
}
}
sub rel2abs {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
*{"${package}::$field"} = $sub;
return $code if defined wantarray;
}
sub default_as_code {
require Data::Dumper;
local $Data::Dumper::Sortkeys = 1;
my $code = Data::Dumper::Dumper(shift);
$code =~ s/^\$VAR1 = //;
$code =~ s/;$//;
return $code;
}
inc/Spiffy.pm view on Meta::CPAN
# Debugging support
#===============================================================================
sub spiffy_dump {
no warnings;
if ($dump eq 'dumper') {
require Data::Dumper;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Indent = 1;
return Data::Dumper::Dumper(@_);
}
require YAML;
$YAML::UseVersion = 0;
return YAML::Dump(@_) . "...\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
*{"${package}::$field"} = $sub;
return $code if defined wantarray;
}
sub default_as_code {
require Data::Dumper;
local $Data::Dumper::Sortkeys = 1;
my $code = Data::Dumper::Dumper(shift);
$code =~ s/^\$VAR1 = //;
$code =~ s/;$//;
return $code;
}
inc/Spiffy.pm view on Meta::CPAN
# Debugging support
#===============================================================================
sub spiffy_dump {
no warnings;
if ($dump eq 'dumper') {
require Data::Dumper;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Indent = 1;
return Data::Dumper::Dumper(@_);
}
require YAML;
$YAML::UseVersion = 0;
return YAML::Dump(@_) . "...\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/KVStore/Etcd.pm view on Meta::CPAN
=cut
sub _portability_wrapper {
my ($sub, $result) = @_;
use Data::Dumper;
for my $e (@{decode_json($result)->{result}->{events}}){
$e = $e->{kv};
&$sub(decode_base64($e->{key}), decode_base64($e->{value}));
}
}
view all matches for this distribution