作者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/cn.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