I fixed the problem by multiplying the number of input files by 60 and using this as my timeout value... The script below now works:
use strict; use Net::Telnet; use Net::FTP; use Time::Local; my $name = 'USER'; my $passwd = 'PASSWORD'; my $host = 'HOST'; my $prompt = '/MACHINENAME\$/'; my($sdate,$edate,$outfile) = @ARGV; $outfile = uc($outfile); #VMS puts files in uppercase my $command = 'some command'; # Assume each file in a specified date range will take 60 # seconds to process. Multiply # this by 60 to get the timeout value. Large, but we don't # have to deal with timeout problems #Work out how many days in specified range: my($sday,$smon,$syear) = split('-',$sdate); my($eday,$emon,$eyear) = split('-',$edate); my $time1 = timelocal(0,0,0,$sday,$smon,$syear); my $time2 = timelocal(59,59,23,$eday,$emon,$eyear); my $difference = $time2 - $time1; my $days = sprintf("%3.0f", $difference / (60*60*24) ); my $timeout = $days * 60; my $telnet = Net::Telnet->new( Prompt => "/$prompt/", Input_Log => 'input.log', Output_Log => 'output.log', Host => $host, Timeout => $timeout ); $telnet->login(Name => $name, Password => $passwd, Prompt => "/$prompt/", ); $telnet->cmd($command); $telnet->print("lo"); $telnet->close; my $ftp = Net::FTP->new("$host", Debug => 1); $ftp->login($name,$passwd); $ftp->get("$outfile.CSV"); $ftp->delete("$outfile.CSV"); $ftp->quit; exit;

In reply to Re: Re: Re: Re: Unix - VMS and Net::Telnet by Anonymous Monk
in thread Unix - VMS and Net::Telnet by maderman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.