in reply to Some system command not working as required after File::Tee

You can reset STDOUT in BEGIN block, Please refere follwoing code snippet, it might be helpful you.

BEGIN { open STDERR, '> log.txt' or die "Can't Write to log.txt. Permission Denied!!!"; binmode STDERR; } &pager(); sub pager { my $temp = "temp.txt"; my $pager = "less"; system("$pager $temp"); }

Replies are listed 'Best First'.
Re^2: Some system command not working as required after File::Tee
by perlbaba (Initiate) on Dec 13, 2010 at 12:57 UTC
    All I can say, smart solution !!!!! Kudos to tofanikanudo

      The only problem is that this snippet doesn't do what File::Tee does - which, as I understand, is important to the original poster...

        may be you can redirect less output stdout and stderr to file?
        system('less text 1>>file 2>>file');