<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: perl Net::Telnet problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724472#M63897</link>
    <description>1. Neither : nor $ should be escaped inside a character class inside a regular expression, so just drop the 2. If the login procedure waits for user input during the logon (like when asking for a terminal type in ttytype), the whole system times out&lt;BR /&gt;&lt;BR /&gt;Use the "Dump_Log", "Input_log", and "Output_log" options (note the capital L in Dump_Log, I don't know why they used that inconsistently either) and check where the timeout happens (first browse the dump_log output.&lt;BR /&gt;&lt;BR /&gt;Here is something I tried to get around the question:&lt;BR /&gt;&lt;BR /&gt;use Net::Telnet;&lt;BR /&gt;&lt;BR /&gt;my $host = Net::Telnet-&amp;gt;new (&lt;BR /&gt;    Timeout    =&amp;gt; 10,&lt;BR /&gt;    Host       =&amp;gt; $hostname,&lt;BR /&gt;    Dump_Log   =&amp;gt; "xx.dmp",&lt;BR /&gt;    Input_log  =&amp;gt; "xx.inp",&lt;BR /&gt;    Output_log =&amp;gt; "xx.out",&lt;BR /&gt;    Prompt     =&amp;gt; '/xterm..../'); # My tcsh asks for Term and shows xterm as default with 5 trailing backspaces&lt;BR /&gt;$host-&amp;gt;login ($username, $passwd);&lt;BR /&gt;$host-&amp;gt;prompt ('/\s&amp;gt;\s*$/');&lt;BR /&gt;$host-&amp;gt;cmd ("dumb");&lt;BR /&gt;print $host-&amp;gt;cmd ("ls /tmp"), "\n";</description>
    <pubDate>Wed, 15 May 2002 14:42:40 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2002-05-15T14:42:40Z</dc:date>
    <item>
      <title>perl Net::Telnet problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724465#M63890</link>
      <description>I am having a hard time with the login phase of a perl scripted telnet session.&lt;BR /&gt;&lt;BR /&gt;I have to be over looking something but for the life of me I don't know what it is. Here is the code:&lt;BR /&gt;&lt;BR /&gt;my ($block, $filename, $host, $hostname, $k_per_sec, $line, $num_read,&lt;BR /&gt; $passwd, $prevblock, $prompt, $size_bsd, $size_sysv, $start_time, &lt;BR /&gt; $total_time, $username) ;&lt;BR /&gt;&lt;BR /&gt;$hostname = "piglet";&lt;BR /&gt;$username = "blah";&lt;BR /&gt;$passwd = "blah1";&lt;BR /&gt;$filename = "topfile";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;use Net::Telnet ();&lt;BR /&gt;&lt;BR /&gt;$host = new Net::Telnet ( Timeout =&amp;gt; 10,&lt;BR /&gt;  Prompt =&amp;gt; '/[\:$%#&amp;gt;] $/'),&lt;BR /&gt;$host-&amp;gt;open($hostname);&lt;BR /&gt;$host-&amp;gt;login($username, $passwd) ;&lt;BR /&gt;&lt;BR /&gt;At this point the error message is:&lt;BR /&gt;&lt;BR /&gt;"timed out waiting for command prompt at filename line 22 "&lt;BR /&gt;&lt;BR /&gt;The code for the prompt should cover any prompt but I am using the "$" intentionally.&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;Gerald&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 12:28:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724465#M63890</guid>
      <dc:creator>Gerald Bush_2</dc:creator>
      <dc:date>2002-05-15T12:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: perl Net::Telnet problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724466#M63891</link>
      <description>&lt;BR /&gt;Is this a TYPO??&lt;BR /&gt;&lt;BR /&gt;$host = new Net::Telnet ( Timeout =&amp;gt; 10, &lt;BR /&gt;Prompt =&amp;gt; '/[\:$%#&amp;gt;] $/'), &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;because it should end in a ";"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 15 May 2002 12:40:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724466#M63891</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-05-15T12:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: perl Net::Telnet problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724467#M63892</link>
      <description>It was not a typo. That was the example I used from the Net::Telnet cpan description. I added the "  Prompt =&amp;gt; '/[\:$%#&amp;gt;] $/'), "&lt;BR /&gt;from the perl cookbook from O'reilly.&lt;BR /&gt;&lt;BR /&gt;I changed the "," to a ";" and I get the same timeout.&lt;BR /&gt;&lt;BR /&gt;Gerald&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 12:45:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724467#M63892</guid>
      <dc:creator>Gerald Bush_2</dc:creator>
      <dc:date>2002-05-15T12:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: perl Net::Telnet problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724468#M63893</link>
      <description>Hi Gerald,&lt;BR /&gt;&lt;BR /&gt;Looks like your prompt is the problem.  The backslash should be the other side of the :, i.e.&lt;BR /&gt;&lt;BR /&gt;Prompt =&amp;gt; '/[:\$%#&amp;gt;] $/');&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Wed, 15 May 2002 13:09:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724468#M63893</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-05-15T13:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: perl Net::Telnet problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724469#M63894</link>
      <description>Hi Robin,&lt;BR /&gt;&lt;BR /&gt;Nice try but that isn't it. I actually added that to the prompt code I found in the Perl Cookbook. &lt;BR /&gt;&lt;BR /&gt;I moved it and same error. I removed it and same error. &lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Gerald</description>
      <pubDate>Wed, 15 May 2002 13:49:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724469#M63894</guid>
      <dc:creator>Gerald Bush_2</dc:creator>
      <dc:date>2002-05-15T13:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: perl Net::Telnet problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724470#M63895</link>
      <description>Hi Gerald,&lt;BR /&gt;&lt;BR /&gt;OK - if you telnet to piglet, what is the login prompt?  Here's what works for me, first the telnet output, then the first part of the script - as you can see , the : at the login prompt matches, and I get the ls /tmp output with no problems:&lt;BR /&gt;&lt;BR /&gt;ln4p2714-2 # telnet ln13p128&lt;BR /&gt;Trying...&lt;BR /&gt;Connected to ln13p128.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;Local flow control on&lt;BR /&gt;Telnet TERMINAL-SPEED option ON&lt;BR /&gt;   &lt;BR /&gt;login:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;==========================================&lt;BR /&gt;#!/opt/perl5/bin/perl&lt;BR /&gt;&lt;BR /&gt;my ($block, $filename, $host, $hostname, $k_per_sec, $line, $num_read,&lt;BR /&gt;$passwd, $prevblock, $prompt, $size_bsd, $size_sysv, $start_time,&lt;BR /&gt;$total_time, $username) ;&lt;BR /&gt;&lt;BR /&gt;$hostname = "ln13p128";&lt;BR /&gt;$username = "wakefir";&lt;BR /&gt;$passwd = "mypasswd";&lt;BR /&gt;$filename = "topfile";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;use Net::Telnet ();&lt;BR /&gt;&lt;BR /&gt;$host = new Net::Telnet ( Timeout =&amp;gt; 10,&lt;BR /&gt;Prompt =&amp;gt; '/[:\$%#&amp;gt;] $/');&lt;BR /&gt;$host-&amp;gt;open($hostname);&lt;BR /&gt;$host-&amp;gt;login($username, $passwd) ;&lt;BR /&gt;print $host-&amp;gt;cmd("ls /tmp"),"\n";&lt;BR /&gt;========================================&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 14:04:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724470#M63895</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-05-15T14:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: perl Net::Telnet problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724471#M63896</link>
      <description>Robin, after looking at it again I used your code in another file. I changed host and bang it worked like a champ! Many thanks. My only problem now is figuring out why this one account won't work.&lt;BR /&gt;&lt;BR /&gt;I have been beating my head against my desk on this since lunch yesterday. I am relatively new to perl and am simply trying to find perl solutions for my old scripts that used remsh and rcp as these are going away in our production environment. This answer just solved about 40% of my rewrites.&lt;BR /&gt;&lt;BR /&gt;Gerald</description>
      <pubDate>Wed, 15 May 2002 14:20:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724471#M63896</guid>
      <dc:creator>Gerald Bush_2</dc:creator>
      <dc:date>2002-05-15T14:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: perl Net::Telnet problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724472#M63897</link>
      <description>1. Neither : nor $ should be escaped inside a character class inside a regular expression, so just drop the 2. If the login procedure waits for user input during the logon (like when asking for a terminal type in ttytype), the whole system times out&lt;BR /&gt;&lt;BR /&gt;Use the "Dump_Log", "Input_log", and "Output_log" options (note the capital L in Dump_Log, I don't know why they used that inconsistently either) and check where the timeout happens (first browse the dump_log output.&lt;BR /&gt;&lt;BR /&gt;Here is something I tried to get around the question:&lt;BR /&gt;&lt;BR /&gt;use Net::Telnet;&lt;BR /&gt;&lt;BR /&gt;my $host = Net::Telnet-&amp;gt;new (&lt;BR /&gt;    Timeout    =&amp;gt; 10,&lt;BR /&gt;    Host       =&amp;gt; $hostname,&lt;BR /&gt;    Dump_Log   =&amp;gt; "xx.dmp",&lt;BR /&gt;    Input_log  =&amp;gt; "xx.inp",&lt;BR /&gt;    Output_log =&amp;gt; "xx.out",&lt;BR /&gt;    Prompt     =&amp;gt; '/xterm..../'); # My tcsh asks for Term and shows xterm as default with 5 trailing backspaces&lt;BR /&gt;$host-&amp;gt;login ($username, $passwd);&lt;BR /&gt;$host-&amp;gt;prompt ('/\s&amp;gt;\s*$/');&lt;BR /&gt;$host-&amp;gt;cmd ("dumb");&lt;BR /&gt;print $host-&amp;gt;cmd ("ls /tmp"), "\n";</description>
      <pubDate>Wed, 15 May 2002 14:42:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-net-telnet-problem/m-p/2724472#M63897</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-05-15T14:42:40Z</dc:date>
    </item>
  </channel>
</rss>

