in reply to Redirect Subroutine Output
You could write the sub the following way:
use warnings; use strict; sub print_to { print {$_[0]} $_[1]; } print_to (*STDOUT, "test stdout"); print_to (*STDERR, "test stderr");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Redirect Subroutine Output
by spickles (Scribe) on Aug 26, 2009 at 18:08 UTC | |
by toolic (Bishop) on Aug 26, 2009 at 18:28 UTC |
In Section
Seekers of Perl Wisdom