package Mytest;
use strict;
+ use warnings;
require Exporter;
require DynaLoader;
that looks like this:
#! /opt/perl5/bin/perl
-
+
use ExtUtils::testlib;
-
+
use Mytest;
-
+
Mytest::hello();
Now we make the script executable (C<chmod -x hello>), run the script
#include <stdlib.h>
#include "./mylib.h"
-
+
double
foo(int a, long b, const char *c)
{
or easier to understand. These routines should live in the .pm file.
Whether they are automatically loaded when the extension itself is loaded
or only loaded when called depends on where in the .pm file the subroutine
-definition is placed. You can also consult L<Autoloader> for an alternate
+definition is placed. You can also consult L<AutoLoader> for an alternate
way to store and load your extra subroutines.
=head2 Documenting your Extension