Skip to content

Instantly share code, notes, and snippets.

View wchristian's full-sized avatar

Christian Walde (Mithaldu) wchristian

View GitHub Profile
#!/usr/bin/perl
use feature 'say';
use Try::Tiny;
use Exception::Class (
'MyException',
'AnotherException' => { isa => 'MyException' },
package Exception::Class::OnCaller;
use strict;
use warnings;
use Sub::Exporter -setup => {
exports => [
ex => \&build_named_exception_builder,
],
};
#!/usr/bin/perl
use strict; use warnings;
use Config::Std;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use Parallel::ForkManager;
use Benchmark;
#!/usr/bin/perl
use 5.10.1;
use strict;
use warnings;
use HTTP::Request::Common 'POST';
use AnyEvent::HTTP;
use Benchmark;
#!/usr/bin/perl
use 5.10.1;
use strict;
use warnings;
use HTTP::Request::Common 'POST';
use AnyEvent::HTTP;
use Benchmark;
#!/usr/bin/perl
# $Id: parallel.pl,v 1.7 2008/05/06 20:41:33 dk Exp $
#
# This example fetches two pages in parallel, one with http/1.0 another with
# http/1.1 . The idea is to demonstrate three different ways of doing so, by
# using object API, and explicit and implicit loop unrolling
#
use strict;
use warnings;
use strict;
use warnings;
package Parallel::Downloader;
use Moose;
use MooseX::HasDefaults::RO;
has requests => ( isa => 'ArrayRef', required => 1 );
has responses => ( isa => 'ArrayRef', default => sub {[]} );
use strict;
use warnings;
package Parallel::Downloader;
=head1 SYNOPSIS
use HTTP::Request::Common qw( GET POST );
use Parallel::Downloader 'async_download';
D:\Ubic>dzil test
!!! [AutoPrereq] will be removed in Dist::Zilla v5; replace it with [AutoPrereqs] (note the 's')
[DZ] building test distribution under .build\FfXTuvYCFd
[DZ] beginning to build Ubic
[DZ] guessing dist's main_module is lib/Ubic.pm
[DZ] extracting distribution abstract from lib/Ubic.pm
[PodWeaver] [@Default/Name] couldn't find abstract in lib/Ubic/Daemon/OS/POSIX.pm
[PodWeaver] [@Default/Name] couldn't find abstract in lib/Ubic/Daemon/OS/Linux.pm
[@Filter/ExtraTests] rewriting release test xt/release/pod-coverage.t
use strict;
use warnings;
package test_case;
use HTTP::Request::Common qw'POST GET';
use LWP::UserAgent;
use AnyEvent::HTTP;
use Data::Dumper;