file - Check how many "," in each line in Perl -
this question has answer here:
i have check how many times "," in each line in file. have idea how can in perl?
on moment code looks it:
open($list, "<", $student_list) while ($linelist = <$list>) { printf("$linelist"); } close($list)
but have no idea how check how many times "," in each $linelist :/
use transliteration operator in counting mode:
my $commas = $linelist =~ y/,//;
Comments
Post a Comment