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

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -