On 6/24/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote:

I want to write once a script as a part of building a connection to my MySQL
DB server. The parts only use a kind of vabiable such as "$dbh". Is it possible?

It's possible. In fact, that's what most of us do with objects.

#!/usr/bin/perl -w

That's a good start. You could also use "use warnings" instead of -w,
and adding "use strict" will prevent some common mistakes.

 use strict;
 use warnings;

use iterdir;

What's this? Module names in all lower case are reserved for pragmas.
In the privacy of your own home directory, of course, you can name
things whatever you want. But normal modules, and the package names
they use, begin with a capital letter.

Can't call method "prepare" on an undefined value at iterdir.pm line 22.

That means that the expression to the left of "->prepare" near line 22
turned out to be undef instead of an object.

Please tell me how a class inherits connection object to the another class.

Perl objects use the @ISA mechanism, documented in the perlobj manpage.

   http://search.cpan.org/~nwclark/perl-5.8.8/pod/perlobj.pod

But it may help to start in the barnyard:

   http://search.cpan.org/~nwclark/perl-5.8.8/pod/perlboot.pod

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to