[16380] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3792 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 25 00:05:34 2000

Date: Mon, 24 Jul 2000 21:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964497910-v9-i3792@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 24 Jul 2000     Volume: 9 Number: 3792

Today's topics:
    Re: Activestate PPM not working for Windows? <peter@accesss.com.au>
        Advanced Perl Programming -- Dated? <mbk59@hotmail.com>
    Re: Advanced Perl Programming -- Dated? <uri@sysarch.com>
        cookie <rbank@csf.edu>
        day_of_week() and age() without using Date::Calc ? madsere@my-deja.com
    Re: Duplicate Posts <godzilla@stomp.stomp.tokyo>
    Re: hashes and lists (Keith Calvert Ivey)
    Re: Help: Perl DBI & Oracle: from UNIX to NT <rereidy@indra.com>
        how do you ? question <exit72@excite.com>
    Re: how do you ? question <tony_curtis32@yahoo.com>
        latest site <rbank@csf.edu>
    Re: latest site <care227@attglobal.net>
    Re: Matts Script Archive - A critique (Mark-Jason Dominus)
    Re: Matts Script Archive - A critique (Mark-Jason Dominus)
        Perl as a win32 scheduled task jdallega@my-deja.com
    Re: perl as part of unix distribution (Gwyn Judd)
        Perl's BigFloat/BigInt <rwan@cs.mu.OZ.AU>
        Proceedings of Perl Conference 4.0 <asquith@macconnect.com>
    Re: Searching for errant modules <randy@theory.uwinnipeg.ca>
        use of uninatilized value warning with regular expresio <marc@netcontinuum.com>
    Re: use of uninatilized value warning with regular expr <uri@sysarch.com>
    Re: USEing a perl module (Tad McClellan)
    Re: USEing a perl module <peter.sundstrom@eds.com>
    Re: USEing a perl module (Tad McClellan)
    Re: Why won't  "use strict;"  work? (Tad McClellan)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 25 Jul 2000 13:45:10 +1000
From: "Peter G. Martin" <peter@accesss.com.au>
Subject: Re: Activestate PPM not working for Windows?
Message-Id: <397D0D46.AEBAE989@accesss.com.au>



Eric Bohlman wrote:
> 
> Peter G. Martin (pmartin1@bigpond.net.au) wrote:
> : There are also a string of other problems. In particular, I found it
> : sufficiently inconvenient in a Win95 environment, that PPM writes new
> : module entries into an endless single line.
> : This eventually motivated me to write a routine that
> : makes the PPM.xml look like something with a bit more discipline.
> 
> Be careful there.  In XML-based languages, whitespace outside of markup
> is in general significant; "pretty-printing" an XML document actually
> changes its semantics.  It may be that the current version of PPM ignores
> such whitespace, but future versions might not (if, for example, they
> start reading the XML into a DOM, in which case whitespace in between
> tags will translate into extra text nodes).

Indeed. But what I use imitates the format already used in the
"delivered" PPM.XML -- e.g. that produced by the "genconfig" argument.

BTW is XML "well-formed" regardless of a line length ? 
Can't immediately see anything about it in the rfc stuff I have.


-- 
--peter@access.com.au   -- Peter G. Martin,  Tech writer
mobile: 04 08 249 113   Home: peterm@zeta.org.au
Home page: http://www.zeta.org.au/~peterm
"Regexes::Text   as Numbers::Mathematics."


------------------------------

Date: Mon, 24 Jul 2000 22:45:31 -0400
From: "Mike Krell" <mbk59@hotmail.com>
Subject: Advanced Perl Programming -- Dated?
Message-Id: <397cff07_2@news3.prserv.net>

I've just started reading Sriram Srinivasan's "Advanced Perl Programming" to
learn about some of Perl's more, er, advanced features.  I like both the
writing style and the scope of the subject matter very much, but I'm
wondering how much of the material is inaccurate or obsolete.  For example,
the author mentions using typeglobs instead of references in some instances
for efficiency, but my vague impression from other sources is that using
typeglobs is discouraged.

This is probably a tall order, but does anyone have an idea about which
areas of the book should be taken with a grain of salt, given the current
state of the language?

   Mike




------------------------------

Date: Tue, 25 Jul 2000 03:16:49 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Advanced Perl Programming -- Dated?
Message-Id: <x766puaogt.fsf@home.sysarch.com>

>>>>> "MK" == Mike Krell <mbk59@hotmail.com> writes:

  MK> I've just started reading Sriram Srinivasan's "Advanced Perl
  MK> Programming" to learn about some of Perl's more, er, advanced
  MK> features.  I like both the writing style and the scope of the
  MK> subject matter very much, but I'm wondering how much of the
  MK> material is inaccurate or obsolete.  For example, the author
  MK> mentions using typeglobs instead of references in some instances
  MK> for efficiency, but my vague impression from other sources is that
  MK> using typeglobs is discouraged.

using typeglobs to pass data structures vs. references is definitely a
bad idea. in fact the discussion on perl6 is to eliminate typeglobs
altogether. where did he say typeglobs are faster than refs? i have just
browsed the typeglob chapter (way to early in the book and a whole
chapter on them? gawd!) and couldn't find that comment.

  MK> This is probably a tall order, but does anyone have an idea about
  MK> which areas of the book should be taken with a grain of salt,
  MK> given the current state of the language?

for example, on page 16 (very early in the book) he covers symbolic
references which are considered evil by all decent perl hackers. 

it doesn't cover qr// which was added to perl after it was published. so
it described the old fast way to apply multiple regexes to a string. the
whole chapter on eval is poor. 

it is considered a medium quality book and it is fairly dated in many
areas. it covers some internals and some useful areas. it could be
rewritten and made into a useful book but i doubt it will happen. too
many other decent perl books are out there.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: Mon, 24 Jul 2000 19:34:51 -0600
From: "Robin Bank" <rbank@csf.edu>
Subject: cookie
Message-Id: <8liraf$5f4$5@reader.nmix.net>

Anyone know any good http cookie perl routines or modules? I hate to think I
might have to write one myself...

--
Robin Bank
rbank@csf.edu
---




------------------------------

Date: Tue, 25 Jul 2000 03:26:27 GMT
From: madsere@my-deja.com
Subject: day_of_week() and age() without using Date::Calc ?
Message-Id: <8lj1d0$pmp$1@nnrp1.deja.com>

I am frantically looking for two functions:

1) One that can return the day-of-week for a given date
2) one that can return the age for a given date (birthday)

Yeah I know - Date::Calc can do it.

Unfortunately my web hosting service doesn't have it installed and is
not very quick in installing new modules - to say the least.

Anybody have a function or algorithm for this lying around?


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Mon, 24 Jul 2000 19:53:49 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Duplicate Posts
Message-Id: <397D013D.7C0FAD5@stomp.stomp.tokyo>

danny@lennon.postino.com wrote:
 
> User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) 
> (Linux/2.2.14-5.0 (i586))

> Godzilla! stipulated:

> > Ok, I say it this way. This plastering of selected
> > newsgroups with " comp. " in their title, this flood
> > of over fourteen-thousand articles here and in a few
> > other newsgroups, although accidental, was not accidental.
> > It was the back fired results of a person trying to
> > conceal himself within this group via unskilled hacking.
 
> But how does the JFK Conspiracy come into play here?


As you know, our family registered concerns with
Ron Dicks, Officer In Charge of Burnaby Detachment
of The Royal Canadian Mounted Police, your local
law enforcement agency, regarding crimes you
elected to commit against our family, not very
long back.

Offhand, I would say you are another one of many
criminals using this newsgroup. You are one of 
the professionals here on unlawful activities. 
You tell me how illegal events surrounding our
President Kennedy's assassination are related
to this thread and this person making fools
of most everyone via shady if not illegal means.

Godzilla!

I will rock you.
http://la.znet.com/~callgirl3/spark.mid


------------------------------

Date: Tue, 25 Jul 2000 00:20:07 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: hashes and lists
Message-Id: <397edc1c.7446865@news.newsguy.com>

logan@cs.utexas.edu (Logan Shaw) wrote:

>This tells perl to use a completely unrelated variable[1] -- a SCALAR
>called "my_array" -- as a reference to an array.
[snip]

>  * An entry in the symbol table that makes all variables named
>    "my_array" local to the enclosing block (due to "local").

[snip]
>[1] Except that it's not unrelated because "local" messes with
>    the symbol table in a way that makes them both local, even
>    though their values are a completely separate.  That's one
>    good reason to use "my" instead of "local".

You seem to be misunderstanding local().  Maybe you're thinking
about localizing a typeglob.  Try this:

    $x = 1;
    @x = qw(a b c);
    print "$x @x\n";
    local $x = 2;
    print "$x @x\n";

The local() affects only the variables you use it on, not
anything else with that name.  In fact, it doesn't even have to
be a whole variable:

    $x = 1;
    @x = qw(a b c);
    print "$x @x\n";
    local $x[1] = 'n';
    print "$x @x\n";

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


------------------------------

Date: Mon, 24 Jul 2000 21:05:00 -0600
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Help: Perl DBI & Oracle: from UNIX to NT
Message-Id: <397D03DC.F997C0A7@indra.com>

yudelin@my-deja.com wrote:
> 
> Hi,
> 
> I wonder if anybody has experience on configuration to run Perl DBI on
> UNIX to connect to Oracle on NT machine. We are unable to figure out how
> this connection is made and what the steps are. It will be highly
> appreciated if somebody can give some information on how set up
> DBD::ORACLE and DBI and/or other related configuration.
> 
> Thank you very much!
> 
> Yude Lin
> Email: ylin@tradeloop.com / yudelin@go.com
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
It should be the same as anything else...

1.  Install the Oracle client SW on the UNIX machine.
2.  Configure SQL*Net (tnsnames.ora) to contact the DB.
3.  Install DBI and DBD::Oracle on the clinet machine from CPAN.
4.  Test it out.
-- 

Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


------------------------------

Date: Tue, 25 Jul 2000 02:04:28 GMT
From: Chris <exit72@excite.com>
Subject: how do you ? question
Message-Id: <4rspnscru6fq5berfpvp8ee33causcai6v@4ax.com>

How can I make my code rest for a few seconds. I want to email the
results of a generated page in the same script but it sends a blank
email because the page being generated takes a few seconds to
complete. I tried sleep and got an error. What I want to do is ..
Sub Gen {} 
 .. wait 3 secs..
Sub Email {}.

Please don't bother replying if your help is limited to suggestions of
what perldoc I should read.

TIA


------------------------------

Date: 24 Jul 2000 21:16:38 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: how do you ? question
Message-Id: <87k8ebt0mx.fsf@limey.hpcc.uh.edu>

>> On Tue, 25 Jul 2000 02:04:28 GMT,
>> Chris <exit72@excite.com> said:

> How can I make my code rest for a few seconds. I want to
> email the results of a generated page in the same script
> but it sends a blank email because the page being
> generated takes a few seconds to complete. I tried sleep
> and got an error. What I want to do is ..  Sub Gen {}

And that error was...?  How can anyone help if you don't
provide any information about the problem?

> .. wait 3 secs..  Sub Email {}.

Perhaps you are going about this the wrong way.  Maybe
instead of waiting an arbitrary amount of time after which
you hope that the other process will have finished, you
should make sure things happen in sequence with
appropriate wait mechanisms.  I presume from context that
the Gen sub forks something off.  If so, make the parent
wait for the child to finish (system, fork/wait).

> Please don't bother replying if your help is limited to
> suggestions of what perldoc I should read.

You should read

    perldoc -f sleep

but you'll be roundly ignored in this newsgroup if you
expect to be spoon-fed fish instead of catching your own.

hth
t
-- 
"With $10,000, we'd be millionaires!"
                                           Homer Simpson


------------------------------

Date: Mon, 24 Jul 2000 19:31:33 -0600
From: "Robin Bank" <rbank@csf.edu>
Subject: latest site
Message-Id: <8lirae$5f4$4@reader.nmix.net>

My latest perl acomplishment.

www.112001ad.com

All the code for this site is in one 1200 line perl script...

Pretty cool if I do say so myself, even though the client is kinda a wack
job. What's with the site? 112001ad.com - ah well, whatever the client
wants...

--
Robin Bank
rbank@csf.edu
---




------------------------------

Date: Mon, 24 Jul 2000 22:54:27 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: latest site
Message-Id: <397D0163.91E949D2@attglobal.net>

Robin Bank wrote:
> 
> My latest perl acomplishment.
> 
> www.112001ad.com
> 
> All the code for this site is in one 1200 line perl script...
> 
> Pretty cool if I do say so myself, even though the client is kinda a wack
> job. What's with the site? 112001ad.com - ah well, whatever the client
> wants...
> 

Wicked horizontal scroll....


------------------------------

Date: Tue, 25 Jul 2000 03:14:30 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Matts Script Archive - A critique
Message-Id: <397d0615.5d7f$e3@news.op.net>

In article <397C40B4.F8B1661C@home.com>,
Michael Carman  <mjcarman@home.com> wrote:
>Mark-Jason Dominus has recently done a couple of "Program Repair Shop
>and Red Flags" articles on perl.com for this purpose. Not Matt's stuff,
>nor CGI for that matter, but I think it fits the intent of your original
>post. 
>
>http://www.perl.com/pub/2000/04/raceinfo.html
>http://www.perl.com/pub/2000/06/commify.html

I should add that I would love to do some more of these, but that I
don't want to use Matt's code, for some reason that escapes me at the
moment.  (The reason must be paged out on disk somewhere.)  But if
anyone is a genuine beginner and wants to provide some genuine code to
serve as the subject of a future article, I would be delighted to take
a look.  I'm not in this to humiliate anyone, and I promise not to
treat you or your code disrespectfully. In fact, I'll let you see the
article after I write it and before I post it and I'll work with you
to make sure the tone is polite.



------------------------------

Date: Tue, 25 Jul 2000 03:18:02 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Matts Script Archive - A critique
Message-Id: <397d06ea.5da0$333@news.op.net>

In article <397d0615.5d7f$e3@news.op.net>,
Mark-Jason Dominus <mjd@plover.com> wrote:
>If anyone is a genuine beginner and wants to provide some genuine
>code to serve as the subject of a future article...

One benefit to you, is that if your program has a bug that you just
can't figure out, I'll probably find it and tell you what was wrong.




------------------------------

Date: Tue, 25 Jul 2000 01:49:38 GMT
From: jdallega@my-deja.com
Subject: Perl as a win32 scheduled task
Message-Id: <8lirnh$lvg$1@nnrp1.deja.com>

Hi expert(s),

I am running perlwin32, I have scheduled (on the Windows task
scheduler), one of my Perl programs to run every 5 minutes.

Sometimes the program takes more than 5 minutes to execute and the
scheduler starts the next call to the same program.

How can I make sure that the first call is executed completely before
the next one starts?

Is there any code I can include in my program that says 'if i am
running already, dont run me now'?

Thanks


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Tue, 25 Jul 2000 02:34:39 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: perl as part of unix distribution
Message-Id: <slrn8npv5p.9on.tjla@thislove.dyndns.org>

I was shocked! How could Russ Jones <russ_jones@rac.ray.com>
say such a terrible thing:
>> I like to use perl in shell scripts for program installation and
>> maintenance but my sysadmin will not allow perl on production systems.
>> I hate to think that I'll have to rewrite the perl bits in sed or awk.
>> 
>> Do other folks have similarly recalcitrant sysadmins?  (I mean with
>> regards to perl.  I know they're paid to be hardasses.)
>> 
>
>An argument can be made for not putting any free or shareware
>software, including Perl, on a mission-critical system (I'm just

Not a very good argument it's true but still. I don't think you can lump
shareware in with open source/GPL software though.

>But here it is: If Perl blows up for some reason and brings your
>multi-billion dollar business down, or causes an cruise missile you
>made to fall out of the sky onto a childrens' hospital, or something
>else really bad like that, who do hold responsible? It's something

When windows NT crashed and stranded that naval warship did they sue
microsoft? Ever read the EULA on a piece of commercial software
recently? You're lucky they let you keep the shirt on your back.

>that your stockholders and auditors and lawyers have a right to ask,
>because if you lose a few million bucks, or kill someone with this
>software, you're going to have to answer for it to your stockholders,
>or the survivors. Who can you sue for loss of business, or to offset
>the lawsuits that you're going to get hammered with, or whatever.
>Since you didn't pay for the software and don't have any kind of
>guarantee of usability, you're stuck.

Show me a piece of software that costs less than (say) $10000 that comes
with a guarantee of usability.

>I've thought about this a lot in the past. I've written software
>before that, if it failed, people could die (although not in Perl).
>Common sense should be your guide, but common sense isn't nearly as
>common as its name would suggest.

>Quae narravi, nullo modo negabo. - Catullus

[OT] what does this quote mean?

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Money may buy friendship but money cannot buy love.


------------------------------

Date: Tue, 25 Jul 2000 12:49:48 +1000
From: Raymond WAN <rwan@cs.mu.OZ.AU>
Subject: Perl's BigFloat/BigInt
Message-Id: <Pine.LNX.3.96.1000725124548.16951A-100000@vile.cs.mu.OZ.AU>


        Hello!  I'm having a problem with large numbers in a Perl script
that I'm writing.  I think I've solved it, but I was hoping I could post a
snip of my code to see if anyone can spot a problem.  My knowledge of Perl
is still small and my knowledge of how Perl casts from one datatype to
another is even less... 

        $a1 and $a2 are integers.

        $b = $a1 / 1000;  # Value can be < 1 [but > 0] or very large
        $c = $a2 / 1000;  # Same range as $b
        $d = $b * $c;     # Can be very, very large (over 4 billion)

        I'm using Math::BigFloat and the solution given from the lines
above looks correct.  [$d has to be printed out as a string] But when I do
this: 

        $d = ($a1 / 1000) * ($a2 / 1000);

        it doesn't seem to work so I've created $b and $c in hopes that
the BigFloat division will be used.  Does anyone know why this is so?
Also, does anyone know how to perform an "explicit cast" in Perl so that I
can be sure it is working?  Sorry if this offends anyone :), but I've
programmed so long in C that I think like C a bit too much ;).

	BTW, if I am using both BigFloat and BigInt and I do some
mathematical operation such as multiply, which multiply is used?  Suppose
z = x * y and x and y are non-integers then if BigInt's multiply is used,
then I'm going to lose information.

        Thank you in advance!

Raymond Wan
rwan@csse.unimelb.edu.au





------------------------------

Date: Mon, 24 Jul 2000 20:11:34 -0500
From: "Asquith" <asquith@macconnect.com>
Subject: Proceedings of Perl Conference 4.0
Message-Id: <8lipg901pls@enews3.newsguy.com>

All,
Is there a published (or will there be a published) proceedings (talks AND
papers) from the Perl 4.0 conference or the larger Open-Source conference.
Over the last couple of years, I have learned much about Perl, the
community, and programming concepts in general from the few papers that I
have seen reprinted on the web.  If there are no proceedings, then I think
O'Reilly is missing some sales or at least downloads.

-wha


------------------------------

Date: Mon, 24 Jul 2000 20:53:08 -0500
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: Searching for errant modules
Message-Id: <8lis3r$32q$1@canopus.cc.umanitoba.ca>


Lorenzo Gordon <lorenzo.gordon@lshtm.ac.uk>
   wrote in message news:8lhpg2$rmh$1@nnrp1.deja.com...
[ ... ]
> I was hoping someone could tell me where I might find compiled modules
> for Win32 of:
>                 PlRPC
>                 Net::Daemon
>                 DBI::ProxyServer
>                 DBD::Proxy
> Obviously, I have tried the PPM method, but it cannot find them.
> As I say, I can download the source code, but without the Win32 version
> of make, I cannot do anything with this code.

DBI::ProxyServer and DBD::Proxy are in the DBI package,
which you can install via ppm. RPC::PIServer and Net::Daemon
don't need a C compiler to build, so if you grab nmake from
ftp://ftp.microsoft.com/softlib/MSLFILES/nmake15.exe,
you should be able to install these packages by the usual
   perl Makefile.PL
   nmake
   nmake test
   nmake install
procedure.

best regards,
randy kobes





------------------------------

Date: Mon, 24 Jul 2000 20:20:29 -0700
From: Marc Holder <marc@netcontinuum.com>
Subject: use of uninatilized value warning with regular expresions
Message-Id: <397D077D.7A9256D9@netcontinuum.com>

I have a program that has the following lines:

   if (defined($target)) {
#line 100
      if ($target =~ /^\$[0-9]/) {                              #line
101

The perl interpreter complains (with the -w option on) that I am using
an uninitalized value in line 101. As I have the line 100 checking to
see if $target is defined it must have something to do with the regular
expression. Does anybody know how I can get rid of this warning?




------------------------------

Date: Tue, 25 Jul 2000 03:38:36 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: use of uninatilized value warning with regular expresions
Message-Id: <x7wvia98w2.fsf@home.sysarch.com>

>>>>> "MH" == Marc Holder <marc@netcontinuum.com> writes:

  MH> I have a program that has the following lines:
  MH>    if (defined($target)) {
  MH> #line 100
  MH>       if ($target =~ /^\$[0-9]/) {                              #line
  MH> 101

  MH> The perl interpreter complains (with the -w option on) that I am
  MH> using an uninitalized value in line 101. As I have the line 100
  MH> checking to see if $target is defined it must have something to do
  MH> with the regular expression. Does anybody know how I can get rid
  MH> of this warning?

it might be in the code after the if/regex. post the whole subsection so
we can see.

and comp.lang.perl is a DEAD group (over 5 years). why do you post to it?

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: Mon, 24 Jul 2000 20:36:19 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: USEing a perl module
Message-Id: <slrn8npo83.a81.tadmc@magna.metronet.com>

On Mon, 24 Jul 2000 17:15:36 -0700, Glen Heide <jheide@sprint.ca> wrote:

>What are the steps to making a perl file use a perl module?


You already know the steps for *using* a Perl module. You have them below.


>On the server I use (paid server), they don't have the MIME::Lite module, so
                                         ^^^^^^^^^^

"installing a module" is not the same as "using a module".

You appear to have asked the wrong question...


>I have to install it myself... though I've been having no luck so far.


We cannot help you if you don't tell us what it is you tried.


>It works fine on my own computer, and all I added was what I was told:
>
>use lib "/mydir/mylib";
>use MIME::Lite


That is NOT "installing". That is "using".


>Is there anything else that I was suppose to add other then those 2 lines?


Yes. You need to "install" the module before you can "use" the module.


>Is there any specific thing that I should remember about the first line?


Yes.

The first line of your Perl programs should always end with "-w"  :-)


   perldoc -q module

      "How do I install a module from CPAN?"

      "How do I keep my own module/library directory?"


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 25 Jul 2000 13:57:57 +1200
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: USEing a perl module
Message-Id: <8lis7l$635$1@hermes.nz.eds.com>


Glen Heide wrote in message ...
>What are the steps to making a perl file use a perl module?
>
>On the server I use (paid server), they don't have the MIME::Lite module,
so
>I have to install it myself... though I've been having no luck so far.
>
>It works fine on my own computer, and all I added was what I was told:
>
>use lib "/mydir/mylib";
>use MIME::Lite
>
>*blahblahblah*
>
>Is there anything else that I was suppose to add other then those 2 lines?
>Is there any specific thing that I should remember about the first line?
>Any response will be greatly appreciated   :)


If you have set the path correctly in the "use lib", then everything will be
fine (assuming of course, that the rest of your code has no bugs).




------------------------------

Date: Mon, 24 Jul 2000 22:40:57 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: USEing a perl module
Message-Id: <slrn8npvhp.af0.tadmc@magna.metronet.com>

On Tue, 25 Jul 2000 13:57:57 +1200, Peter Sundstrom <peter.sundstrom@eds.com> wrote:
>
>Glen Heide wrote in message ...
>>What are the steps to making a perl file use a perl module?
>>
>>On the server I use (paid server), they don't have the MIME::Lite module,
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>>I have to install it myself... though I've been having no luck so far.

>If you have set the path correctly in the "use lib", then everything will be
>fine (assuming of course, that the rest of your code has no bugs).
 ^^^^
 ^^^^


Eh?

The module is not installed.

"use lib" isn't going to install the module.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 24 Jul 2000 20:05:53 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Why won't  "use strict;"  work?
Message-Id: <slrn8npmf0.a3e.tadmc@magna.metronet.com>

On Mon, 24 Jul 2000 18:18:45 -0500 (CDT), BUCK NAKED1 <dennis100@webtv.net> wrote:
>Thanks Tad, Abigail, and others. I picked up on Abigail's phrase
>"lexical global," so I did some more research on "my" and "local", and
>figured out that I should be using "my $"... I just can't figure out
>how, where, etc. to use "my". Sigh.


You use it in the smallest possible BLOCK of code.

BLOCKs in Perl is code in {curly braces}.

Controlling variable scope is first-semester CS fodder, are you
not a programmer?

If you can't figure out where to put the my(), just put it
near the top of your program file, outside of any BLOCK,
and it will be visible anywhere within that file.


>I just hope that I don't have to add all of those STDIN STDOUT $ENV,
>etc. things too. 


I dunno what you are talking about there.

If your application requires reading from STDIN, then
you better have it setup right (Perl likely sets it up
right for you). But it is your *application* that requires
it, not Perl.

If you do not need to read from STDIN, then you do not
need to do anything with STDIN. Perl doesn't care.


>This is getting so complicated. 


It is your *application* (file locking) that is complicated,
not Perl.

It would be eversomuchmore complicated in just about any
other language. It's easier in Perl than in other languages.


>Maybe I'm misunderstand
>perl(it's probably too difficult for me), but it seems to me that perl
>is written in a code-intensive "pyramid" fashion, 


You misunderstand.

Perl is *NOT* code intensive.

You can do what you want in 10-15 lines of code in Perl.

It will be a whole lot more LOC in most other programming languages.


>meaning, everything
>needs something else to be defined, and that, in turn needs something
>defined, etc, etc., and that you never get done writing the code. Maybe
>I'm exaggerating, but I hope you don't have to learn every code in that
>12,000 pages in order to accomplish just a few simple tasks. :-)
                                                ^^^^^^^^^^^^

Sharing resources in a multitasking environment is not a simple task.

It isn't Perl's fault that you want to do something hard with it.


>And is the perl coding that I use dependent upon my webserver or my PC?


Your perl code is dependent on whatever machine it runs on.


>For example: I've read that Unix supports the flock command, but that
>Windows doesn't. I use a webserver that runs Unix, and use Winblows 98
>on my PC. Does that mean that my flock code that is input on my
>webserver will be supported, 


Yes (probably).


>and that I can click on it from my Win98
>OS, and it will work correctly? 


CGI programs do not care what OS the client (browser) is
running because CGI programs run on the _server_.

Do you have a web server on your PeeCee?  (there are free ones)


>I've been using the perl man page at
>http://cpan.org/doc/manual/html/pod/perl.html along with a similar one
>at about.com, and some others. Of course, I haven't read all 12,000
>pages... but I have read a few hundred pages.


Your difficulties are due to what it is that you want to program
(CGI), not due to what language you have chosen to write it in.

Read up on *CGI* if you must write CGI applications.

   perldoc -q CGI

Finds 7 or 8 Frequently Asked Questions. Some of the answers
given there have pointers to resources where you can learn
about your application area.


>I have no intentions of trying to become a professional perl programmer.


How about a professional programmer?

How about even just "a programmer"?

You must become a programmer if you are to write programs
(that is the definition of "programmer").


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 3792
**************************************


home help back first fref pref prev next nref lref last post