in reply to print to data
Besides the push solution, you can also print to a filehandle that has been opened to an in-memory variable:
my $output; open my $fd, '>', \$output or die "open: $!"; ## print to the $output scalar print $fd "hello\n"; print $fd "world\n"; close $fd; ## use results print $output; __END__ hello world
--
David Serrano
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: print to data
by imp (Priest) on Sep 06, 2006 at 12:10 UTC | |
|
Re^2: print to data
by Yoda_Oz (Sexton) on Sep 06, 2006 at 11:55 UTC |