in reply to Re: Re: Dumping data
in thread Dumping data

You can open a file for output and print to that outfile.

open (MYOUTFILE, ">outfile.txt") or die "Can't create outfile: $!"; # Other code print MYOUTFILE "$A,$B,n/a\n" if $i==0; print STDOUT "$A,$B,n/a\n" if $i==0; # Other code close MYOUTFILE;

or

if ($i==0){ print MYOUTFILE "$A,$B,n/a\n"; print STDOUT "$A,$B,n/a\n"; }

There are variations on this and you can include screen output, append to files, and more. Your best bet is to read up on filehandles and open and print.

Resources

Update: Closed off some tags that messed up the code and picked up some dropped end tags.

"No matter where you go, there you are." BB