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

Re: [MacPerl] RE:[Macperl]Introduction



At 8:49 PM -0700 1999/7/4, madame philosophe wrote:
>I also don't understand how you are the site/perl folder relates to the
>@INC so that the script knows to look there.

the site_perl directory is under the perl directory.  Its useful to
separate out your personal modules from the perl distribution.  Main reason
for this being, when you upgrade to a new version you don't accidentally
wipe your own work.

On macs, many people will drop aliases into the site perl directory that
point to their actual modules stored somewhere else.

@INC allows you to add directories that are searched when you use or
require a module.  It is really useful for a) specifying the search order
for modules (finding your own faster than someone elses), b) on systems
where you don't have access to the site_perl directory under the perl
distribution (i.e. on an ISP's  or employers web server).

>My biggest problem is with directories and permissions. But I am
>assuming that there are no permissions re	quired if using MacPerl rather
>than straight Perl on Unix.

Only important on unix/win32 if you wish to 1)grant others the ability to
run your script, 2)want to run your script with specifying "perl
<scriptname>" as the command line.  Both these are important in CGI
scripting.

>As far as perl and OO -
>I'm interested in using the OO interface because as someone mentioned
>somwhere in the thread, perl can be written with or without the OO,
>since it isn't a strongly typed language.
>
>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.
>
>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.

I learned OO on perl.  This will probably mess me up when I try to teach
myself C++ later this year.  I like perl's OO and found it pretty easy to
understand.  Make sure you understand hashes, references and hashes of
hashes first.  Hashes aren't required for OO but almost every OO module
ends up using them.

Since I only know OO from perl (and am self-taught in it), I may be way off
base here, but it seems to me that OO is just a different way of describing
what programs have always done.  The "object" is the chunk of data your
interested in, a hash of names and birthdays, or an array of sales values,
etc....  The methods are the subroutines you use to manipulate your object
-- add new stuff to it, delete from it, print it out, etc....  The thing
I'm not sure about are concepts like inheritance.

>I would be very interested WHEN you find CGI.pm inappropriate, and when
>it covers the wierd gotchas. I'm a fan of CGI.pm, but it can be
>difficult to grasp at times.

I don't use CGI.pm (yet).  When I was first learning perl, I wanted to
write everything myself, mainly because I wanted to understand the langauge
not just how to piece everything together that others have written.  I
wrote my own routines to handle CGI.  Probably not as complete or as
secure, but they work for me.  But now that I have a grasp on the langauge,
when I hit the limits of my own module I'll probably just switch to CGI.pm.

Kevin

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