in reply to output to STDOUT or a file
I'm confused about this line:
if (shift)What are you shifting off? Or is it just a general "put a condition here" line? Also, how does this benefit over:
my $fh; if(my $filename = shift) { open $fh, '>', $filename or die "Can't open $filename: $!"; } else { open $fh, '>&', STDOUT; } print $fh "Where do you want to go today?\n";
|
|---|