Daily Archives: 2012年7月2日

post by yamamoto | | 0 | 1,140 views

Perl メモ 配列要素のgrep

    my @found = grep ( /$patten/, @chapter);     print $#found+1, "\n";          foreach $found (@found) {         print $found,"\n";         if ($found=~/^(第)(.+?)(章)/){         #if ($found=~/(.*第)(.+?)(章.*)/){             my $ch = $2;             print {ch}."\n";             print $found,"\n";                     }         print $found,"\n";      }