作者gecer (gecer)
看板Perl
標題[問題] 請問一段語法的意思
時間Wed Jun 1 21:25:41 2016
$HoA{flintstones}[0] = "Fred";
# another element
$HoA{simpsons}[1] =~ s/(\w)/\u$1/;
# print the whole thing
print "\n";
foreach $family ( keys %HoA ) {
print "$family: @{ $HoA{$family} }\n"
}
想請問紅色部分的意思 perl 可以令變數=regular expression嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.32.180.150
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Perl/M.1464787544.A.04B.html
※ 編輯: gecer (114.32.180.150), 06/01/2016 21:26:10
※ 編輯: gecer (114.32.180.150), 06/01/2016 21:26:42
※ 編輯: gecer (114.32.180.150), 06/01/2016 21:27:31
1F:推 MistQ: zz=~s/xx/yy/ 是把變數zz內容符合xx的部分取代成yy 06/01 21:46