develooper Front page | perl.beginners | Postings from January 2002

REGEXP Help on Linux

Thread Next
From:
Daryl J. Hoyt
Date:
January 4, 2002 14:08
Subject:
REGEXP Help on Linux
Message ID:
NEBBJLDJCJIGAJNJNLNMOEKFCMAA.daryl.hoyt@geodesic.com
Hi,
    I am trying to use the net::telnet module, and I keep timing out.  I
believe it is because I do not have the right prompt.  My prompt looks like
[sqa1@duke:~]$.  I do not know why this doesn't work: Prompt =>
'/\[$::username\@$::machine\]\$$/'.  Any help you can give me would be
greatly appreciated.


Thanks,

Daryl J. Hoyt




#!/usr/local/bin/perl -w
use strict;

use Net::Telnet ();

$::command = "p4 sync -f \$HOME/p4/eng/sqa/tools/...";
$::username = "sqa1";
$::passwd = "***";
$::machine = "sparky";

$::t = new Net::Telnet (Timeout => 30, Prompt =>
'/\[$::username\@$::machine\]\$$/');
$::t->open($::machine);
$::t->login($::username, $::passwd);
#@::lines = $::t->cmd("p4 sync -f
//info.geodesic.com/eng/pe/tools/bin/...");
$::t->cmd($::command);
@::lines = $::t->cmd($::command);

print "<@::lines>\n";
print "\n";


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About