Re: loop does select next line

2014-07-05 Thread Kent Fredric
On 6 July 2014 02:31, Sunita Pradhan wrote: > I have a set of code for count number of lines and number of words . > > #!/usr/bin/perl > > while ($line = ){ > chomp ($line); > $hash{L_c_start}++ if ($line =~ /^C.*/i); > @words = split /\s+/,$line; > *foreach $c (k

loop does select next line

2014-07-05 Thread Sunita Pradhan
I have a set of code for count number of lines and number of words . #!/usr/bin/perl while ($line = ){ chomp ($line); $hash{L_c_start}++ if ($line =~ /^C.*/i); @words = split /\s+/,$line; foreach $c (keys @words){ print "word $words[$c]\n";