use 5.008000; # open \$var open(my $fh, '<', \$var); while (<$fh>) { ... } #### while ($var =~ /(.*\n|.+)/g) { ... }