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 | |
by Anonyrnous Monk (Hermit) on Dec 13, 2010 at 13:11 UTC | |
by Khariton (Sexton) on Dec 13, 2010 at 21:01 UTC |