Net::Telnet help 
Author Message
 Net::Telnet help

Hi,

I am trying to capture the various console login prompts
of servers attached to Terminal servers.  According to the
man pages if you use an array context the pre-match and
match are returned.

I tried this approach to no avail. Can anybody please help?

I am using perl5.004 on Solaris2.5.1.

$matchop = '/[pP]assword: $/';
  ($prematch,$match) = $remote->waitfor("$matchop")|| die
$remote->errmsg;
  print "waitfor Password = $ok\n"if $debug;
  print "prematch = $prematch\nmatch=$match\n" if $debug;

this is the output:

waitfor Password = 1
prematch = 1
match=
login = 1

Thanks in advance.

--
Ian



Tue, 19 Sep 2000 03:00:00 GMT  
 Net::Telnet help

Quote:

> According to the man pages if you use an array context the pre-match
> and match are returned.

> I tried this approach to no avail. Can anybody please help?

> I am using perl5.004 on Solaris2.5.1.

> $matchop = '/[pP]assword: $/';
>   ($prematch,$match) = $remote->waitfor("$matchop")|| die

Oops, you've got a precedence problem there.  The || has a higher
precedence than =

Try changing || to or

   ($prematch,$match) = $remote->waitfor("$matchop") or die
                                                     ^^
--
Jay Rogers



Tue, 19 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Net::Telnet help

2. net::telnet - help - newbie

3. Net::Telnet help please

4. Net::Telnet help please

5. Net::Telnet help with multiple hosts

6. Net::Telnet-ing problem to Solaris telnet server

7. Net::Telnet 3.03: drain a telnet buffer

8. Telnet-Client with Net::Telnet

9. Telnet cmd, Net::Telnet

10. keeping Telnet alive with Net::Telnet

11. Net::Telnet -like module without telnet

12. Need help with Net::Telnet

 

 
Powered by phpBB® Forum Software