Quantcast
Channel: OKWAVE 最新質問([技術者向] コンピューター/205)【本日】
Viewing all articles
Browse latest Browse all 38062

パターンマッチにおける「-」の扱い

$
0
0
例えば以下のように記載するとエラーとなります。 if($::FORM{'body'} =~ /パターン/){ push(@error, '投稿できません'); } しかし、以下のように記載するときちんとパターンマッチします。 このふたつともエラーが出ておかしくないと思うのですが なぜ以下ならOKなのか教えてください!! @word=qw(パターン); foreach (@word) { if (index($::FORM{'body'},$_) >= 0) { push(@error, '投稿できません。'); } }

Viewing all articles
Browse latest Browse all 38062

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>