Snippets

sironekotoro Perl入学式 2018 第4回 練習問題 regexp_replace.pl

Created by sironekotoro

File regexp_replace.pl Added

  • Ignore whitespace
  • Hide word diff
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+# Perl入学式 2018 第4回 練習問題
+# https://github.com/perl-entrance-org/workshop-2018/blob/master/4th/slide.md
+# 練習問題(regexp_replace.pl)
+
+my $str = 'I love ruby';
+
+# この$strに格納された文字列を, 置換を利用して,
+# 「I love perl」に書き換えるようなコードを
+# 書いてみましょう.
+
+$str =~ s/ruby/perl/;
+print "$str\n";
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.