Easy or even Possible? file I/O + user input

2003-08-24 Thread Tor Hildrum
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()

Re: Easy or even Possible? file I/O + user input

2003-08-24 Thread Eugene van der Pijll
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