in reply to Re: Reading a variable as a file
in thread Reading a variable as a file

ikegami's post gives you the best solution you're going to get.
open my $STR, "<", \$scalar;

is the way to go