my $fh = File::Temp->new(); $fh->autoflush(1); foreach my $cmd (@_) { print "$cmd\n"; print $fh "$cmd\n"; } system "dir $fh"; #### C:>brocade.pl supportsave -n -h 10.250.17.140 -d /incoming/50798070 -l ftp exit Volume in drive C has no label. Volume Serial Number is 32B6-C79A Directory of C:\DOCUME~1\dentos\LOCALS~1\Temp 11/30/2012 05:16 PM 0 vfmhcyNzQN 1 File(s) 0 bytes 0 Dir(s) 783,720,448 bytes free