[11512] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5112 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 11 14:07:23 1999

Date: Thu, 11 Mar 99 11:01:31 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 11 Mar 1999     Volume: 8 Number: 5112

Today's topics:
    Re: newbie help request (Abigail)
    Re: Online guide for newbie in Perl (Clay Irving)
    Re: Perl scripts written for UNIX. Will they work on NT <cassell@mail.cor.epa.gov>
        perl to c compiler; where do you get it? <sbharvey@west.raytheon.com>
        perldoc from stdin senthilvel@hotmail.com
    Re: problems with readdir (Bart Lateur)
        Scheduled Task bhoyle@huntersville.org
        Setting target to 2 frames swamichandra@my-dejanews.com
    Re: Setting target to 2 frames (brian d foy)
    Re: test if a string is in an array? <aqumsieh@matrox.com>
    Re: test if a string is in an array? <cassell@mail.cor.epa.gov>
    Re: URGENT! Where Do You Hide The CGI Cards From The Sp chris+usenet@netmonger.net
        Web POP3 client and Web searchengine <joe@ispsoft.de>
        write/format bypasses tie? (Sean McAfee)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 11 Mar 1999 18:21:11 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: newbie help request
Message-Id: <7c91in$ar2$2@client2.news.psi.net>

cathal coughlan (c.coughlan@ucl.ac.uk) wrote on MMXVII September MCMXCIII
in <URL:news:01be6b3d$bc965b20$86c666c3@e-base.u-net.com>:
{} Hi,
{} 
{} Sorry to just barge into the group, but desperation and a looming deadline
{} just got
{} the better of me...

Ah, yeah, and Usenet is a very quick response media.... Especially
with subjects like 'newbie help request', that makes it clear what
kind of question you have!

{} I wonder if anyone could find the time to help me out with this script. It
{} presently searches a formatted textfile database quite efficiently, using
{} one variable value sent from a HTML form.
{} 
{} However... now I need it to accept values of TWO variables from a HTML
{} form, though, and
{} carry out a joined search (a Boolean AND, in effect), returning the records
{} which meet both criteria.
{} 
{} Here's the script:

Goodie. What's the question about the script? Did you actually _try_
something yourself? If so, what? Did it work? Why not?

{} #!/bin/perl

You are missing -Tw. You are missing 'use strict;'.

{} # requires cgi-lib.pl
{} require "cgi-lib.pl";

You are not doing 'use CGI;'.

Strike 3. You're out.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: 11 Mar 1999 12:06:38 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Online guide for newbie in Perl
Message-Id: <slrn7efu0u.2lo.clay@panix.com>

On Thu, 11 Mar 1999 15:35:07 GMT, marco_costa@my-dejanews.com 
<marco_costa@my-dejanews.com> wrote:

>I need a guide wich I could dowload to learn Perl, I've tried the man pages,
>but  it is not intended for a newbie!

There are several tutorials in the `tutorials' section of Perl Reference:

    http://reference.perl.com/query.cgi?tutorials

ps. Tom just posted an FAQ about this the other day...

-- 
Clay Irving <clay@panix.com>
The cat could very well be man's best friend but would never stoop to
admitting it. 
- Doug Larson 


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

Date: Thu, 11 Mar 1999 10:26:09 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Perl scripts written for UNIX. Will they work on NT?
Message-Id: <36E80AC1.4F1F7CE2@mail.cor.epa.gov>

David Turley wrote:
> In article <MPG.1150f613d18afc7d989720@nntp.hpl.hp.com>,
>   lr@hpl.hp.com (Larry Rosler) wrote:
> > Ignore this advice.  Do not use '\' as the pathname separator.  It is
> > error-prone and unnecessary. 
> 
> I wonder why people started doing this anyway? Did an older version of win32
> (win16?) Perl force DOS-type slahes?

I would have said that 'an older version of MS-DOS' was the force behind the
backslashes, rather 'an older version of win.. Perl'.  Believe me, it used to
be a nuisance jumping back and forth from DOS to 4DOS to unix, and keeping track
of who wanted which slashes where.  I love legacy OS features.  :-)
 
-- 
David

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


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

Date: Thu, 11 Mar 1999 08:59:21 -0800
From: Scott Harvey <sbharvey@west.raytheon.com>
Subject: perl to c compiler; where do you get it?
Message-Id: <36E7F669.17DC@west.raytheon.com>

Does the perl to c compiler work on Linux.  Any pitfalls?  Is there
another way to compile perl scripts to machine execuatable form?

Thanks

Scott Harvey


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

Date: Thu, 11 Mar 1999 17:52:07 GMT
From: senthilvel@hotmail.com
Subject: perldoc from stdin
Message-Id: <7c8vs2$cq6$1@nnrp1.dejanews.com>

Hi:

I was wondering if there is a way to make perldoc or pod2man read from
stdin.

Thanks,
 ..Senthil.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 11 Mar 1999 18:39:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: problems with readdir
Message-Id: <36e909a7.850348@news.skynet.be>

jstrike@execpc.com wrote:

>$filetype = ".pdf";
>local (@catagories) = grep(/$filetype$/, readdir(DIR));

This is a bit beside the point, but on PC you'd better make a
case-insensitive test. And be aware of that dot in the pattern. My
suggestion:

	local @catagories = grep { /\Q$filetype\E$/i } readdir(DIR);

	Bart.


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

Date: Thu, 11 Mar 1999 18:44:58 GMT
From: bhoyle@huntersville.org
Subject: Scheduled Task
Message-Id: <36e80e81.166522727@207.227.203.4X>

This could be simple, but I can't find it.

I currently have a script that, when invoked, will go retrieve a file
on another server, parse the information and present it to the user.
The problem is, this server is slow, and the file is only updated
hourly.

Can I set up a routine that will automatically go retreive this file
(shortly after it is updated) each hour so the user script will just
open it from the host server? Is there a process or loop that will run
all the time?

Thanks in advance.


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

Date: Thu, 11 Mar 1999 17:54:44 GMT
From: swamichandra@my-dejanews.com
Subject: Setting target to 2 frames
Message-Id: <7c900u$cs2$1@nnrp1.dejanews.com>

Using CGI.pm how can I set the target of a form action to 2 frames.

>>Swami.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 11 Mar 1999 13:50:20 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Setting target to 2 frames
Message-Id: <comdog-ya02408000R1103991350200001@news.panix.com>

In article <7c900u$cs2$1@nnrp1.dejanews.com>, swamichandra@my-dejanews.com posted:

> Using CGI.pm how can I set the target of a form action to 2 frames.

see the CGI FAQ which is convenietly referenced in the CGI Meta FAQ.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Thu, 11 Mar 1999 10:58:56 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
To: "David Lambert" <dalambert@rocketmail.com>
Subject: Re: test if a string is in an array?
Message-Id: <x3yvhg8dnlv.fsf@tigre.matrox.com>


"David Lambert" <dalambert@rocketmail.com> writes:

> What is the most efficient way to test for the occurrence of a string in an
> array?  I want to use an if statement to take some action if the value of
> $hostname is anywhere in an array called @etchosts, which was input from the
> file /etc/hosts and looks like a typical /etc/hosts file.

TMTOWTDI.

1) if (grep { /$hostname/ } @etchosts) {
	....
   }

This is not the most efficient way as it cycles through the entire
array, even if the first element matches $hostname.

2) You could've read /etc/hosts into a scalar $etchosts (instead of
array @etchosts) and then:

	if ($etchosts =~ /$hostname/) {
		...
	}

3) $etchosts = "@etchosts";

	if ($etchosts =~ /$hostname/) {
		...
	}

I'm sure there are more options here, but I won't list everything I
can think of (not that I am thinking of much right now).

HTH,
Ala



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

Date: Thu, 11 Mar 1999 10:37:31 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: test if a string is in an array?
Message-Id: <36E80D6B.166817F6@mail.cor.epa.gov>

Ala Qumsieh wrote:
> "David Lambert" <dalambert@rocketmail.com> writes:
> > What is the most efficient way to test for the occurrence of a string in an
> > array?  I want to use an if statement to take some action if the value of
> > $hostname is anywhere in an array called @etchosts, which was input from the
> > file /etc/hosts and looks like a typical /etc/hosts file.
> 
> TMTOWTDI.
> 
> 1) if (grep { /$hostname/ } @etchosts) {
 [snip]

Ala is certainly right that There Is More Than One Way To Do It (TMTOWTDI).  But
since you asked about efficiency, I suggest you use perldoc to read in perlfaq4
the section titled 'How can I tell whether an array contains a certain element?'
You'll find a couple nice, efficient pieces of code there.  In particular,
you'll 
note that Ala's suggestion #1 is deprecated.

I'm sure you looked in the docs and just overlooked this information.  There is
so
much info provided.  But I have found that three minutes spent using perldoc is
much more rewarding than thirty hours waiting for someone to post a reply -
which
may just say 'perldoc perlfaq4' anyway.  :-)
-- 
David
 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 11 Mar 1999 18:56:54 GMT
From: chris+usenet@netmonger.net
Subject: Re: URGENT! Where Do You Hide The CGI Cards From The Spiders?
Message-Id: <7c93lm$8s2$1@schenectady.netmonger.net>


In article <36dfaa9c.8298398@news.skynet.be>,
Bart Lateur <bart.lateur@skynet.be> wrote:
> Larry Rosler wrote:
> 
> >Would it be possible for you to show us the man page for crypt on your 
> >FreeBSD system?  A web search didn't turn one up for me.
> 
> See for yourself.
> 
> 	http://www.mediamind.be/cgi-bin/media/man.pl?crypt
> 
> Something does look not too kosher.

What's not kosher is the documentation.

FreeBSD's crypt() uses MD5 by default, which is more secure, and
unencumbered by export restrictions.  If you have installed the
"secure" distribution set, your crypt library gets overwritten by one
that defaults to DES instead.

The MD5-based implementation:

http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libcrypt/crypt.c?rev=1.9

The man page was actually updated to reflect reality, along with
some additions to the crypt library, but it was backed out:

http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libcrypt/Attic/crypt.3?rev=1.1

Um.  Perl.
-- 
	    Christopher Masto <chris+usenet@netmonger.net>
	Director of Operations, NetMonger Communications, Inc.

		     "Behold the Power of Cheese"


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

Date: 11 Mar 1999 18:38:20 GMT
From: Jochen Wiedmann <joe@ispsoft.de>
Subject: Web POP3 client and Web searchengine
Message-Id: <7c92is$c5k$1@play.inetarena.com>


Hi,

I'd like to announce version 0.1125 of the HTML::EP system. EP is
another Embedded Perl system similar to ePerl, HTML::EmbPerl,
HTML::Mason, Apache::ASP or Apache::SSI with the main target on
OO design and code reusability.

Besides a lot of other changes the current release includes

  HTML::EP::Example::POP3Client - a web based POP3 client,
	see http://www.ispsoft.de/EP/pop3 for a working
	example; it is internally using the Mail::POP3Client
	module from Rodger Anderson <rodger@boi.hp.com>.

and

  HTML::EP::Example::Glimpse - a small search engine based on
	Glimpse, see http://www.ispsoft.de/EP/Glimpse for
	a working example.

The package is available from any CPAN mirror, in particular

	ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/JWIED


Bye,

Jochen



-- 
Jochen Wiedmann						joe@ispsoft.de
"How could this be a problem in a country where		+49 7123 14887
we have Intel and Microsoft?" (Al Gore, Vanity Fair,
January 1999 issue, talking about Y2K)




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

Date: Thu, 11 Mar 1999 18:48:37 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: write/format bypasses tie?
Message-Id: <9eUF2.11007$Ge3.43591240@news.itd.umich.edu>

----------------------------------------------------------------------
use IO::Scalar;

# tie *STDOUT, 'IO::Scalar', \$x;
print "Testing, testing...\n";
write;

format STDOUT =
1, 2, 3
 .
----------------------------------------------------------------------

When I run this code, I get two lines: "Testing, testing..." and "1, 2, 3".
If I uncomment the "tie" line, though, the "Testing, testing..." line goes
into $x, but I still get "1, 2, 3" on my terminal.

Is this a bug, or am I missing something totally obvious?  (I'm using Perl
5.005_02, btw.)

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

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

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