+# https://github.com/perl-entrance-org/workshop-2018/blob/master/4th/slide.md
+# 標準入力に対する条件が多いので、スクリプト中に都度記載
+# 入力と出力をわかりやすくするために区切り線を入れた
+print '=== Input Some Strings ===', "\n";
+while ( chomp( my $input = <STDIN> ) ) {
+ print '=== Return Strings ===', "\n";
+ # 文字列が0の場合, ループを抜ける(lastを使って...)
+ print "input 0 , script end\n";
+ # 文字列がperlないしPerlを含む場合,
+ if ( $input =~ /[pP]erl/ ) {
+ # 文字列に大文字小文字問わず, pythonの文字列が
+ # 含まれる場合, 「Find Python!」と表示する.
+ if ( $input =~ /python/i ) {
+ print "Find Python!\n";
+ # 文字列にperlないしrubyないしpythonが
+ # 含まれる場合, 「Love Programming!」と
+ if ( $input =~ /perl|ruby|python/ ) {
+ print "Love Programming!\n";
+ if ( $input =~ /^papix/ ) {
+ # 文字列にHelloが含まれる場合, その後に
+ # 続く単語xxxxを使って「Hello! xxxx!」と
+ if ( $input =~ /Hello/ ) {
+ $input =~ /Hello (.+)/;
+ print '=== Input Some Strings ===', "\n";