Net::telnet and R arrow

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default Net::telnet and R arrow

    Im retrieving information from our telnet server , which it displays a
    page at a time . The on -screen prompt is "press L or R arrow for
    more"

    [url]http://www.cl.cam.ac.uk/~mgk25/ucs/wgl4.txt[/url] says R arrow is 2192
    [url]http://perldoc.perl.org/perlreref.html[/url]

    do {$text=$t->get;
    #print "$text";
    $names.=$text;}
    until ($text=~m/duplicates/);
    (duplicates is the last ASCII that appears on the screen )

    and ive tried

    $t->put(\x{2192}); (or print(\x{2192})

    which gives an error
    "Can't call method "x" without a package or object reference"

    How can i send a R or L arrow ?
    OS=gentoolinux
    perl 5.8.6-r6

    pdc124 Guest

  2. Similar Questions and Discussions

    1. How do you telnet from 1 host to another using Telnet Module
      Hello, I need to know how you telnet from one host to another using the net::telnet module. I can telnet to a single host OK but I need to then...
    2. net::telnet to ms telnet server
      i need to connect to a microsoft telnet server via net::telnet (and io::pty). i can connect and communicate successfully via the telnet command in...
    3. Net::Telnet problem with MS Telnet Service
      Hello, After reading the Net::Telnet documentation, examples, searching the 'Net, etc., I still do not completely understand the problem of...
    4. How to add an Arrow ?
      How to add an "arrow" by using the Line Tool ? InDesign CS Windows Thanks Henrik
    5. Help with left arrow down & right arrow down
      Hi all, I am creating a presentation in Director MX, and need to program the right arrow key to advance to next marker, and the left arrow key to...
  3. #2

    Default Re: Net::telnet and R arrow

    "pdc124" <pdc124@yahoo.co.uk> writes:
    > $t->put(\x{2192}); (or print(\x{2192})
    >
    > which gives an error
    > "Can't call method "x" without a package or object reference"
    The \x syntax for hexadecimal character codes works only in
    quoted strings. So you could have print("\x{2192}").

    However, U+2192 is a printable character and not easy to type on
    common keyboard layouts. It is therefore likely that your telnet
    server is not expecting that character but rather an escape
    sequence like "\e[C" or "\e[D". See Standard ECMA-48.

    I don't know if you need to negotiate some Telnet options before
    sending these.
    Kalle Olavi Niemitalo Guest

  4. #3

    Default Re: Net::telnet and R arrow

    thanks ive read all 108 pages of
    Standard ECMA-48 (Fifth Edition - June 1991 Reprinted June 1998)
    Control Functions for Coded Character Sets from
    [url]http://www.ecma-international.org/publications/standards/Ecma-048.htm[/url]

    and cant find a reference to right and left arrows .
    Am I looking in the wrong place ?

    pdc124 Guest

  5. #4

    Default Re: Net::telnet and R arrow

    update :
    [url]http://www.linux.cz/lists/archive/linux/82763.html[/url] seems to indicate
    that the sequence you posted is what i I should be sending to the
    server

    $t->put(e\[D);
    is
    Unquoted string "e" may clash with future reserved word at
    /usr/local/bin/telnet.pl line 54.Backslash found where operator
    expected at /usr/local/bin/telnet.pl line 54, near "e\"

    $t->put("e\[D");
    Use of uninitialized value in regexp compilation

    $t->put("\e\[D"); (trying to escape it )
    Use of uninitialized value in regexp compilation at
    /usr/local/bin/telnet.pl line 55.
    sorry to be soe dumb .

    pdc124 Guest

  6. #5

    Default Re: Net::telnet and R arrow

    pdc124 wrote:
    > $t->put("e\[D");
    1) ITYM "\e[D"
    > Use of uninitialized value in regexp compilation
    2) I suspect this warning is being thrown by some other portion of your
    code. the line above would not trigger such a warning.

    3) to send a "right" I would do the following:

    use charnames qw{ :full };

    # and later...
    $t->put(\N{RIGHTWARDS ARROW});

    -jp

    DJ Stunks Guest

  7. #6

    Default Re: Net::telnet and R arrow

    DJ Stunks wrote:
    > pdc124 wrote:
    > > $t->put("e\[D");
    >
    > 1) ITYM "\e[D"
    >
    > > Use of uninitialized value in regexp compilation
    >
    > 2) I suspect this warning is being thrown by some other portion of your
    > code. the line above would not trigger such a warning.
    >
    > 3) to send a "right" I would do the following:
    >
    > use charnames qw{ :full };
    >
    > # and later...
    > $t->put(\N{RIGHTWARDS ARROW});
    oops.

    make that: $t->put("\N{RIGHTWARDS ARROW}");

    muh bad.

    -jp

    DJ Stunks Guest

  8. #7

    Default Re: Net::telnet and R arrow

    "I suspect this warning is being thrown by some other portion of your
    code. the line above would not trigger such a warning. ". Correct -
    sorry to be so hopeless at this.


    with this in

    $t->put("\N{RIGHTWARDS ARROW}");
    i get this error message

    Wide character in print at /usr/lib/perl5/5.8.6/i686-linux/IO/Handle.pm
    line 399.
    Wide character in syswrite at
    /usr/lib/perl5/site_perl/5.8.6/Net/Telnet.pm line 3010.

    pdc124 Guest

  9. #8

    Default Re: Net::telnet and R arrow

    pdc124 wrote:
    > "I suspect this warning is being thrown by some other portion of your
    > code. the line above would not trigger such a warning. ". Correct -
    > sorry to be so hopeless at this.
    >
    >
    > with this in
    >
    > $t->put("\N{RIGHTWARDS ARROW}");
    > i get this error message
    >
    > Wide character in print at /usr/lib/perl5/5.8.6/i686-linux/IO/Handle.pm
    > line 399.
    > Wide character in syswrite at
    > /usr/lib/perl5/site_perl/5.8.6/Net/Telnet.pm line 3010.
    well, those are only warnings, did it actually work?

    if not, (re-reading this thread -- which I should have done before
    posting at all), Kalle may be right and you may be back to trying to
    send your "\e[D" virtualkey.

    -jp

    DJ Stunks Guest

  10. #9

    Default Re: Net::telnet and R arrow

    "pdc124" <pdc124@yahoo.co.uk> writes:
    > thanks ive read all 108 pages of
    > Standard ECMA-48 (Fifth Edition - June 1991 Reprinted June 1998)
    > Control Functions for Coded Character Sets from
    > [url]http://www.ecma-international.org/publications/standards/Ecma-048.htm[/url]
    >
    > and cant find a reference to right and left arrows .
    They are in clauses 8.3.20 (CUF - CURSOR RIGHT) and 8.3.18 (CUB -
    CURSOR LEFT).

    ECMA-48 is mostly phrased in terms of what a terminal should do
    when it _receives_ control sequences, for example from a Telnet
    server. However, terminals can also _send_ these sequences when
    the user presses keys. Clauses 8.3.52 (FNK - FUNCTION KEY) and
    8.3.68 (INT - INTERRUPT) make this particularly clear.
    Kalle Olavi Niemitalo Guest

  11. #10

    Default Re: Net::telnet and R arrow

    doesnt retrieve the next 'page' of information
    ie
    ###SEND r ARROW
    $matchtext='duplicates';
    #$t->put("\e\[D");
    $t->put("\N{RIGHTWARDS ARROW}"); #same for $t->print
    do {$text=$t->get;
    print "$text";
    $names.=$text;}
    until ($text=~m/$matchtext/);

    produces
    Wide character in print at /usr/lib/perl5/5.8.6/i686-linux/IO/Handle.pm
    line 399.
    Wide character in syswrite at
    /usr/lib/perl5/site_perl/5.8.6/Net/Telnet.pm line 3010.
    as output

    /tmp/inputlog contains the first 'page' of the stuff im trying to
    retrieve

    so how do I send the virtual key ?

    pdc124 Guest

  12. #11

    Default Re: Net::telnet and R arrow

    "pdc124" <pdc124@yahoo.co.uk> wrote in
    news:1141201698.979775.83190@u72g2000cwu.googlegro ups.com:
    > doesnt retrieve the next 'page' of information
    > ie
    > ###SEND r ARROW
    > $matchtext='duplicates';
    > #$t->put("\e\[D");
    > $t->put("\N{RIGHTWARDS ARROW}"); #same for $t->print
    > do {$text=$t->get;
    > print "$text";
    > $names.=$text;}
    > until ($text=~m/$matchtext/);
    >
    > produces
    > Wide character in print at /usr/lib/perl5/5.8.6/i686-
    linux/IO/Handle.pm
    > line 399.
    > Wide character in syswrite at
    > /usr/lib/perl5/site_perl/5.8.6/Net/Telnet.pm line 3010.
    > as output
    >
    > /tmp/inputlog contains the first 'page' of the stuff im trying to
    > retrieve
    >
    > so how do I send the virtual key ?
    You may be sending the key to the host, but then your end isn't
    responding the same way a terminal would to the application on the host
    end after that, so no second page. I found this out when writing an
    application that did user emulation. Looking at packet traces of a
    real user connected via telnet and using a VT-100 terminal emulator
    showed that the terminal side had to respond to some sequences that the
    host side was sending.
    That led me to use this:
    [url]http://search.cpan.org/~ajwood/Term-VT102-0.82/[/url]
    in conjunction with Net::Telnet to get the job done.

    ....Steve

    --
    Steve van der Burg
    Technical Analyst, Information Services
    London Health Sciences Centre
    London, Ontario, Canada
    Email: [email]steve.vanderburg@lhsc.on.ca[/email]
    Steve van der Burg Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139