Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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.


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?


Replies are listed 'Best First'.
Re: automating password entry for masked password field
by eyepopslikeamosquito (Chancellor) on Oct 03, 2010 at 04:02 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://863111]
Approved by planetscape
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2018-01-16 13:38 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (179 votes). Check out past polls.