Created by sironekotoro 2018-07-22 View revision File regexp_replace.pl Added Side-by-side diff More 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";