A challenge was posted on a forum I frequent, and
when trying to golf down my solution I came across
something of a conundrom.
The challenge is simple:
Take a filename and a word on the commandline
or stdin and print the number of occurences the word
has in the file.
Now, I don't want to use open()
En op 24 augustus 2003 sprak Tor Hildrum:
> Well, my final solution, that isn't really a solution was:
> -0ne '@a=/WORD/g;print [EMAIL PROTECTED]'
>
> Now, this isn't really a solution because it has the WORD
> hardcoded. But, how would I be able to get the WORD
> when using -n? I'm guessing this