DMS Nortel switch - getting all data

N

Nex_s

Hi All,

I'm having trouble finding the end of a file. I'm working with a
Nortel DMS switch. Once I've logged in I have to wait to retrieve the
contents of the buffer. Ever 5 minutes the switch kicks the data out.
I'm using the following command to store the buffer contents into a
variable but it only graps the first few lines of the buffer.

my @datastream = $telnet->waitfor('/\>$/i');
@bufferdata = "@bufferdata @datastream";

On the switch the last character is a ">" and that character only shows
up at the end of the buffer data. The problem is when perl retrieves
the contents of the buffer, every line contains a ">". Is there not
some way to otherwise determine when all the data has been retrieved?
I tried "sleep 10" but that doesn't work either.

Any help would be appreicated.

Chris
 
J

John W. Krahn

Nex_s said:
I'm having trouble finding the end of a file. I'm working with a
Nortel DMS switch. Once I've logged in I have to wait to retrieve the
contents of the buffer. Ever 5 minutes the switch kicks the data out.
I'm using the following command to store the buffer contents into a
variable but it only graps the first few lines of the buffer.

my @datastream = $telnet->waitfor('/\>$/i');

The '>' character is not special in a regular expression so there is no
need to backslash it and there are no alphabetic characters in the
pattern so there is nothing for the /i option to affect.

@bufferdata = "@bufferdata @datastream";

Why are you using an array to store scalar data, why not just use a scalar?

$bufferdata .= " @datastream";

On the switch the last character is a ">" and that character only shows
up at the end of the buffer data. The problem is when perl retrieves
the contents of the buffer, every line contains a ">". Is there not
some way to otherwise determine when all the data has been retrieved?
I tried "sleep 10" but that doesn't work either.

Any help would be appreicated.

Perhaps there is whitespace after the '>' prompt? Maybe something like
this will work:

my @datastream = $telnet->waitfor( '/>\s*$/' );


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top