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. Advertisements

  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. Advertisements

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. Thomas Scheiderich

    Not getting all data from Stored Procedure.

    Thomas Scheiderich, Jul 21, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    603
    Thomas Scheiderich
    Jul 24, 2004
  2. =?Utf-8?B?cG11ZA==?=
    Replies:
    2
    Views:
    1,163
    =?Utf-8?B?cG11ZA==?=
    Jan 10, 2005
  3. bienwell
    Replies:
    0
    Views:
    3,644
    bienwell
    Nov 17, 2005
  4. Chad
    Replies:
    7
    Views:
    451
    Boltar
    Jan 5, 2007
  5. visionset

    DMS with templating and java api

    visionset, Oct 20, 2008, in forum: Java
    Replies:
    0
    Views:
    438
    visionset
    Oct 20, 2008
  6. Hicham Mouline
    Replies:
    11
    Views:
    720
    Tim Hockin
    Aug 9, 2009
  7. Jim
    Replies:
    0
    Views:
    247
  8. Switch Within A Switch

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