Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl_call_pv(, , G_ARRAY) returns references as integer type SVt_IV

by dave_the_m (Parson)
on Oct 01, 2012 at 15:00 UTC ( #996673=note: print w/ replies, xml ) Need Help??


in reply to Perl_call_pv(, , G_ARRAY) returns references as integer type SVt_IV

SvTYPE() merely tells you the type of the storage container; it doesn't in general say what the logical type of the SV is.

Since 5.12.0, the SVt_RV sv type has been abolished, on the grounds that the SVt_IV container type is perfectly capable of holding a reference.

In general you shouldn't be basing code on tests like SvTYPE(sv) == SVt_RV; instead you should be testing the relevant flags, e.g.:

if (SvROK(sv)) ref = SvRV(sv);

Dave.


Comment on Re: Perl_call_pv(, , G_ARRAY) returns references as integer type SVt_IV
Select or Download Code
Re^2: Perl_call_pv(, , G_ARRAY) returns references as integer type SVt_IV
by rogue_tache (Novice) on Oct 01, 2012 at 16:08 UTC
    Wonderful, that has sorted it. I am much obliged.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996673]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-07-25 09:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls