[12101] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5702 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 17 15:07:17 1999

Date: Mon, 17 May 99 12:01:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 17 May 1999     Volume: 8 Number: 5702

Today's topics:
    Re: Oracle...Perl...IIS <cassell@mail.cor.epa.gov>
    Re: Overflow error using an Array. <dgris@moiraine.dimensional.com>
    Re: Perl Librarys for NT <cassell@mail.cor.epa.gov>
    Re: Perl/CGI or Java Servlets? <cassell@mail.cor.epa.gov>
    Re: Saving output of CGI program in HTML file <caslav@mail.muni.cz>
    Re: Sorting is too slow for finding top N keys... - UPD (Michel Dalle)
    Re: Sorting problem <jdporter@min.net>
    Re: Sorting problem <jdporter@min.net>
    Re: Sorting problem (Randal L. Schwartz)
    Re: The Sendmail Program <cassell@mail.cor.epa.gov>
    Re: TROLL ALERT (Re: Perl "constructors") <jeromeo@atrieva.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 17 May 1999 10:34:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Oracle...Perl...IIS
Message-Id: <37405324.7402816B@mail.cor.epa.gov>

CHETAN wrote:
> 
> Hi all,
> 
>   I am a new perl programmer and have setup of Perl and
> Oracle installed on Windows NT ......

Boy, you're really tackling a lot for a starter.  That's
WinNT admin, IIS admin, HTML, CGI, Perl, *and* Oracle.

>   I want to connect to Oracle thru Perl and access the
> database....
> 
>   I have IIS webserver installed on NT also ... and I
> dont know shall I configure it also for this..

Okay, then make sure you're using ActiveState Perl from
www.activestate.com .  It comes with oodles [a technical
term] of docs, accessible both via HTML and the perldoc
program that comes with your install.

Follow the directions in the HTML docs (under Web Server
Config) for working with IIS.  Then make sure to use
the ppm program (there are HTML docs on it too) to
install the pieces not already on your system.  You
want the DBI and DBD::Oracle modules.  ppm will even
install their docs into your HTML tree for easy reading.
There are plenty of examples to get you started.

And here's another tip.  Seriously consider using
the CGI module.  Make sure you have the libwww bundle
installed, since it contains a lot of helpful modules
to keep you from re-inventing the wheel.. and ending
up with a stone square instead.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 17 May 1999 11:18:15 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Overflow error using an Array.
Message-Id: <m3vhdrmx7s.fsf@moiraine.dimensional.com>

Tim Pickrell <pickrell@hursley.ibm.com> writes:

<snip>

The problem is probably on line 17.

Post some code.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Mon, 17 May 1999 11:32:00 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Kim Kulasa <Kimberly.Kulasa@daytonoh.ncr.com>
Subject: Re: Perl Librarys for NT
Message-Id: <374060A0.152DB908@mail.cor.epa.gov>

[courtesy cc sent to poster]

Kim Kulasa wrote:
> 
> Does anyone know if the LWP (library for www access for Perl) or the GD.pm
> (Graphics library) are available for NT?  We have NT 4 with IIS 4 and
> ActiveState's latest activeperl release.

Yes.  :-)

Kim, you should first go to the HTML documentation that was
installed with your Perl, and look up ppm [it's listed as
PPM in the "Module Docs" section under "Root Libraries".
That will show you how to search the ActiveState collective
for modules, and then install them (easily), using just ppm.

Then look farther down the panel under the alphabetical 
listings, and you'll probably see that CGI is already on your
system.. with docs all set up for you to read.

After that, it'll be a snap for you to get the GD.pm module
for your system.  Using ppm, it took me about two seconds
of typing and a 20-second wait.  But exit the HTML docs and
re-open them, so they'll see the updated HTML tree. 
They'll now be able to read the GD docs too.
 
> Thanks in advance,

You're welcome _a_posteriori_,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 17 May 1999 10:46:36 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl/CGI or Java Servlets?
Message-Id: <374055FC.3E1893AD@mail.cor.epa.gov>

ted wrote:
> 
> Are their any major advantages in using Java Servlets instead of Perl/CGIs?

You might want to go to 
http://language.perl.com/versus/index.html
and read a couple views on the subject.

If you want client-side computing, you can't guarantee that
Perl is on the client's machine.  But then, you can't
guarantee that java or javascript is enabled on the client's
machine either.  They aren't on some of mine.  I haven't
seen any java thing on the server side which Perl can't do,
but I have seen a lot of Perl server progs which I wouldn't
dream of trying to implement in java.

Which one are you more adept in?  That should also be
a prime consideration.

> If one uses mod_perl, is the speed issue moot?

Not at all.  Perl is way faster than java to begin with,
and mod_perl just tilts the arrow farther toward the
Perl side of the dial.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 14 May 1999 14:53:11 GMT
From: Martin Caslavsky <caslav@mail.muni.cz>
Subject: Re: Saving output of CGI program in HTML file
Message-Id: <373C38D7.CA559820@mail.muni.cz>

> My CGI program on server generates HTML and displays on the client
> (browser). But, when I save the output it saves as progname.pl file
> (progname is the CGI program name). Of course, I can save it as .html,
> by changing the extension while saving.  I want the output to be saved
> as .html file when I try to save the output. Is there any way ?
>

You can rename your script to script.html and told your server to execute
it as script or you can call him as
http://server.dom/script.pl/script.html?parameter=value
and then environment variable $ENV{PATH_INFO} == script.html

Martin Caslavsky



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

Date: Mon, 17 May 1999 17:41:40 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Sorting is too slow for finding top N keys... - UPDATE
Message-Id: <7hpkb3$cbu$1@news.mch.sbs.de>

In article <7hpdf6$mh5$1@pegasus.csx.cam.ac.uk>, mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
[snip]
>Sorted data shouldn't be pathological, but highly duplicated data can be,
>if the qsort implementor hasn't thought of the case.  Here's some examples,
>run under Solaris 2.6.   The cases are all straightforward numeric sorts,
>with data
[snap]

Interesting ! Thanks for the measurements.

>Versions of Perl up to 5.004_04 relied on the platform-provided qsort(),
>while later versions include their own qsort() code provided by
>Tom Horsley.    And you can see the difference.

Aha ! Thank you, Mike, for confirming my impression that there was
a huge difference in sort implementations between old versions and
the recent ones.

[snip]
>More careful implementations, such as Tom's, divide into three parts,
>below, equal and above.    The equal values won't need to be processed
>again, so cases like Michel's become *very* fast to sort as you can see.

Indeed. There still seems to be a high penalty for using sort in cases where 
your computer's memory is fairly "full", though, compared to the LarryX
solutions.

I'm not up to fully understanding the different algorithms used, but could 
Marko's quick select implementation be improved in the same way as 
you described for quicksort ?

[snip]
>Mike Guy

Thanks,

Michel.


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

Date: Mon, 17 May 1999 18:07:17 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Sorting problem
Message-Id: <7hplsj$q3v$1@nnrp1.deja.com>

WOOPS!  Error in my previous submission.  Corrected below.


In article <7hom4b$g9g$1@fleetstreet.Austria.EU.net>,
  "Thomas Klinger" <t.klinger@mobilkom.at> wrote:
>
> foreach $techline (@techlines) {
>   ($type, $setnr, $technr, $subject, $s5, $s6, $s7, $note) = split
(/;/,
> $techline);
>   ...

Use a kind of Schwartzian Transform thing:

for (
    sort { $b->[2] <=> $a->[2] }
    map  { [ split /;/ ] }
    @techlines
) {
  my( $type, $setnr, $technr, $subject, $s5, $s6, $s7, $note ) = @$_;
  ...

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Mon, 17 May 1999 18:06:29 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Sorting problem
Message-Id: <7hplr4$pua$1@nnrp1.deja.com>

In article <7hom4b$g9g$1@fleetstreet.Austria.EU.net>,
  "Thomas Klinger" <t.klinger@mobilkom.at> wrote:
>
> foreach $techline (@techlines) {
>   ($type, $setnr, $technr, $subject, $s5, $s6, $s7, $note) = split
(/;/,
> $techline);
>   ...

Use a kind of Schwartzian Transform thing:

for (
    sort { $b->[2] <=> $a->[2] }
    map  { [ split /;/ ] }
    @techlines
) {
  my( $type, $setnr, $technr, $subject, $s5, $s6, $s7, $note ) = [$_];
  ...

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: 17 May 1999 11:34:37 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Sorting problem
Message-Id: <m13e0vpmte.fsf@halfdome.holdit.com>

>>>>> "John" == John Porter <jdporter@min.net> writes:

John> In article <7hom4b$g9g$1@fleetstreet.Austria.EU.net>,
John>   "Thomas Klinger" <t.klinger@mobilkom.at> wrote:
>> 
>> foreach $techline (@techlines) {
>> ($type, $setnr, $technr, $subject, $s5, $s6, $s7, $note) = split
John> (/;/,
>> $techline);
>> ...

John> Use a kind of Schwartzian Transform thing:

John> for (
John>     sort { $b->[2] <=> $a->[2] }
John>     map  { [ split /;/ ] }
John>     @techlines
John> ) {
John>   my( $type, $setnr, $technr, $subject, $s5, $s6, $s7, $note ) = [$_];
John>   ...

That would seem to be more of a Porter-nization, rather than a
Schwartzian Transform. :) Without that third map, you're not getting
anywhere close to the canonical form. :)

so sayeth Randal L "map-sort-map" Schwartz... :)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Mon, 17 May 1999 10:21:00 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Wassim Metallaoui <wassimk@iname.com>
Subject: Re: The Sendmail Program
Message-Id: <37404FFC.4BC71709@mail.cor.epa.gov>

[courtesy cc sent to poster]

Wassim Metallaoui wrote:
> 
> Can anyone tell me what
> 
> open (MAIL, "|$mailprog -t")
> 
> does? I am wondering about the pipe and the -t
> 
> What I am wanting to do is send out an e-mail to everyone listed in a text
> file.
> I was told to do it using the sendmail program that way.. But I don't
> understand it.
> Who cares if it works if I don't know how it works! :-)

Good attitude.  I like that.  

When you're using sendmail, the -t option in your linesays 
for sendmail to use the headers you're including in order to 
decide who to send the message to.

The pipe works like the pipe in your shell.  You'll want to
read the section on open() in perlfunc.  Try these commands:

perldoc perldoc
perldoc perl

to learn about the perldoc program for reading the docs,
and some of the extensive perl documents that come with your
Perl install.  TomC hates perldoc, so he'll feel better if
you read the docs using `man'.

You'll also want to read the FAQ (Frequently Asked Questions
- with extensive answers).  In particular, try this:

perldoc perlfaq9

to get a bunch of answers on network-ish topics, including
one on "How do I send mail?" which is virtually written to
answer your questions.
 
> Also they said something about using $pid and $pid=fork();
> what does that mean and how would I incorporate it into my mailing list
> program.

You can read about fork() in the perlfunc section.  But
if you don't know about unix's fork-exec model for child
processes, you'll need to read up on it elsewhere, or copy
quite carefully some of the working fork() code in the FAQ
and the other on-line Perl docs.  Try reading the perlipc
section and see if that makes sense to you.
 
> Can you please e-mail wassimk@iname.com or post a reply.

Both done.
 
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 17 May 1999 10:02:18 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Arved Sandstrom <Arved_37@chebucto.ns.ca>
Subject: Re: TROLL ALERT (Re: Perl "constructors")
Message-Id: <37404B9A.C0511C24@atrieva.com>

Arved Sandstrom wrote:
> 

> Why is this a troll?

Because the behavior of this particular person is well known.  Same guy
got trashed here a few months back for the same pattern of behavior,
except then he was mad that Perl wasn't VisualBasic.  

The short story is this.  He's an unemployed accounting aide who knows a
little VB, and can't figure out why we don't consider him an expert. 
And he *still* can't seem to figure out the documentation.

> But a fixed name for an object constructor ('new') is a feature of C++ and
> Java, for example. Why should Perl be defiantly different?

Because Perl is not Java or C++.
 
> More to the point, what's wrong with having a discussion over the issue?

Nothing, when it's people who know what they are talking about having
the discussion.  Armchair ain't that guy.

> Just to put my 1.5 CAN cents on the table, I like the ability to call a
> constructor anything, because sometimes "new" is not intuitive. But that's
> just me.

It's me, too.  When I wan't it otherwase, I pick a different tool.



-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5702
**************************************

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