Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 chanting in the Monastery: (11)
As of 2014-08-29 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls