Perl Shell - A Solution
$prompt = '' if @ARGV || ! -t;
If we discover that the input is not interactive, we simply set the prompt to null.
From the lines above, we know that if anything is in
, it is a script file that was passed to
means "or" and
is true the input is from a terminal and false if input is redirected from somewhere else (eg, a file or a pipe).