You can use -t STDIN to see if input is coming from a terminal and print your prompt if it is.
sub readprompt { my $prompt = shift; print $prompt if -t STDIN; <>; } while (my $i=readprompt(">>")) { print "You said: $i\n"; }
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
In reply to Re: Need help working with STDIN
by pfaut
in thread Need help working with STDIN
by Zio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |