I am if my question was brief.
$prompt is a scalar variable.
like this:
$sub = "xyz";
$prompt = "L:\\$sub";
my $t = Net::Telnet->new(
Timeout => 10,
Prompt => "/$prompt/"
);
Thanks & Regards,
Lakshmi
952-833-1220
-----Original Message-----
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 12, 2007 3:29 PM
To: [EMAIL PROTECTED]
Cc: Martin Barth; [email protected]
Subject: Re: Net::Telnet - Variable in Prompt
On 6/12/07, Lakshmi Sailaja <[EMAIL PROTECTED]> wrote:
> But it did not work. I was getting the below error:
> "timed-out waiting for command prompt at <file name> line <line
number>"
snip
This code works for me.
#!/usr/bin/perl
use strict;
use warnings;
use Net::Telnet;
#my propmt is /home/user>
my $prompt = '>$';
my $t = Net::Telnet->new(
Timeout => 10,
Prompt => "/$prompt/"
);
$t->open("widomaker.com");
$t->login("user", "pass");
my @lines = $t->cmd("who");
print @lines;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/