gargle has asked for the wisdom of the Perl Monks concerning the following question:
Now this is weird! I have the following code:
When I run this on stdout, I get this:[gargle@vlds204 reporting]$ cat ./test.pl #!/usr/bin/perl use Modern::Perl; use Term::Prompt; my $mypass = prompt( 'x', "password:", '', '' ); say "alfa"; say "beta";
When I pipe into a text file (or use redirection) I get this:[gargle@vlds204 reporting]$ ./test.pl password: x alfa beta
I'm on perl v5.16.1, Term::Prompt is at 1.04, Modern::Perl is at 1.20120521. I'm not experiencing this behaviour on cygwin, on perl v5.14.2, Term::Prompt 1.04 and Modern::Perl 1.03. Can someone confirm this? What's going on?[gargle@vlds204 reporting]$ ./test.pl | tee test.txt x password: alfabeta[gargle@vlds204 reporting]$
--
if ( 1 ) { $postman->ring() for (1..2); }
if ( 1 ) { $postman->ring() for (1..2); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Weird Term::Prompt behaviour
by Anonymous Monk on Sep 17, 2012 at 19:06 UTC | |
by gargle (Chaplain) on Sep 20, 2012 at 12:01 UTC | |
by gargle (Chaplain) on Sep 18, 2012 at 12:45 UTC | |
by Anonymous Monk on Sep 20, 2012 at 07:34 UTC |
Back to
Seekers of Perl Wisdom