Re: perl


Subject: Re: perl
From: Chris Hamilton (chris@digitalalaska.com)
Date: Tue Apr 16 2002 - 17:10:51 AKDT


Thanks, sounds like I need to learn about modules. Here is what I am trying
to do... I want to have a script/module that contains all of my database
connection parameters and will make these parameters available to the
calling script.

Here are the connection parameters that I want to include in a separate
script/module:

my $serverName = "localhost";
my $serverPort = "3306";
my $serverUser = "johndoe";
my $serverPass = "slick";
my $serverDb = "DBName";
my $serverTabl = "TableName";

That's it. When I use "require" to try and include a script containing the
info above, I get nothing (no errors or anything, just the html stuff).
When I use require to make "Hello world" print in the browser it works. Is
there something special about passing variables that I should know about. I
bought a perl for dummies book today. So hopefully my days of being a dummy
are numbered. I saw Arthurs book there too, but figured I would get lost
just reading the Acknowledgments.

Chris.
----- Original Message -----
From: "Greg Jetter" <greg@lazymountain.com>
To: "Chris Hamilton" <chris@digitalalaska.com>; <aklug@aklug.org>
Sent: Tuesday, April 16, 2002 5:06 PM
Subject: Re: perl

>
> On Monday 15 April 2002 07:59 am, Chris Hamilton wrote:
> > I've got a question for perl people.
> >
> > Inside a script I want to refer to another script (and have the
variables
> > carry over). I want to have a separate script that has all my database
> > connection info, so I can refer to this script whenever connecting to a
> > particular database. I've got the Learning Perl book, but it doesn't
> > explain how I would do this. Any hints would be helpful. Thanks.
> >
> > Chris.
> >
> >
> >
> > ---------
> > To unsubscribe, send email to <aklug-request@aklug.org>
> > with 'unsubscribe' in the message body.
>
> The simple way to do it would be to put all of your data routeens in a
> modual , make objects out of them and then when you need a routeen in
nother
> script , call the method out of your module andpass it data to work
with.
>
> all you got to do then is call the routreen
>
> Greg
>
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>
>

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Tue Apr 16 2002 - 17:11:52 AKDT