in reply to Re^2: A Tribute To The Monks Of Wisdom
in thread A Tribute To The Monks Of Wisdom
The diamond always works on the files in @ARGV. It also provides another level of magic, if @ARGV is empty, it reads STDIN. This is a very common idiom for writing filter programs.
Another useful trick is to realize that @ARGV starts out with the command line parameters, but it is just a variable. You can change it. (For example, remove some flags or commands and then process the rest, or use the parameters to construct a list of filenames that replaces @ARGV before processing.
The last trick is not one to be used lightly, because it's likely to confuse some people. But, sometimes it is exactly the tool you need.
|
|---|