pnotes() expects a reference, it probably should croak if it's passed something else. it just increments the reference count of the sv, it does not make a copy. if you don't want to use a reference, you can copy it yourself: $r->pnotes(key => "$string")