in reply to Question on SV internals

Use the Devel::Peek module's Dump() function to inspect the various compartments within a scalar at whatever stage you wish in the script. Example:

use Devel::Peek; my $x = "99 bottles of beer on the wall"; Dump( $x ); $x += 1; Dump( $x ); $x .= "\n"; Dump( $x ); $x += 2; Dump( $x );

Have fun exploring what various actions do to your scalar internally. I can't remember where I read a good explanation of the internals of Perl's various data types. It might have been OReilly's Advanced Perl Programming... or it might not. Hopefully someone can help out with a good reference.

PS: To specifically answer the question; once Perl has recognized it in numeric context, it doesn't need to be re-'converted'.


Dave

Replies are listed 'Best First'.
Re^2: Question on SV internals
by Marshall (Canon) on May 08, 2011 at 05:12 UTC
    Yes, you are correct, "Advanced Perl Programming", section 20 is "Perl Internals" and the diagrams are nice. I think there are other diagrams our there. OP might want to search for Perl guts or perlguts.