L
lozbrown
Ok this is a very novice question but please help,
I have a subroutine that uses STDOUT:
---------------------------------code--------------------------------------------------
sub savefile {
my $content = get($_[0]);
print "saving file $_[0]";
#download the file
die "Couldn't get $_[0]" unless defined $content;
#Open same file for writing, reusing STDOUT
open (STDOUT, ">$_[1]") or die "Can't open $_[1]: $!\n";
binmode(STDOUT);
print "$content";
#Finish up
close STDOUT;
}
------------------------------End
code-----------------------------------------
but how do I send stdout back to the screen so i can use the print
command an it will appear on the screen.
currently after the subroutine has been called i get this error message
print() on closed filehandle STDOUT at C:\Docum...
I have a subroutine that uses STDOUT:
---------------------------------code--------------------------------------------------
sub savefile {
my $content = get($_[0]);
print "saving file $_[0]";
#download the file
die "Couldn't get $_[0]" unless defined $content;
#Open same file for writing, reusing STDOUT
open (STDOUT, ">$_[1]") or die "Can't open $_[1]: $!\n";
binmode(STDOUT);
print "$content";
#Finish up
close STDOUT;
}
------------------------------End
code-----------------------------------------
but how do I send stdout back to the screen so i can use the print
command an it will appear on the screen.
currently after the subroutine has been called i get this error message
print() on closed filehandle STDOUT at C:\Docum...