in reply to help with the diamond operator
The second method (while(1) {) translates roughly to "read and print <$foo> forever". Unfortunately, once you're finished reading the file the while statement doesn't terminate. That's why the program hangs.
|
|---|