use strict; use warnings; use IO::Scalar; my $out = IO::Scalar->new(); $out->print("hello world\n"); $out->print(qw(foo bar baz), "\n"); print $out;