Skip to content

Instantly share code, notes, and snippets.

View kyanny's full-sized avatar

Kensuke Nagae kyanny

View GitHub Profile
#!perl
# $Id$
use strict;
use warnings;
use File::Spec;
use FindBin;
use lib File::Spec->catdir($FindBin::Bin, "..", "lib");
use Getopt::Long;
#!/usr/local/bin/perl
use strict;
use Data::Dumper;
warn Dumper { key => 'value' };
sub ret1 { return }
sub ret2 { return undef }
sub _wantarray { wantarray ? 'list' : 'scalar' }
#!/usr/local/bin/perl
use strict;
use Devel::Size qw(size);
use Perl6::Say;
use URI;
use URI::Query;
my $url = 'http://nttdocomosucks.example.com/path?too=many&query=string';
my $uri = URI->new($url);
#!/usr/local/bin/perl
use strict;
use Template;
use Data::Dumper;
sub myfilter {
my ($context, $key) = @_;
return sub {
my $text = shift;
svn log http://fastladder.googlecode.com/svn/trunk/ -q | perl -anle 'next if /^-+$/; $,=q{,}; $committers{$F[2]}++; END{ print keys %committers}'
#!/bin/sh
# $Id$
svn log --stop-on-copy -q | perl -anle 'next if /^\-+$/; unshift @rows, $F[0]; END { $rev = sprintf(q/%s:%s/, $rows[0], $rows[-1]); $rev =~ s/r//g; print $rev }'
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use DateTime::Set;
use DateTime::Span;
use Data::Dumper;
my $d1 = DateTime->new(year => 2009, month => 2, day => 27);
my $d2 = DateTime->new(year => 2009, month => 4, day => 1);
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::Japanese;
use Perl6::Say;
my $fmt = DateTime::Format::Japanese->new;
my $dt = DateTime->today(time_zone => 'local');
my $str = $fmt->format_ymd($dt);
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::Japanese;
use Perl6::Say;
my $fmt = DateTime::Format::Japanese->new;
my $dt = DateTime->today(time_zone => 'local');
my $str = $fmt->format_ymd($dt);
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::Japanese;
use Perl6::Say;
my $fmt = DateTime::Format::Japanese->new;
my $dt = DateTime->today(time_zone => 'local');
my $str = $fmt->format_ymd($dt);