This is based on the example in Programming Perl:
#!/bin/perl5
use strict;
use warnings;
open ERRORFILE, ">>myprogram.error"
or die "Can't open myprogram.error";
open SAVEERR, ">&STDERR";
open STDERR, ">&ERRORFILE";
select STDERR; $| =1;
print STDERR "stderr 1\n";
close STDERR;
open STDERR, ">&SAVEERR";
print STDERR "stderr 2\n";
I'm getting warnings:
Name "main::SAVEERR" used only once
Name "main::ERRORFILE" used only once
Do I need
no warnings? If so, where? Apart from that it works as expected.
Thanks in advance
wfsp