http://www.perlmonks.org?node_id=11111112


in reply to Why not perl have raw/native type

Basically since Perl is highly dynamic, you can't prevent somebody from doing:

my $ref; { my native str $bb = 'hello world'; $ref = \$bb; } print $$ref;

Perl expects any variable to be at least of type SV. The closest you can get to a "native" variable is to use the PV slot of the variable and point it to your raw memory. You will still get reference counting and everything, but Perl expects all variables to support that.

Also note that by carefully looking at the code path, you can often prevent (needless) copying of data, for example by using DBI bind parameters instead of using ->fetchrow.