develooper Front page | perl.perl5.porters | Postings from June 2004

Re: undef loses it magicness when assigned to a variable?

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
June 1, 2004 09:02
Subject:
Re: undef loses it magicness when assigned to a variable?
Message ID:
20040601160247.7519.5@llama.elixent.com
Stas Bekman <stas@stason.org> writes:
>
>So how do I check in C whether the passed variable (or a random sv) is undef 
>or not if comparing to &PL_sv_undef doesn't work? am I missing some obvious 
>RTFM section? I've read: 'perlguts:=head2 AVs, HVs and undefined values'
>but it doesn't seem to be related. There were many other references to undef 
>in the perl manpages, but I didn't find anything useful.

Perl's 

  if (defined($foo)) { ... }

in XS is 
  if (SvOK(sv)) { ... }

Is that what you meant?

undef as a value is occasionaly used as distinct from other !SvOK() SVs.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About