Cookie Notice

As far as I know, and as far as I remember, nothing in this page does anything with Cookies.

2010/01/28

Solutions to my Remedial Perl Module Problems

Thanks to Stack Overflow, I can move forward. Stupid examples below.

test.pl

#!/usr/bin/perl
use 5.010 ;
use strict ;
use warnings ;

#use Dumb::Database ':all' ;
use Dumb ':all' ;

my_dumb_function() ;


Dumb.pm

package Dumb ;
use 5.010 ;
use strict;
use warnings;
use Exporter qw(import);
use lib '/home/jacoby/lib' ;
use Dumb::Database ':all' ;

our %EXPORT_TAGS = ('all' => [ qw(
my_dumb_function
) ],
);
our @EXPORT_OK = ( @{$EXPORT_TAGS{'all'}} );
our $VERSION = 0.0.1;

1;


Dumb/Database.pm

package Dumb::Database ;
use 5.010 ;
use strict;
use warnings;

use Exporter qw(import);
our %EXPORT_TAGS = ('all' => [ qw(
my_dumb_function
) ],
);
our @EXPORT_OK = ( @{$EXPORT_TAGS{'all'}} );

sub my_dumb_function {
say 'dumb' ;
}
1;

No comments:

Post a Comment