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

Popular posts from this blog

c# - ItextSharp font color issue in ver 5.5.4+ -

jquery - Multiple issues with pushstate: history, loading, calling functions -

ios - retrievePeripherals deprecated in IOS7 how to substitude it with retrievePeripheralsWithIdentifiers -