use strict; use warnings; use Test::More tests => 3; use Devel::Peek; use B qw( svref_2object SVf_IOK SVf_NOK SVf_POK ); sub is_iv { my $sv = svref_2object(my $ref = \$_[0]); my $flags = $sv->FLAGS; my $pv = $sv->can('PVX') ? $sv->PVX : undef; if (wantarray) { return ($flags & SVf_IOK, $pv); } else { return $flags & SVf_IOK; } } my $r = "100"; $r = 100; Dump($r); my ($iv, $pv) = is_iv($r); is($r, 100, "correct value returned SQL_INTEGER"); ok($iv, "ivok bind integer"); ok($pv, "pv not null bind integer");