my $str = "Hello World\n"; open my $fIn, '<', \$str; my $inStr = <$fIn>; close $fIn; print $inStr;