in reply to Is an SV and IV or a PV or an NV or a UV? How can I tell?

How about this:
use 5.010; # just for "say" use B; ($f,$g)=(333,"xyz"); say ref B::svref_2object(\$f); say ref B::svref_2object(\$g);
edit Devel::Peek might also help you.

Replies are listed 'Best First'.
Re^2: Is an SV and IV or a PV or an NV or a UV? How can I tell?
by ikegami (Patriarch) on Oct 24, 2011 at 21:13 UTC

    This will give the answer without the superfluous "B::" prefix:

    use feature qw( say ); use B qw( ); my ($f,$g) = (333,"xyz"); say B::class(B::svref_2object(\$f)); say B::class(B::svref_2object(\$g));
    IV PV

    Note that this returns the SV *type*. It can return "PV" even if the scalar has no PV.

    use feature qw( say ); use B qw( ); $_ = 333; "".$_; $_ = undef; say B::class(B::svref_2object(\$_));
    PVIV

    This is what the OP asked, but he probably wants to know what the scalar *has*.