Hi ,
Urgent help.
I have written 2 modules one abc.pm & xyz.pm (admin modules).
abc.pm
--
my $databasehandle;
sub new($){
my ($self,$usr,$pwd) = @_;
$usr||= "test";
$pwd ||= "test123";
($self) = {};
bless($self);
$databasehandle = DBI
Alma wrote:
Hi ,
Urgent help.
I have written 2 modules one abc.pm & xyz.pm (admin modules).
abc.pm
--
my $databasehandle;
Note that this establishes a single $databasehandle for every object
of type 'abc' that you create; it does not create a separate one
On 5/31/07, Jonathan Lang <[EMAIL PROTECTED]> wrote:
snip
Again, you have a signature problem. 'sub new($)' says that 'new'
will take a single scalar as a parameter; as such, @_ will only ever
have one value in it: $usr and $pwd will always be set to null.
snip
Well, there is a prototype probl
On 31 May 2007 06:17:50 -0700, Alma <[EMAIL PROTECTED]> wrote:
snip
I am getting an error :
Can't locate object method "prepare" via package "abc" at xyz.pm
snip
Besides the things that are wrong that other people have mentioned,
you need to make the abc class a subclass of DBI. This being Per
On 05/31/2007 08:17 AM, Alma wrote:
[...]
$database_handle = abc->new('test','test123');
[...]
No, the 'new' method of 'abc' returns an object of type 'abc'--not a
database handle. Review the return statement in abc::new again.
sub display()
{
my $self = shift;
my $sth = $database_handle-
Chas Owens wrote:
Well, there is a prototype problem, but it isn't that $ will force new
to only accept one value, but rather that prototypes and OO Perl don't
mix. Perl simply ignores prototypes on methods. Also prototypes are
broken*, don't use them.
-snip-
* http://library.n0i.net/programm
On 5/31/07, Jonathan Lang <[EMAIL PROTECTED]> wrote:
snip
Also prototypes are broken*, don't use them.
-snip-
> * http://library.n0i.net/programming/perl/articles/fm_prototypes/
"Broken" and "don't use them" is a bit extreme. But I will agree with
the general sentiment that they should not be u
On May 31, 7:18 pm, [EMAIL PROTECTED] (Jonathan Lang) wrote:
> > abc.pm
> > --
> > my $databasehandle;
>
> Note that this establishes a single $databasehandle for every object
> of type 'abc' that you create; it does not create a separate one for
> each object.
>
On May 31, 2:17 pm, [EMAIL PROTECTED] (Alma) wrote:
> Hi ,
>
> Urgent help.
[ snip - substantially the same thing as he posted a few days back ]
Please, if there is something you find unclear about the answers you
are given in a newsgroup or mailing list then follow-up with further
questions abou
On 06/01/2007 12:36 PM, [EMAIL PROTECTED] wrote:
On May 31, 2:17 pm, [EMAIL PROTECTED] (Alma) wrote:
Hi ,
Urgent help.
[ snip - substantially the same thing as he posted a few days back ]
Please, if there is something you find unclear about the answers you
are given in a newsgroup or mailing
10 matches
Mail list logo