Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# coding:utf-8
class MyApp
attr_accessor :foo
def initialize(*foo)
@foo = foo
end
@tomcha
tomcha / barusu.pl
Created January 15, 2016 13:34
barusu.pl
#!/usr/bin/env perl
use strict;
use warnings;
sub barusu{
die
}
open my $fh, '<', 'nofile.txt' or barusu $!;
@tomcha
tomcha / rpn.pl
Created December 31, 2015 08:12
逆ポーランド記法
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use open qw/:encoding(utf-8) :std/;
use v5.12;
use Data::Dumper;
@tomcha
tomcha / ouyou8.pl
Last active December 19, 2015 05:38
ouyou8
#!/usr/bin/env perl
use strict;
use warnings;
my $acount;
my @domain = ('foo.net', 'bar.net', 'baz.net');
my @mailadd;
for (;;){
print "アカウント名を入力して下さい。(終了はEND) >";
@tomcha
tomcha / ouyou7.pl
Created December 19, 2015 05:25
ouyou7
#!/usr/bin/env perl
use strict;
use warnings;
my $num;
my @prime;
print "2より大きい数字を1つ入力して下さい。>>";
$num = <STDIN>;
@tomcha
tomcha / ouyou6.pl
Created December 19, 2015 05:08
ouyou6
#!/usr/bin/env perl
use strict;
use warnings;
print "1つ遅れて返事する君(終わる時は、'END'と入力しましょう。)\n";
my $str = 'こんにちは。';
my $str_next = 'あなたの名前はなんですか?';
for (;;){
print "com>> $str\n";
@tomcha
tomcha / ouyou5.pl
Created December 19, 2015 04:48
ouyou5
#!/usr/bin/env perl
use strict;
use warnings;
my @foods;
print "時間電卓です。時間と分を別々に入力して下さい。終わる時は、ENDを入力して下さい。\n";
my $total_hour = 0;
@tomcha
tomcha / ouyou4.pl
Created December 19, 2015 04:35
ouyou4
#!/usr/bin/env perl
use strict;
use warnings;
my @foods;
print "好きな食べ物を入力して下さい。入力を終える時は END と入力して下さい。\n";
for (;;){
@tomcha
tomcha / ouyou3.pl
Created December 19, 2015 04:32
ouyou3
#!/usr/bin/env perl
use strict;
use warnings;
my @foods;
print "好きな食べ物を入力して下さい。入力を終える時は END と入力して下さい。\n";
for (;;){
@tomcha
tomcha / ouyou2
Created December 19, 2015 04:23
ouyou2
#!/usr/bin/env perl
use strict;
use warnings;
my @numbers;
print "5つの数字を入力して下さい。\n";
for my $i (1..5){
print "$iつ目の数字>>>";