in reply to Re^2: Benchmark diamond operator
in thread Benchmark diamond operator
You need to understand what the diamond operator does:
That's pretty much it. I might be forgetting some subtleties.
The key bit, I've highlighted for you in bold. It uses @ARGV to figure out what file to read, and it alters that array!
So the first time you read a file using the diamond operator, you read it fine. The second time you try to read the file, the filename is no longer on @ARGV, so the diamond operator reads from STDIN instead.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Benchmark diamond operator
by thanos1983 (Parson) on May 10, 2017 at 08:50 UTC |