奈落のボレロⅡ:C3@work

-->奈落のボレロ

標準エラーにメッセージ出力

2019-01-27 11:16:08 | Perl
標準エラーにメッセージを出力する。

print STDERR "File not found.\n";

見つからなかったファイル名を出力する。

my $file1= 'test1.txt';
my $file2= 'test2.txt';

if (!-f $file1) {
  print STDERR "$file1 not found.\n";
}

if (!-f $file2) {
  print STDERR "$file2 not found.\n";
}

最新の画像もっと見る

コメントを投稿

ブログ作成者から承認されるまでコメントは反映されません。