Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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
Replies are listed 'Best First'.
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 chilling in the Monastery: (12)
As of 2015-07-31 21:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (282 votes), past polls