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 XML::RSS; | |
use Coro; | |
use Coro::LWP; | |
use LWP::UserAgent; | |
use HTTP::Request::Common; | |
use utf8; | |
use JSON::XS; |
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
print "hello\n"; | |
sun = String.new "String.new\n"; | |
print sun; | |
for num in 1..3 | |
print num,"\n"; | |
end | |
print "end\n"; |
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/ruby | |
basket = 0 | |
while 1 | |
print "果物の入力\n" | |
fruit = STDIN.gets | |
result = fruit.gsub /\n/,"" | |
# p 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; | |
my @array = qw/1 2 3 4 5 6 7 8/; | |
print "first!!\n"; | |
print "$_ " for (@array); | |
print "\n"x2; | |
my $a = pop @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/perl | |
use strict; | |
use warnings; | |
my $n = "\n"; | |
my @array = qw/3 8 5 4 2 9 5 0 1 7 6 11 23 38 99 100/; | |
print "First!!\n"; | |
print "$_ " foreach (@array); | |
print $n x 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/perl | |
use strict; | |
use warnings; | |
my $n = "\n"; | |
my @lines = <STDIN>; | |
chomp @lines; | |
print $n; | |
my @array = reverse @lines; |
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; | |
my $n = "\n"; | |
print "Please input number 1~7" . $n; | |
my @lines = <STDIN>; | |
chomp @lines; | |
print $n; | |
my @array = qw/fred betty barney dino wilma pebbles bamm-bamm/; |
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; | |
my $n = "\n"; | |
my $result = max(10,20); | |
print $result . $n; | |
sub max { | |
my ($a, $b) = @_; |
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 5.010; | |
my $sum; | |
running_sum(5,6); | |
running_sum(1..3); | |
running_sum(4); |
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 5.010; | |
my $n = "\n"; | |
while(<>){ | |
# chomp; で、改行を取り消すことが可能 | |
print "$_"; |
OlderNewer