I put the file inside the script to keep everything together. Another way of doing this would be to place the data at the end of the script after a __END__ or __DATA__ tag and read the DATA filehandle that the interpreter opens for you. However, I wanted to show you how to use the three-argument form of open which is considered best practice these days. Just substitute your variable containing your file to be read for the \ <<EOD ...
I just put the line numbers in the data to show that the script was giving the "right" answers. Having them there did not affect how the script ran.
Put something like my ( $file, @phrases ) = @ARGV; at the top of your script so that you don't have to worry how many phrases are being sought.
If you are calling your script from the command line with a file and a series of phrases then I imagine you will enclose each phrase in single-quotes. To avoid the problem where the phrase might contain regex metacharacters change the line compiling the regex to my $rxPhrase = qr{\Q$phrase\E};
I'm not sure how you arrive at an answer of 45; did you mean to say $c = "total cpu sold:"?