Created
August 20, 2014 06:29
-
-
Save Code-Hex/484bee3d38e74eacf610 to your computer and use it in GitHub Desktop.
Perl で STDINに複数行読み込ませる方法
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; | |
print "input data: "; | |
print "$_ " for (@lines); | |
print $n x 2; # x はエックス | |
print "reversed data: "; | |
print "$_ " for (@array); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
初めてのPerlを読んで、基礎を最初からやってるんだけど、学べることってまだまだ多いね