in reply to Re: print to data
in thread print to data

Opening scalar refs is one of my favorite newish features of perl. Keep in mind that this works for perl 5.8 and above. For earlier versions you would have to use IO::Scalar or IO::String.