in reply to Using a tied scalar as an in memory file

$tied_variable does get set by the print on the filehandle but STORE is not called via the tie - somehow its being circumvented.

Looks like the IO system doesn't check if the referenced variable is magical, so it never calls the function that would result in STORE getting called. You'll need to tie a handle instead of using open \$var; (although nothing's stopping you from tieing the handle to a scalar).

Update: Note that it would be very inefficient to work on a tied scalar. Massive copying would ensue.

Update: I didn't notice the big picture. While I answered your question, it won't help you achieve your goal. See almut's reply.