How would you create a variable that could be read. It would read from a specific file if it exists, otherwise it would read from standard input. Sort of:
input = File.open("file.txt") || in
This does not work, but I think it needs to be done quite often, but I cannot find a good way to do this.
source
share