- array,structはサイズ固定
- maps,slicesはサイズ変動
- sliceの前にarrayを学ぶこと
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use Data::Dumper; | |
my $strobj = MyURI::http->new({ str => 'http://hoge/'}); | |
warn Dumper $strobj; | |
warn $strobj; | |
package MyURI { | |
use overload ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Data::Dumper; | |
my @banner_size = ({ | |
width => 320, | |
height => 50, | |
}); | |
my $is_existing_size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 前提条件 | |
# 1.fontforgeとx11をインストール済み | |
# sudo port install fontforge | |
# x11 http://xquartz.macosforge.org/landing/ | |
# | |
# 2.同一ディレクトリにRicty-***. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use bigint lib => 'GMP'; | |
use Test::More; | |
subtest 'Project Euler - Problem 3' => sub { | |
my $n = 6008514751430000000000000000000000000000000000000000000000000000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Test::More; | |
my $str = 'foo Foo FOO'; | |
$str =~ s{(foo)}{ my $len = scalar split(/[A-Z]/,$1); ( $len == 0 ) ? 'BAR' : ( $len == 1 ) ? 'bar' : 'Bar' }ieg; | |
is($str, 'bar Bar BAR'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Text::Xslate; | |
use IO::All; | |
my $tx = Text::Xslate->new( | |
syntax => 'TTerse', | |
verbose => 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use IPC::Run qw/ timeout /; | |
IPC::Run::run( | |
['cat', 'sample.txt'], | |
\my $in, | |
\my $out, | |
\my $err, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
my $dis = MyDispatch->new; | |
$dis->print; | |
package MyDispatch { | |
use CGI; |