DMS Nortel switch - getting all data

Discussion in 'Perl Misc' started by Nex_s, Jul 29, 2005.

  1. Nex_s

    Nex_s Guest

    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
     
    Nex_s, Jul 29, 2005
    #1
    1. Advertising

  2. Nex_s wrote:
    >
    > 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
    --
    use Perl;
    program
    fulfillment
     
    John W. Krahn, Jul 29, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chad
    Replies:
    7
    Views:
    335
    Boltar
    Jan 5, 2007
  2. visionset

    DMS with templating and java api

    visionset, Oct 20, 2008, in forum: Java
    Replies:
    0
    Views:
    357
    visionset
    Oct 20, 2008
  3. Hicham Mouline
    Replies:
    11
    Views:
    597
    Tim Hockin
    Aug 9, 2009
  4. Jim
    Replies:
    0
    Views:
    161
  5. Switch Within A Switch

    , Apr 22, 2006, in forum: Javascript
    Replies:
    7
    Views:
    128
    Lasse Reichstein Nielsen
    Apr 22, 2006
Loading...

Share This Page