#!/users/scs/GNU/bin/perl -w

use strict;

sub main {

    exit 0 unless (defined($ARGV[0]) && defined($ARGV[1]));
    my $file = "";
    my $line;
    open(MAIL, "$ARGV[0] < $ARGV[1] |") or exit 0;
    while ($line = <MAIL>) {

        $file .= $line;
    }
    close(MAIL);
    sleep(1);
    open(MAIL, ">$ARGV[1]") or exit 0;
    print MAIL $file;
}

main;
