[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] RE:[Macperl]Introduction



On Sun, 4 Jul 1999, madame philosophe wrote:

> Modules...modules are the most elusive things to me. I understand that
> modules are like libraries of packages. I just don't understand how they
> get installed with "makefile.pl"
>
"Makefile.PL" files are Perl scripts like any other. They usually have a
WriteMakefile routine (with arguments) which is something that the
ExtUtils::MakeMaker module processes to produce a *real* makefile.

This real makefile has install targets, and in the MacPerl Makefile.mk
makefiles the install targets will use the "Duplicate" command to actually
copy files around. So there is no magic. :-)
 
> I also don't understand how you are the site/perl folder relates to the
> @INC so that the script knows to look there. 
>
If you look at Libraries under the Edit->Preferences menu, you'll see that
both the 'lib' and 'site_perl' folders are already in your library path by
default. So this is how @INC knows.

On the subject, once you start installing new modules, it's a good idea to
explicitly add 'site_perl' to the user paths in the same dialog. That way
'site_perl' will get searched before 'lib'.
 
> I also recognize that people are recommending I don't go OO so fast, but
> I guess my premise is that if I learn the OO aspects(which I've wanted
> to understand even before wanting to learn Perl) then going "procedural"
> will be easy. Going from procedural to OO, I hear can be difficult to
> get your head around.
>
It really depends on your problem of the moment. If you try to apply OO to
a problem which screams for procedural then I foresee frustration. :-)
 
> Now before I start a holy war (which I don' really want to do here) I
> just want to use perl for doing CGI stuff and I know that there are tons
> of modules out there to use. And if I want to do that I will need to
> understand the OO parts of Perl, or do I? I'm certain that someone will
> pipe in right about here.
>
CGI.pm can be used either OO or procedural.

In general, if you're going to use OO modules, then read 'perlobj'. That
should make some sense to you before you use OO a lot.

If you're going to *write* OO, then stuff like 'perltoot' and 'perlbot'
should also be understood. 

I think you'll do better, even if your goal is just CGI, if you don't
fixate on just CGI. Perl is about lots more, and you'll write better Perl
if you learn how to do many things with it. Myself, for example, I've
written about 5 CGI scripts in my life, of which maybe 2 were Perl. I
haven't done CGI at all for over a year. But I use Perl extensively.

Arved



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org