Hi
I've just finished writing a rather big module containing a lot of SQL tricks to save me some time. I'm now trying to tie this into my programs, however I'm a little consufed by this OO business.
From other modules I've seen I think I need to create a 'new' sub routine so I can call my module with something like:
my $mysql = WS::MySQL->new();
The only problem is, I don't know what should go in new. I've read and heard about blessing this and belssing that but I'm still a little confused. Anyone fancy telling me what I need to put in there? At the moment, I've just got this:
my $class = shift;
return bless {}, $class;
}
But surely I need more than that?!
- wil
I've just finished writing a rather big module containing a lot of SQL tricks to save me some time. I'm now trying to tie this into my programs, however I'm a little consufed by this OO business.
From other modules I've seen I think I need to create a 'new' sub routine so I can call my module with something like:
Code:
use WS::MySQL; my $mysql = WS::MySQL->new();
The only problem is, I don't know what should go in new. I've read and heard about blessing this and belssing that but I'm still a little confused. Anyone fancy telling me what I need to put in there? At the moment, I've just got this:
Code:
sub new { my $class = shift;
return bless {}, $class;
}
But surely I need more than that?!
- wil