#!usr/local/bin/perl print ("Enter filename to search to punctuation characters: "); $path=; print ("\n"); open(DATA, "<$path") || die "Couldn't open $path for reading: $!\n"; while () { while (s/([\041-\057]|[\72-\100]|[\133-\140]|[\173-\176])(.*)/$2/) { $char = $1; $wordHash{$char}++; } } while ( ($punctuation, $count) = each(%wordHash) ) { $wordArray[$i] = "$punctuation\t$count"; $i++; print ("$punctuation\t$count\n"); } #### ? 1 . 6 , 5 ( 10 ) 10 ; 21 $ 19 #### question mark 1 fullstop 6 comma 5 open bracket 10 close bracket 10 colon 21 dollar sign 19