Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

automating password entry for masked password field

by pissedasanewt (Initiate)
on Oct 02, 2010 at 21:18 UTC ( #863111=perlquestion: print w/ replies, xml ) Need Help??
pissedasanewt has asked for the wisdom of the Perl Monks concerning the following question:

Hi I'm trying to interact with an application that configures and application. My script creates two pipes for communication between the Perl script and the external program, then forks and execs the external program with the pipes attached to STDIN/STDOUT.

See: http://www.cpan.org/scripts/process-handling/STDIN.STDOUT.connection.pipe.

However, at one point i'm asked for a user name and password.

while(<STDIN>) { chomp; if ($_ ne "") { print TERMINAL "$_\n"; # print the contents of the screen if ($_ =~ /Username:/) { print STDOUT "$username\r"; } elsif ($_ =~ /Password:/) { print STDOUT "$password\r"; } }

However, although there is definitely a value for $password. The application thinks i've entered nothing. Its masked with asterix's (*****) when I enter the password manually. Is there another way I can enter the password?

Thanks,
John.

Comment on automating password entry for masked password field
Download Code
Re: automating password entry for masked password field
by eyepopslikeamosquito (Canon) on Oct 03, 2010 at 04:02 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://863111]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-09-23 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (219 votes), past polls