Accept input from stdin or file