Connecting Tech Pros Worldwide Forums | Help | Site Map

simulate pressing the enter key using perl

Member
 
Join Date: Nov 2006
Location: USA
Posts: 126
#1: Apr 3 '07
Hi I am try to create a script to login EMS admin tool *JMS*
Now the admin account has a blank password.

so if i login normal

Expand|Select|Wrap|Line Numbers
  1. usually i type this:  i press enter
  2. username(ADMIN) prompt - i press enter
  3. password - i press enter
then i am int he system , so basically i press enter twice at the prompts* default admin acct this is what i am using*

Now the script - according to the doc
Expand|Select|Wrap|Line Numbers
  1. connect  connect 10.0.0.1:123456 -username admin -password 
the password is blank but it requires an argument when i run it from perl.

I tried it this way:
Expand|Select|Wrap|Line Numbers
  1. connect  connect 10.0.0.1:123456 -username admin
It still prompts for password i could press enter here but for the script to be useful it has to login on its own. It does not allow "" or any kind of characters to represent a balank password.

So please help is there way to fix this or is there a way to simulate a press of the enter key.

KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,091
#2: Apr 3 '07

re: simulate pressing the enter key using perl


I believe the Term::ReadKey module is used for that purpose. I've never used it myslef but maybe the documentation will be helpful.
Member
 
Join Date: Nov 2006
Location: USA
Posts: 126
#3: Apr 4 '07

re: simulate pressing the enter key using perl


thank you Kevin I will try that.
Reply