I am trying to print to the screen (STDOUT) after I write text to a file but it doesn't seem to work. The correct information is being written to my output file but if I want to display information on the screen it doesn't work. Here are snippets of my code:
#Read record from file
{
...
close (STDOUT);# close STDOUT in case it isn't closed yet.
open (STDOUT, '>-');
print "\n---------------------------------------------\n";
...
if ($SUCCESS eq "Y"
{
open (STDOUT, "+>>successful.log"
{
print "stuff is printed here\n";
}
close (STDOUT);
}
... #read next record from input file
#Read record from file
{
...
close (STDOUT);# close STDOUT in case it isn't closed yet.
open (STDOUT, '>-');
print "\n---------------------------------------------\n";
...
if ($SUCCESS eq "Y"
{
open (STDOUT, "+>>successful.log"
{
print "stuff is printed here\n";
}
close (STDOUT);
}
... #read next record from input file