print "foo1\n"; #### print "GOT THIS: $lines\n"; #### RESULT: $ ftp_flow.pl logfile = /tmp/ftp_flow.12547410117.log errfile = /tmp/ftp_flow.12547410117.err $ cat /tmp/ftp_flow.12547410117.log FTPData.20010517.120547 foo1 GOT THIS: FTPData.20010517.120547 $ #### # 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; } select(STDOUT); close(STDOUT); print "foo1\n"; # read the file to obtain the file tabdata created local(*LOGFILE); open (LOGFILE, $logfile) || die "Couldn't open: $!"; $lines=; #get line 1 from the file close(LOGFILE); print "GOT THIS: $lines\n"; exit(0);