Skip to content

Instantly share code, notes, and snippets.

@Code-Hex
Created August 20, 2014 06:29
Show Gist options
  • Save Code-Hex/484bee3d38e74eacf610 to your computer and use it in GitHub Desktop.
Save Code-Hex/484bee3d38e74eacf610 to your computer and use it in GitHub Desktop.
Perl で STDINに複数行読み込ませる方法
#! /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);
@Code-Hex
Copy link
Author

初めてのPerlを読んで、基礎を最初からやってるんだけど、学べることってまだまだ多いね

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment