my $in_text = '...'; my $out_text; open(my $in_fh, '<', \$in_text) or die("Unable to create input file handle from string: $!\n"); open(my $out_fh, '>', \$out_text) or die("Unable to create output file handle from string: $!\n"); my $decoded = $decoder->decode($in_fh, $out_fh);