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
sub _create_body { | |
my ($c) = @_; | |
my $body = ''; | |
my $boundary = $c->req->{_body}->can('boundary') ? $c->req->{_body}->boundary : undef; | |
if ( defined $boundary && $boundary ne '' ) { | |
# multipart/form-data の場合 | |
# ファイル |
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
sub reproxy { | |
my ($c, $proxy_base_url) = @_; | |
my $path = $c->req->path; | |
my $query = $c->req->uri->query; | |
my $url = $proxy_base_url . '/' . $path; | |
if (defined $query ) { | |
$url .= '?' . $query; | |
} |
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
export MY_NEW_PERL="perl-5.24@default" | |
export MY_TOOL_PERL="perl-5.20@default" | |
alias reply=" perlbrew exec -q --with $MY_TOOL_PERL reply" | |
alias riji=" perlbrew exec -q --with $MY_TOOL_PERL riji" | |
alias prt=" perlbrew exec -q --with $MY_TOOL_PERL prt" | |
alias revealup=" perlbrew exec -q --with $MY_TOOL_PERL revealup" | |
alias countperl=" perlbrew exec -q --with $MY_TOOL_PERL countperl" | |
alias from_unixtime="perlbrew exec -q --with $MY_TOOL_PERL from_unixtime" |
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/perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
my $value = "aa\n\nbb\n"; | |
my @result = split /\n/, $value; | |
print Dumper(\@result); |
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/perl | |
use strict; | |
use warnings; | |
# 引数が数値A 演算子 数値Bという文字列であれば、その式を計算して結果を返す関数calc_stringを書いてみましょう | |
# 「数値A」「演算子」「数値B」の間にはそれぞれ半角スペースが入ります | |
# 数値は正・負の整数とし、演算子は+-*/%が使えるものとします | |
# 引数が 数値A 演算子 数値B というフォーマットに一致しない場合は ERROR! という文字列を返すようにしましょう | |
print calc_string("-12 + 34"); |
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 Scope::Guard; | |
sub teardown { | |
#... ここに teardown でやりたい終了処理を入れる | |
} | |
sub startup { | |
#... ここに startup でやりたい初期化処理を入れる | |
return Scope::Guard->new(\&teardown); | |
} |
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 v6; | |
my $hoge = $=aaa; | |
warn $hoge; | |
=begin aaa | |
aiueo | |
=end aaa | |
### 実行すると... |
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 Data::Dumper; | |
my $papix = { | |
name => 'papix', | |
affiliation => 'namba.pm', | |
perl => 60, | |
python => 50, |
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 Data::Dumper; | |
my $papix = { | |
name => 'papix', | |
affiliation => 'namba.pm', | |
perl => 60, |
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
^[::Send {Esc}{Esc} | |
^o::Send {vkF3sc029} |
NewerOlder