#!/usr/bin/perl # just make up a fake file here to create # and echo the filename of /tmp/foo $tabfile = "./tabfile"; $logfile = "/tmp/foo"; # send output to file @args2 = ("$tabfile"); open (STDOUT, ">$logfile") || die "could not open log\n"; unless (system(@args2) == 0) { print STDERR "system(@args2) failed: $? $!\n"; return; } close(STDOUT); print "foo1\n";