I need to write a perl script that can be run from the command line, and will count the number of times a word appears in a text file (this word doesn't need to be a variable it can just be hard coded into the program) and then print on the screen how many times the word was found in the text file. i want it to be command-line capable so like if im in unix i could just type
perl filename.txt
and it would output a number. right now i need it to count the word "then."
can anyone help me with this? please note, this is not homework lol. i just don't understand some of the examples in my "learning perl" book (ie 'the llama book').
perl filename.txt
and it would output a number. right now i need it to count the word "then."
can anyone help me with this? please note, this is not homework lol. i just don't understand some of the examples in my "learning perl" book (ie 'the llama book').