use IO::Scalar; use Pod::Html; my $temp; tie *STDOUT, 'IO::Scalar', \$temp; pod2html("--infile=$file"); untie *STDOUT;