in reply to How to write to Buffer

If you meant how to treat a scalar like a file, then you want to use open with a reference to the scalar:

my $data = 'Hello World'; open my $fh, '>', \$data or die "Couldn't open \$data as a file"; seek $fh, 6; print <$fh>

But then again, your question is a bit vague, so I don't know if that's what you're looking for.