in reply to Re^3: Perl Help
in thread Perl Help
open (READFILE, "<readme.txt") || die "Couldn't open file: $!"; $buffer = ""; while(<READFILE>) { #print $_; $commas++ while ($_ =~ m/,/g); $fullstops++ while ($_ =~ m/\./g); $openbracket++ while ($_ =~ m/\[/g); $closedbracket++ while ($_ =~ m/\]/g); $hyphens++ while ($_ =~ m/-/g); } print ("$commas commas\n"); print ("$fullstops full stops\n"); print ("$openbracket open brackets\n"); print ("$closedbracket closed brackets\n"); print ("$hyphens hyphens\n");
|
|---|