# using IO::Scalar tie *FH, 'IO::Scalar', \my $str = $somenumber; # using open() open(my $fh, '<', \my $str = $somenumber);