I have a process which runs and when it finds a trigger file, then logs 
on via ftp. The logon is tied to the month and changes accordingly. When there 
is a month switchover of late this process is failing.

        The call for the logon:

        # call to logon process for ftp
        return 0 if ( ! proc_step2() );

        if the password is correct on the first pass everything works as it 
should. If it does not then it will on the second pass within while (1) 
succeed, but will in essence fail on the return to  if ( ! proc_step2() ) 
above. I know I am missing some very simple thing. Overall it works great, but 
has been failing on the month switchover. I removed some lines in the middle of 
code which are not needed for what is happening, but deals with how I process 
passwords and retries.

        Any ideas would be greatly appreciated.

        Thanks.
Wags ;)
####################################################################

proc_step2:
sub proc_step2 {

    print_sub_hdr(0);

    if ( $GlblInfo{debug} ) {
       $MyFtp = Net::FTP->new($GlblInfo{ipaddr}, Debug => 1);
     }else {
       $MyFtp = Net::FTP->new($GlblInfo{ipaddr});
     }
    my $MyWrkPw = q{};
    my @MLT = ();
    my $MyLogonTime = [EMAIL PROTECTED];
    get_time( $MyLogonTime );
    my $MyPointInTime = $MyLogonTime->[10];

    my $MyCnt = 0;
    my $MyMax = 2;

    while ( 1 ) {
        get_time( $MyLogonTime , $MyPointInTime);
        $MyWrkPw = $GlblInfo{pwa};
          #
          # some code goes here, but not needed for why it is failing.
          #
        $MyFtp->login($GlblInfo{logona},$MyWrkPw);
        if ( ! $MyFtp->ok() and
               $GlblInfo{logona} =~ /prlusr/
            ) {
            my $MyMsg  = $MyFtp->message() ;
            my $MyCode = $MyFtp->code();
            printf "MyCode/MyMsg: %s/%s\n",
                                    $MyCode,
                                    $MyMsg;
            if ( ++$MyCnt > $MyMax or
                $GlblInfo{logona} !~ /prlusr/
                ) {
                mailerr6( -1, 9, $MyCode . '/' . $MyMsg, 0 );
                $GlblInfo{getout} = 1;
                $GlblInfo{continues} = 0;
                return 0;
             }
            my $MyTimeDiff = ($MyLogonTime->[3]+2) * 86_400;
            $MyPointInTime -= $MyTimeDiff;
            next;
         }
        last;
     }
    return 1;
    print_sub_hdr(1);

 }  #end of proc_step2



*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to