Hello,
I realize that I can write a function to do this however I was wondering if there is an existing Perl function that will allow me to count the number of occurances of a particular string in a file. Currently I have the file opened I extract a string and then want to check in the remainder of the file to see if the string appears again. If it doesn't I want to do somethign with the string and then continue on with the next line and extract its string and so on. So ideally I don't want to have to open the file, extract the string, and then have to close it and open it again to check to see if the string appears more than once. I want to do it all in one step. If I open it twice I will lose my position in the file so that I won't be able to extract the next string. Any and all help is appreciated.
Thanks
I realize that I can write a function to do this however I was wondering if there is an existing Perl function that will allow me to count the number of occurances of a particular string in a file. Currently I have the file opened I extract a string and then want to check in the remainder of the file to see if the string appears again. If it doesn't I want to do somethign with the string and then continue on with the next line and extract its string and so on. So ideally I don't want to have to open the file, extract the string, and then have to close it and open it again to check to see if the string appears more than once. I want to do it all in one step. If I open it twice I will lose my position in the file so that I won't be able to extract the next string. Any and all help is appreciated.
Thanks