Ultimater
11-02-2005, 09:00 PM
use CGI qw(:standard);
I'm trying to make my own module(s) similar to the way you can export from the CGI module using ":standard".
I have a single module called "MySQLu.pm" that defines functions to make my MySQL database management easier.
Currently this module defines 6 subroutines for each table in my database.
For the "business" table:
sub getTableBusiness
sub addEntryBusiness
sub clearTableBusiness
sub deleteTableBusiness
sub createTableBusiness
sub restartTableBusiness
For the "band" table:
sub getTableBand
sub addEntryBand
sub clearTableBand
sub deleteTableBand
sub createTableBand
sub restartTableBand
Get the picture?
However, I have one PL file to manage each table that will not need any of the subroutines to manage another table. Meaning within the file "band.pl" I will not need subs like "addEntryBusiness" just subs with the name "band" in it like "addEntryBand". However because it becomes a pain-in-the-you-know-where to have to type "band" over and over each time I want to call a MySQL function from within the file "band.pl", I want to be able to remove the table name from my subroutines names.
From within my "band.pl" file I'l like to be able to do:
#band.pl
use MySQLu qw(:band);
From within my "business.pl" file I'l like to be able to do:
#business.pl
use MySQLu qw(:business);
And the MySQLu module will export:
sub getTable
sub addEntry
sub clearTable
sub deleteTable
sub createTable
sub restartTable
How do export tags work?
I'm trying to make my own module(s) similar to the way you can export from the CGI module using ":standard".
I have a single module called "MySQLu.pm" that defines functions to make my MySQL database management easier.
Currently this module defines 6 subroutines for each table in my database.
For the "business" table:
sub getTableBusiness
sub addEntryBusiness
sub clearTableBusiness
sub deleteTableBusiness
sub createTableBusiness
sub restartTableBusiness
For the "band" table:
sub getTableBand
sub addEntryBand
sub clearTableBand
sub deleteTableBand
sub createTableBand
sub restartTableBand
Get the picture?
However, I have one PL file to manage each table that will not need any of the subroutines to manage another table. Meaning within the file "band.pl" I will not need subs like "addEntryBusiness" just subs with the name "band" in it like "addEntryBand". However because it becomes a pain-in-the-you-know-where to have to type "band" over and over each time I want to call a MySQL function from within the file "band.pl", I want to be able to remove the table name from my subroutines names.
From within my "band.pl" file I'l like to be able to do:
#band.pl
use MySQLu qw(:band);
From within my "business.pl" file I'l like to be able to do:
#business.pl
use MySQLu qw(:business);
And the MySQLu module will export:
sub getTable
sub addEntry
sub clearTable
sub deleteTable
sub createTable
sub restartTable
How do export tags work?