Creating New Variables To create a new Perl variable, which can be accessed from your Perl script, use the following routines, depending on the variable type. The new variable can now be set, using the routines appropriate to the data type. The default package is called main . Double-Typed SV's Scalar variables normally contain only one type of value, an integer, double, pointer, or reference. Perl will automatically convert the actual scalar data from the stored type into the requested type.
Some scalar variables contain more than one type of scalar data.
Calling Perl Routines from within C Programs There are four routines that can be used to call a Perl subroutine from within a C program. The second argument tells the appropriate routine what, if any, variables are being returned by the Perl subroutine. All four routines return the number of arguments that the subroutine returned on the Perl stack. When using these four routines, the programmer must manipulate the Perl stack. With lots of help and suggestions from Dean Roehrich, Malcolm Beattie, Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, and Neil Bowers.