Monday, February 24, 2014

Moving a File in PERL

        my $fileName = $self->{fileName};
        
        my $sentReceiptDirectory = "test/sentReceipts/";

        my $unsentReceiptDirectory = "test/unsentReceipts/";
        
        my $fileMoveSuccessful = 0;
        
        if ($sendEmailAddressReceipt eq 1)
        {
            
            
            move $fileName, $sentReceiptDirectory;
            
            $fileMoveSuccessful = 1;
            
        }
        elsif($sendEmailAddressReceipt eq 0)
        {
            move $fileName, $unsentReceiptDirectory;
        
            $fileMoveSuccessful = 1;

        }

No comments:

Post a Comment