sub myfunc { my ($ref) = @_; # modify $ref somehow warn "Should be called in void context" if defined wantarray; }