in reply to Re: Reading a variable as a filein thread Reading a variable as a file
open my $STR, "<", \$scalar; [download]
is the way to go