Skip to content

Instantly share code, notes, and snippets.

View gfx's full-sized avatar

FUJI Goro gfx

View GitHub Profile
#!perl -w
use strict;
use Benchmark qw(:all);
use Sub::Call::Tail;
sub foo{ 1 }
sub tailcall{
tail foo(1, 2, 3);
}
#!perl -w
use strict;
use Test::More;
#my $tests = 0;
#sub is{
# my($got, $expected) = @_;
# print $got eq $expected ? 'ok ' : 'not ok ';
# print ++$tests, "\n";
#}
t/00_compile.t ............... ok
t/01_object.t ................ ok
t/02_singleton.t ............. ok
t/03_args_and_initializer.t .. ok
t/04_export.t ................ ok
t/05_subclass.t .............. ok
xt/pod.t ..................... ok
xt/pod_coverage.t ............ ok
# Failed test 'POD spelling for lib/Object/Container/ja.pod'
#!perl -w
# $ perl -Mblib benchmark-reftype.pl
# $ perl benchmark-reftype.pl
use strict;
use Benchmark qw(:all);
use Scalar::Util;
my $ref = {};
/* C++ */
/* $ g++ foo.cpp && ./a.out */
#include <iostream>
#include <cstring>
int count(const char *str, char ch);
using namespace std;
int main(void) {
diff --git a/cpanm b/cpanm
index abf9d09..b368a13 100755
--- a/cpanm
+++ b/cpanm
@@ -1,6 +1,7 @@
#!/usr/bin/perl
use strict;
use File::Basename qw(basename);
+use Fatal qw(chdir);
diff --git a/cpanm b/cpanm
index 4b4e71c..366958f 100755
--- a/cpanm
+++ b/cpanm
@@ -4,18 +4,18 @@ use Config;
use File::Basename qw(basename);
use Fatal qw(chdir);
use Parse::CPAN::Meta;
+use File::Spec;
diff --git a/cpan-outdated b/cpan-outdated
index fdb9331..9daa3ee 100755
--- a/cpan-outdated
+++ b/cpan-outdated
@@ -42,11 +42,14 @@ sub main {
my $inst_version = MM->parse_version($path);
$inst_version =~ s/\s+//; # workaround for Attribute::Params::Validate
if ($inst_version ne $version && CPAN::Version->vlt($inst_version, $version)) {
- next if $seen{$dist}++;
+ my $name = $dist;
#!perl
use strict;
printf "Perl/%vd\n", $^V;
print "Moose/$Moose::VERSION\n";
#print "Mouse/$Mouse::VERSION\n";
{
package PlainMoose;
use Moose;
has foo => (is => 'rw');
#!perl -w
use Any::Moose;
use Any::Moose '::Util::TypeConstraints';
use Math::BigInt;
subtype 'BigInt', as 'Math::BigInt';
coerce 'BigInt',
from 'Int', via { Math::BigInt->new($_) };
has value => (