diff options
author | John Peacock <jpeacock@cpan.org> | 2011-12-06 20:55:09 -0500 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2011-12-09 14:59:04 -0500 |
commit | 573a19fb2c79f41cfc7f3db5a8ad14e14a4dccf9 (patch) | |
tree | e7c0c975264052c4d7fb48acafc9a91c8566ebc2 /sv.c | |
parent | a97f6d148c766c74f3c3200d95d9fbf569067b45 (diff) | |
download | perl-573a19fb2c79f41cfc7f3db5a8ad14e14a4dccf9.tar.gz |
Use syntax from perlguts for testing objects
The following paragraph is in perlguts.pod:
To check if you've got an object derived from a specific class you have
to write:
if (sv_isobject(sv) && sv_derived_from(sv, class)) { ... }
which does the right thing with magical things like tied scalars.
Signed-off-by: David Golden <dagolden@cpan.org>
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -10354,7 +10354,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, * back into v-string notation and then let the * vectorize happen normally */ - if (sv_derived_from(vecsv, "version") && SvROK(vecsv)) { + if (sv_isobject(vecsv) && sv_derived_from(vecsv, "version")) { char *version = savesvpv(vecsv); if ( hv_exists(MUTABLE_HV(SvRV(vecsv)), "alpha", 5 ) ) { Perl_warner(aTHX_ packWARN(WARN_INTERNAL), |