[16865] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4277 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 10 14:10:26 2000

Date: Sun, 10 Sep 2000 11:10:14 -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: <968609413-v9-i4277@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 10 Sep 2000     Volume: 9 Number: 4277

Today's topics:
        Obtaining a list of installed modules & their versions <courcoul@campus.qro.itesm.mx>
    Re: Obtaining a list of installed modules & their versi <calle@lysator.liu.se>
    Re: Perl/CGI to retrieve stock quotes from another serv <davesisk@ipass.net>
    Re: pppperll.. (David Efflandt)
        Problem with reading data from file <g.soper@soundhouse.co.uk>
    Re: Problem with reading data from file <All@n.due.net>
    Re: Problem with reading data from file <g.soper@soundhouse.co.uk>
    Re: Problem with reading data from file <All@n.due.net>
    Re: Problem with reading data from file <g.soper@soundhouse.co.uk>
        Question about Perl <nightchills26@my-deja.com>
    Re: Re-learn Perl <courcoul@campus.qro.itesm.mx>
    Re: RFOL: zap dupes, preserve order <mc@backwoods.org>
    Re: use strict: why? (Gwyn Judd)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 10 Sep 2000 03:43:18 -0500
From: "Juan M. Courcoul" <courcoul@campus.qro.itesm.mx>
Subject: Obtaining a list of installed modules & their versions
Message-Id: <39BB49A7.F9E18698@campus.qro.itesm.mx>

I'm "inheriting" the care & feeding of a host, which has Perl 5.004
installed. I would like to upgrade ASAP to Perl 5.005, to bring it up to
level with my other hosts and be able to exchange code freely between
them. However, since Perl 5.005 modules are not binary-compatible with
previous versions, I need to determine exactly what's installed in the
machine before I make my move, so I can round up the latest compatible
versions of what it has and hopefully not impinge too much on its operation.

How can I determine what a Perl installation has and its versions ?

Thanks,

J. Courcoul
Monterrey Tech,
Queretaro Campus
Mexico


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

Date: 10 Sep 2000 12:03:07 +0200
From: Calle Dybedahl <calle@lysator.liu.se>
Subject: Re: Obtaining a list of installed modules & their versions
Message-Id: <86its4r2ck.fsf@tezcatlipoca.algonet.se>

>>>>> "Juan" == Juan M Courcoul <courcoul@campus.qro.itesm.mx> writes:

> How can I determine what a Perl installation has and its versions ?

Check the autobundle function in the CPAN module documentation.
-- 
 Calle Dybedahl, Vasav. 82, S-177 52 Jaerfaella,SWEDEN | calle@lysator.liu.se
	 "I'd rather hang on to madness than normality" -- KaTe Bush


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

Date: Sun, 10 Sep 2000 14:36:21 GMT
From: "David Sisk" <davesisk@ipass.net>
Subject: Re: Perl/CGI to retrieve stock quotes from another server?
Message-Id: <F%Mu5.14377$Oc.5616920@typhoon.southeast.rr.com>

Thanks very much for the posts!

David Sisk <davesisk@ipass.net> wrote in message
news:O2zu5.23823$gg.6695653@typhoon.southeast.rr.com...
> I want to use a Perl CGI script to retrieve a stock quote from Yahoo,
> perform some calculations, then return a list of values to the user (on my
> home page, my ISP supports running Perl CGI scripts).  I guess the
question
> is really can Perl, running as a CGI script, retrieve an HTML document
from
> a different HTTP site?  Anyone know where I might find an example of how
to
> do this?  Please post or email!
>
> Best regards,
> Dave
>
>
>




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

Date: Sun, 10 Sep 2000 17:19:15 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: pppperll..
Message-Id: <slrn8rngka.g4e.efflandt@efflandt.xnet.com>

On Sat, 09 Sep 2000, Mark Livingstone <cccurious@ottawa.com> wrote:
>re,
>
>i am executing a perl script using SSI (<!--#exec
>cgi="/cgi-bin/mcount.cgi" -->).
>
>if i specify "mcount.cgi 1212", how do i make perl read that "1212" syntax
>and based upon it, print "command 1".. if "2323" given, then print "2323"?

If you don't know what a query string is see:

	http://www.apache.org/docs/misc/FAQ.html#cgi-spec

And to see what to use in place of  #exec cgi= for that see:

	http://www.apache.org/docs/mod/mod_include.html

Then on a system with Perl type:  perldoc CGI

Otherwise see your webserver docs for SSI questions (or *.www.servers.unix
for apache).  See a *.cgi newsgroup for general CGI questions.  And only
come back here if you have a Perl specific question. 

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: Sun, 10 Sep 2000 11:45:50 +0100
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Problem with reading data from file
Message-Id: <49fbcd66adg.soper@soundhouse.co.uk>

Following people's generous help to my previous plea for help (Beginner
question about extracting data from file) I've come to my next problem.

The program is running st http://www.soundhouse.co.uk/cgi-bin/2.cgi and
can be examined at http://www.soundhouse.co.uk/geoff/ along with the
source database file.

The program will eventually provide a web based user admin tool for the
domain. At the moment it just reads records from a CSV into a hash of
hashes and then displays them as a form on a web page ready for editing.

My problem is with the field 'status'. This can be either 'live' or 'dead'
and should be displayed on the web page as a tick box (ticked representing
live). The little piece of code to do this is at lines 45-50. The sympton
is that whether the field's value is 'live' or not the box isn't ticked. I
have noticed that if the database file ends with a newline then the last
record is read in correctly.

I'd be most grateful if somebody could tell me what is happening. 

When looking at the code please bear in mind that this is my first Perl
script.

Many thanks!

-- 
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/


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

Date: Sun, 10 Sep 2000 12:39:22 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: Problem with reading data from file
Message-Id: <_hLu5.10763$CW2.107678@news1.rdc1.ct.home.com>

"Geoff Soper" <g.soper@soundhouse.co.uk> wrote in message
news:49fbcd66adg.soper@soundhouse.co.uk...
: Following people's generous help to my previous plea for help (Beginner
: question about extracting data from file) I've come to my next problem.
:
: The program is running st http://www.soundhouse.co.uk/cgi-bin/2.cgi and
: can be examined at http://www.soundhouse.co.uk/geoff/ along with the
: source database file.

Step one might be to rename your script from 2.cgi to 2.txt so that your web
sever doesn't try to serve it as CGI.  Right now a request produces a  500
Internal Server Error.

HTH

AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--Random Quote--
People get annoyed when you try to debug them.
  Larry Wall





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

Date: Sun, 10 Sep 2000 13:58:02 +0100
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Re: Problem with reading data from file
Message-Id: <49fbd980e0g.soper@soundhouse.co.uk>

In article <_hLu5.10763$CW2.107678@news1.rdc1.ct.home.com>, Allan M. Due
<All@n.due.net> wrote:
> "Geoff Soper" <g.soper@soundhouse.co.uk> wrote in message
> news:49fbcd66adg.soper@soundhouse.co.uk...
> : The program is running st http://www.soundhouse.co.uk/cgi-bin/2.cgi
> : and can be examined at http://www.soundhouse.co.uk/geoff/ along with
> : the source database file.

> Step one might be to rename your script from 2.cgi to 2.txt so that your
> web sever doesn't try to serve it as CGI.  Right now a request produces
> a  500 Internal Server Error.

Hey, I'm new at this! :-)
Now renamed to http://www.soundhouse.co.uk/geoff/2.txt
I didn't realise that would happen when I put a .cgi file in a non cgi-bin
directory but with hindsight it makes sense.

Thanks

-- 
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/


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

Date: Sun, 10 Sep 2000 13:26:06 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: Problem with reading data from file
Message-Id: <OZLu5.11018$CW2.107717@news1.rdc1.ct.home.com>

"Geoff Soper" <g.soper@soundhouse.co.uk> wrote in message
news:49fbd980e0g.soper@soundhouse.co.uk...
: In article <_hLu5.10763$CW2.107678@news1.rdc1.ct.home.com>, Allan M. Due
: <All@n.due.net> wrote:
: > "Geoff Soper" <g.soper@soundhouse.co.uk> wrote in message
: > news:49fbcd66adg.soper@soundhouse.co.uk...
: > : The program is running st http://www.soundhouse.co.uk/cgi-bin/2.cgi
: > : and can be examined at http://www.soundhouse.co.uk/geoff/ along with
: > : the source database file.
:
: > Step one might be to rename your script from 2.cgi to 2.txt so that your
: > web sever doesn't try to serve it as CGI.  Right now a request produces
: > a  500 Internal Server Error.
:
: Hey, I'm new at this! :-)

Everyone was once ;-)

: Now renamed to http://www.soundhouse.co.uk/geoff/2.txt
: I didn't realise that would happen when I put a .cgi file in a non cgi-bin
: directory but with hindsight it makes sense.

Depends on how the server is set up.

Anyway, regarding your problem: here's a clue.  You chomp the first line from
your file ($header_record)  but not the other lines that you read in.  So the
last element still contains a ......?   Try chomping each line and see what
happens.

And I'll leave style/code comments to others.

AmD

--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--Random Quote--
The beginning of wisdom is the definitions of terms.
  Socrates





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

Date: Sun, 10 Sep 2000 14:42:24 +0100
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Re: Problem with reading data from file
Message-Id: <49fbdd9128g.soper@soundhouse.co.uk>

In article <OZLu5.11018$CW2.107717@news1.rdc1.ct.home.com>, Allan M. Due
<All@n.due.net> wrote:
> Anyway, regarding your problem: here's a clue.  You chomp the first line
> from your file ($header_record)  but not the other lines that you read
> in.  So the last element still contains a ......?   Try chomping each
> line and see what happens.

Ah ha, I suspected this might be the problem but looked at the wrong line
when checking for chomp! Many thanks

> And I'll leave style/code comments to others.

Appreciated!

-- 
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/


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

Date: Sun, 10 Sep 2000 17:46:55 GMT
From: Night Chills <nightchills26@my-deja.com>
Subject: Question about Perl
Message-Id: <8pgheb$sa4$1@nnrp1.deja.com>

Hi All!
  I am developing an application in Java that will interact with a Perl
script sitting on a remote webserver to retrieve information sitting in
a text file on the webserver. My application will be client side. And
it DOES NOT use the browser. My question is this:

  How do I pass my request to the perl script?  Let's say that my
application enabled the user to look up any chapter in the Bible. The
user could search by book or by keyword.  Now, let's say that he chose
to search by book and his search string was simply "Romans".  What
information do I need to pass to the server from my application in
order to get that one word to my perl script and what kind of parsing
will the script have to do?

Thanks in Advance,
Anthony


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


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

Date: Sun, 10 Sep 2000 03:38:50 -0500
From: "Juan M. Courcoul" <courcoul@campus.qro.itesm.mx>
To: "P.Eftevik" <haf@autra.noXX>
Subject: Re: Re-learn Perl
Message-Id: <39BB489A.DB630BCB@campus.qro.itesm.mx>

"P.Eftevik" wrote:
> 
> I used to program perl (4.0), but it's some years ago now.
> And now it's time to code perl again, so I need to re-learn what I've
> spent 6-7 years to forget.
> 
> In addition, the language has probably evolved significantly over
> this period.
> 
> Question: where do I find a 'Quick reference Guide' and some brief
> code samples and other hints to freshen up my prior skill ?

Johan Vroman's Perl 5 Reference, which you can buy from O'Reilly or you
can download from CPAN and print yourself is certainly the most concise
Quick Reference  you can get, but it will certainly not help you get "up
to speed" in mastering all the nuances that the object-oriented Perl 5
platform offers, vis-a-vis the old Perl 4 platform. Plus, and this you
will find out much sooner than later, although the language itself has
grown to be quite a powerhouse, especially the latest 5.005
incarnations, nowadays the saying of not having to reinvent the wheel is
particularly valid in the Perl world. Thanks to all the fine folks out
there who have slaved for hours behind the keyboard and then contribute
their efforts so that we all may benefit, the true power of Modern Perl
lies in the myriad of modules covering virtually any relevant need, and
available at your fingertips from your nearest CPAN mirror. This is so
vast that it is way beyond the scope and focus of Johan's work.

Besides getting the latest Perl stable release and perusing the abundant
included documentation, I would suggest setting aside a calm afternoon
to do an adequate exploration of CPAN, so you'll get a feel of what's
available. Do note that most modules have extensive documentation which
include examples of use. Also, you'll probably want to check out 

	http://perl.oreilly.com/

where you'll find all things Perl, from the basic (Learning Perl, the
Llama Book), the reference (Programming Perl, the Camel Book), the
mundane, or the esoterically advanced. Also note that each Perl book has
an Examples section in the site, from where you may obtain useful code
to learn from.

Hope this helps.

J. Courcoul


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

Date: Sun, 10 Sep 2000 07:18:37 -0400
From: MC <mc@backwoods.org>
Subject: Re: RFOL: zap dupes, preserve order
Message-Id: <39BB6E0D.C8868619@backwoods.org>

Yanick Champoux wrote:
> 
> Jeff Zucker <jeff@vpservices.com> wrote:
> : kj0 wrote:
> :>
> :> Request For One-Liner
> :> that eliminates duplicates from an array preserving the original order
> :> of the first instances of each element.
> 
> : for (@a) { print unless $h{$_}; $h{$_}=1}
> 
>         @a=grep!$h{$_}++,@a
> 
> /Yanick

The cool side effect of this approach is you end up with a count of how many
occurances there were of each item. I often see the need for this information.

> --
> eval" use 'that poor Yanick' ";
> print map{ (sort keys %{{ map({$_=>1}split'',$@) }})[hex] }
> qw/8 b 15 1 9 10 11 15 c b 13 1 12 b 13 f 1 c 9 a e b 13 0/;

-- 
---------------------------------------------------------------------
My email address(s) are my private property.  They are NOT to be used
or recorded for ANY reason without my explicit permission.  Disregard
of this statement is in violation of federal privacy & copyright law.
---------------------------------------------------------------------
"The world wont end with a bang, or even a whimper, but with an error
message." -- format C:


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

Date: Sun, 10 Sep 2000 08:23:15 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: use strict: why?
Message-Id: <slrn8rmhec.2fi.tjla@thislove.dyndns.org>

I was shocked! How could Uri Guttman <uri@sysarch.com>
say such a terrible thing:

>you are missing the point. in your mind, separate the way you access a
>value (lexical or symbolic) from the value itself. local affects the
>value only and not the variable. so if you have access to the value you
>can localize it. a slice has access to the values of a lexical so local
>can work on those values. 

Okay so the obvious stupid question follows. How do you local()'ise the
value of a lexically scoped scalar if at all? Leaving aside the question
of whether you would want to :)

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Saints should always be judged guilty until they are proven innocent.
- George Orwell


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

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 4277
**************************************


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