[9343] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2938 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 22 20:07:50 1998

Date: Mon, 22 Jun 98 17:00:43 -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, 22 Jun 1998     Volume: 8 Number: 2938

Today's topics:
    Re: -f option in perldoc (Charles DeRykus)
        broken types.ph <timh@amgen.com>
    Re: case-insensitivity (Martien Verbruggen)
    Re: diff-like utility in Perl? (Jonathan Stowe)
    Re: E-Mail Validation (easy question) <aqumsieh@matrox.com>
    Re: Finding a string within a string (Martien Verbruggen)
    Re: first language (Lawrence Kirby)
    Re: first language (Abigail)
    Re: Flames.... (Leslie Mikesell)
    Re: Flames.... (stewart wills)
    Re: Flames.... <rootbeer@teleport.com>
    Re: Flames.... <ljz@asfast.com>
    Re: How to find last modified date of a file? (Martien Verbruggen)
    Re: How to make Web work with "rsh" in Perl <peng@cae.cig.mot.com>
    Re: HTML form and Perl script send data to another Perl <rootbeer@teleport.com>
    Re: htpasswd in perl? <rootbeer@teleport.com>
    Re: Is there any ready for use perl script for this? <rootbeer@teleport.com>
    Re: pattern and variable question <psdspss@execpc.com>
        pattern matching with substr Juli@my-dejanews.com
    Re: Pod::Text -- Unix only? (Martien Verbruggen)
    Re: Q: Can I run Perl program regularly? <igor.k@usa.net>
    Re: Q: Can I run Perl program regularly? (Jonathan Stowe)
    Re: Q: Can I run Perl program regularly? <tchrist@mox.perl.com>
    Re: RTF parsing <p-fein@uchicago.edu>
    Re: Script to get all IP addesses in Router-Network (Martien Verbruggen)
    Re: Sending mail in Perl <barnett@houston.Geco-Prakla.slb.com>
    Re: Storing and passing object references - html crap <rootbeer@teleport.com>
        the ?PATTERN? match syntax topher67@my-dejanews.com
        Warnings from environment variables under -w <steph@hotkey.net.au>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 22 Jun 1998 21:44:59 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: -f option in perldoc
Message-Id: <Euz32z.JDB@news.boeing.com>

In article <358EA3B1.1DA4F4C9@matrox.com>,
Ala Qumsieh  <aqumsieh@matrox.com> wrote:
>Hi all,
>
>In many of the replies, I noticed that people use 
>
>% perldoc -f <func>
>
>to search for help on a specific function <func>. So, I tried it .. and
>this is what I got:
>
>% perldoc -f stat
>Unknown option: f
>perldoc [-h] [-v] [-u] PageName|ModuleName|ProgramName...
>    -h   Display this help message.
>    -t   Display pod using pod2text instead of pod2man and nroff.
>    -u   Display unformatted pod text
>    -m   Display modules file in its entirety
>    -v   Verbosely describe what's going on.
>PageName|ModuleName...
>         is the name of a piece of documentation that you want to look
>at. You 
>         may either give a descriptive name of the page (as in the case
>of
>         `perlfunc') the name of a module, either like `Term::Info', 
>         `Term/Info', the partial name of a module, like `info', or 
>         `makemaker', or the name of a program, like `perldoc'.
>         
>Any switches in the PERLDOC environment variable will be used before the 
>command line arguments.
>
>Why don't I have the -f option? Do I have an obsolete version of
>perldoc?
>

Try:     perldoc -m perldoc|grep getopts

Compare with current output:   

         getopts("mhtluvf:") || usage;


HTH,
--
Charles DeRykus


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

Date: Mon, 22 Jun 1998 15:43:27 -0700
From: Tim Helton <timh@amgen.com>
Subject: broken types.ph
Message-Id: <358EDE0F.3591@amgen.com>

We just started using shared memory with perl ... semget,
semop, shmget, shmread and shmwrite.  Of course, we 
required 'sys/ipc.ph' which in turn required 'sys/types.ph'.

When this require executed, we found that the perl 
interpreter complained with the following message:

	Number found where operator expected at (eval 12) line 1, 
		near ")0" (Missing operator before 0?)

which appears to concern line 59 in types.ph which reads:

	 eval 'sub P_MYPID () {(( &pid_t)0);}';

changing this line to 

	 eval 'sub P_MYPID () {(( &pid_t)(0);}';

(that is to say, inserting a '(' between '&pid_t' and '0')
seems to make the interpreter happy.

My questions are:

1)  Was that the right thing to do?
2)  Is this a known bug in the h2ph module?
3)  Or did we do something wrong on installation?

Output of perl -V is appended after my signature.

Thanks for your help.

Tim

*****************************************************************
Output of perl -V
*****************************************************************
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos neptune 5.6 generic_105181-03 sun4u sparc sunw,ultra-30
'
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-g -O', gccversion=2.8.1
    cppflags='-DDEBUGGING -I/usr/local/include'
    ccflags ='-DDEBUGGING -I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING
  Built under solaris
  Compiled at Apr 29 1998 15:59:43
  %ENV:
    PERL5HOME="/usr/amgen/perl5"
  @INC:
    /usr/amgen/perl5/5.004_4/lib/sun4-solaris/5.00404
    /usr/amgen/perl5/5.004_4/lib
    /usr/amgen/perl5/5.004_4/lib/site_perl/sun4-solaris
    /usr/amgen/perl5/5.004_4/lib/site_perl
    .


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

Date: 22 Jun 1998 22:58:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: case-insensitivity
Message-Id: <6mmnhq$k44$2@comdyn.comdyn.com.au>

In article <6ml3h9$3lk$1@info.aom.ericsson.se>,
	Jonas Kihlsten <"qtxjoki"@vg.ao,.ericsson.se> writes:
> Does anyone know how to ignore case-sensivity when scaning through a
> textfile?

Perl doesn't really provide a function to 'scan through a text file'.
It does however have a few string manipulation and scanning routines.

If you use a rexexp to 'scan' your string, have a look at the i
modifier, as documented on the first page of the perlre documentation

# perldoc perlre

If you want to check wether strings are equal, disregarding case, you
can either do a regex match, or match the uppercased or lowercased
versions:

if (uc($str1) eq uc($str2)) { }
if (lc($str1) eq lc($str2)) { }

For some reason I prefer the second. Maybe I just have an aversion to
all uppercase strings. Even if I never see them.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd.       | population.
NSW, Australia                      | 


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

Date: Mon, 22 Jun 1998 22:43:21 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: diff-like utility in Perl?
Message-Id: <3586b74f.885445@news.btinternet.com>

On 16 Jun 1998 07:58:36 +0100, Jim Brewer wrote :

>Gellyfish@btinternet.com (Jonathan Stowe) writes:
>
>> I must admit that I took the original posters question to mean whether
>> it was possible to fulfill a lack of "diff" on the Windows platform
>> with something written in Perl - which is of course unnecessary.  
>
>Just to stir it a bit: Where in the original post was Windows, or any
>OS, made? Or any mention of a lack of 'diff'? The answer was pretty
>simple by the looks of the responses. Sorry sir, no such function
>exists, please try later.
>
There's some Meta-textual information that just comes to me when I
look at the headers on posts - call it a psychic thing.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Mon, 22 Jun 1998 17:33:47 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: E-Mail Validation (easy question)
Message-Id: <358ECDBB.9A15A910@matrox.com>

David Hamilton wrote:
> 
> Hello,
> 
>         I am very stupid at PERL and I have the following code to do
> something if an E-Mail address exists and is in valid format:
> 
> if ($INPUT{'email'}) {
>  if ($INPUT{'email'} =~ /(.*)@(.*)/) {

Hmmm... if $INPUT{'email'} doesn't exist, then the second test will fail
anyway .. so you don't need the first if statement.

>  }
> }
> 
> My easy question is: how do I reverse this check (without simply adding
> an ELSE type thing) so that it will do something if $INPUT{'email'}
> doesn't exist or doesn't conform to: =~ /(.*)@(.*)/)
> 

If you read some documentation, you'll be able to solve your little
problem without the need to humiliate yourself in front of the world by
admitting your stupidity (of course this fact can be implied
indirectly).

unless ($INPUT{'email'}) { bla ..}
or
if (!$INPUT{'email'}) { bla .. }

> Please can someone E-Mail me with their answer to this.

I won't. You should be happy someone answered your question.

> 
> Thanks,
> From David Hamilton
> hamilton@melbpc.org.au

-- 
Ala Qumsieh		|  No .. not just another
ASIC Design Engineer	|  Perl Hacker!!!!!
Matrox Graphics Inc.	|
Montreal, Quebec	|  (Not yet!)


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

Date: 22 Jun 1998 23:16:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Finding a string within a string
Message-Id: <6mmol6$k8c$1@comdyn.comdyn.com.au>

In article <358CCC58.A46DE2E4@bnex.com>,
	Azman Shariff <azman@bnex.com> writes:

> the prob only lies wih he comparing part...... i used this (i don't know
> if it really works)
> 
> if (grep (/$searchstring/,$header){
>    print "$header";
> }

As

# perldoc -f grep

will tell you, grep is meant to get the elements from a list that
match certain conditions. Of course you could read all your lines in
an array, and then use grep, but I doubt that's what you want. If you
do something like:

	while(<IN>)
	{
		chomp;
		my ($head, $topic, $idno) = split /:/;

		if ($head eq $searchstring)
		{
			print $head;
		}
	}

This tests for $head to be exactly equal to the searchstring. If you
need case insensitive exact match, compare lc($head) to lc($ss). If
you need a regexp match, use something like:

	if ($head =~ /$searchstring/) {}

Back to the whole file at once with a grep:

	open(IN, "search.index") || die "Couldn't open search.index: $!";

	# You might need to adapt this to do what you want.
	# This matches the whole head part.
	#
	my @matches = grep { /^$searchstring:/ } <IN>;

	foreach my $match (@matches)
	{
		chomp($match);
		my ($head, $topic, $idno) = split /:/, $match;

		print "Head: $head, Topic: $topic, IdNo: $idno\n";
	}

input:
foo:bar:12
bar:doo:23
foobar:doo:34
foo:glop:24

output:
Head: foo, Topic: bar, IdNo: 12
Head: foo, Topic: glop, IdNo: 24

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd.       | am.
NSW, Australia                      | 


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

Date: Mon, 22 Jun 98 21:49:58 GMT
From: fred@genesis.demon.co.uk (Lawrence Kirby)
Subject: Re: first language
Message-Id: <898552198snz@genesis.demon.co.uk>

In article <6mm281$ls2@espresso.cafe.net> kaz@cafe.net "Kaz Kylheku" writes:

>In article <898514364snz@genesis.demon.co.uk>,
>Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
>>>Because the precursors of C dealt only in words, not types of
>>>varying sizes.  
>>
>>I think more fundamentally you would end up with a very odd language if
>>pointer arithmetic did work in bytes. I think the decision would be the same
>>for any language high level language that supports pointer arithmetic,
>>even for a language with no historical baggage.
>
>No, you would end up with BCPL! Hardly odd at all. In BCPL, a pointer refers
>to a cell, and arithmetic works in cell units.

And BCPL supports vectors of cells. Pointer arithmetic works in units of
cells (i.e. the array/vector element unit), not bytes or characters.
Indeed BCPL was the ``historical baggage'' I was thinking of specifically
above.

>Scaling for aggregates is done
>the hard way. :)

That's because the language has rather limited support for this sort of
thing built in. WHat support it does have is, I believe, consistent with
my statement above (although my BCPL is a little rusty these days).

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------



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

Date: 22 Jun 1998 22:21:12 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: first language
Message-Id: <6mmlco$hrl$7@client3.news.psi.net>

Chris Engebretson (engebret@sg1.cr.usgs.gov) wrote on MDCCLVI September
MCMXCIII in <URL: news:EuyxMD.HKy@igsrsparc2.er.usgs.gov>:
++ 
++ K&R2 is certainly an excellent book, and can be considered the de
++ facto C reference (ISO and ANSI standards notwithstanding.)  It
++ may not be quite enough for the virgin C programmer to get up to
++ speed, however.  Perhaps the most useful way for a new C programmer
++ to use K&R is to keep it within reach while going over a piece of
++ well-written, well-documented C code.


It probably also depends on your prior knowledge and experience.  K&R may
be too terse if C is your second language, and your previous language
was Lisp. It's enough for someone knowing 5 different ALGOL derivates
and having 7 years of programming experience.

For everyone else in between, the answer whether K&R is enough to
learn C from is "maybe".



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 22 Jun 1998 17:38:35 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Flames....
Message-Id: <6mmmdb$an7$1@Venus.mcs.net>

In article <Pine.GSO.3.96.980621185146.6898G-100000@user2.teleport.com>,
Tom Phoenix  <rootbeer@teleport.com> wrote:
>On 21 Jun 1998, Leslie Mikesell wrote:
>
>> Is there something about a 'misc' newsgroup that excludes questions
>> about cgi and non-unix systems?
>
>No, the rule is that a questioner should look in the most appropriate
>place for their answer. If it's a question about CGI programming, the
>docs, FAQs, and newsgroups about that are going to be more appropriate
>than a newsgroup about Perl. 

Does that mean it would be a really bad idea to go the to Perl
Conference to learn about CGI programming --- in spite of the
fact that the agenda seems to be mostly web-related? 

  Les Mikesell
    les@mcs.com


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

Date: 22 Jun 1998 18:57:32 -0400
From: stewartw@ldeo.columbia.edu (stewart wills)
Subject: Re: Flames....
Message-Id: <6mmngs$fca$1@chick.ldgo.columbia.edu>




Perhaps it's odd to delurk in the midst of this rather passionate thread;
I'll try to keep it short.  I've been a reader of this newsgroup for about
three years now (roughly as long as I've been using Perl), and I hoped I might
add a perspective that's sometimes lost in the "how to handle faqs" debate
(though I have no illusions that I'm going to change anyone's mind).

First a bit of background.  As noted before, I've been using Perl for about
three years, and learned what I know the same way I learned other programming
languages:  bought a book or two, read the freely available documentation on my
system and on the Web, and struggled until my codes started to work.  Like many
posters to this group, I figured out long ago that the only way really to learn
something is to discover it for yourself (it's also the most *fun* way to
learn).  I am an unabashed fan of Perl; it's an amazing tool -- truly "the
language for getting your job done."  The documentation, too, is incredible.  I
learned more from the blue Camel -- not just about Perl, but about good
programming practice in general -- than I have learned from any other
programming book.  So I have a fair amount of sympathy with the frustration
often vented on this newsgroup when someone posts a faq; that's *not* the way to
learn.

In short, if I've understood the many previous posts on this issue, I am the
archetypal "good learner":  I work through my problems myself using the ample
available documentation, rather than nagging the good folks on c.l.p.m. with an
inane "newbie needs help" query.  Now here's the ironic part:  *I will probably
never post a question on this newsgroup.*  That's not because I'm so smart that
I'll never need the help, and not because the docs are so good that I'll never
come up with a question they don't answer.  It's because I have no desire to
have one of the sharp-tongued gurus here tell me what a dumbass I am if the
answer *does* happen to be buried in a man page somewhere.

To me, that's the case for quietly ignoring faq-posters, rather than flaming
them, in a nutshell.  It's not because the flames are often excessively rude and
cruel, and not because they unquestionably lower the signal-to-noise ratio
(probably more than the faqs themselves).  It's because in such a hostile and
intimidating environment, some intelligent and interesting questions are going
to go unasked.  Let's face it; nobody particularly enjoys public humiliation
(well, nobody I know, anyway).  I haven't noticed that all the flames have
reduced the number of faqs or off-topic posts, but they may have persuaded at
least a few posters who *have* read c.l.p.m. for a while that, no matter how
potentially constructive their question, it isn't worth the risk of asking it.

One solution is to establish the moderated group; another is to send the
auto-response mini-FAQ and, beyond that, ignore anything that seems to be
sufficiently answered in the docs.  I vote for both.

Now back to lurkland -- where I will eagerly scan my inbox for my own copy of
the mini-FAQ, and for the "courtesy cc's" of any flames that are prompted by
this posting. ;)

Stewart Wills


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

Date: Mon, 22 Jun 1998 22:58:53 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Flames....
Message-Id: <Pine.GSO.3.96.980622155331.3398D-100000@user2.teleport.com>

On Mon, 22 Jun 1998, Brand and Karina Hilton wrote:

> In article <Pine.GSO.3.96.980621184512.6898D-100000@user2.teleport.com>,
> Tom Phoenix  <rootbeer@teleport.com> wrote:
> >On Sun, 21 Jun 1998, Brand and Karina Hilton wrote:
> >
> >> Perhaps the mini-FAQ should be posted rather than mailed.  
> >
> >If someone doesn't read what's already being posted, why 
> >would additional (identical) postings help anyone? 
> 
> They don't read what's being posted because it's not in response to
> their question.  Stupid and inconsiderate, but true.  I'm assuming 
> they'll read the responses to their question.

But you said "posted rather than mailed". So your contention is
that they're not reading their _mail_? And you're suggesting that,
whenever a new person posts to the newsgroup, we post the same mini-FAQ to
the newsgroup again? I must be misunderstanding you.

> Actually, I've talked myself out of it anyway. 

Oh, good. Now I can stop trying to figure out what you meant. :-)

> The problem Tom C.  brought up was that munged addresses often keep
> newbies from getting the mini-FAQ. 

Maybe we should invest a little effort to develop a savvy address
_de_munger. That would make everyone happy. :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 22 Jun 1998 19:35:51 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Flames....
Message-Id: <lt67htui08.fsf@asfast.com>

Tom Phoenix <rootbeer@teleport.com> writes:

> On Mon, 22 Jun 1998, Brand and Karina Hilton wrote:
> 
> > [ ... ]
> >
> > The problem Tom C.  brought up was that munged addresses often keep
> > newbies from getting the mini-FAQ. 
> 
> Maybe we should invest a little effort to develop a savvy address
> _de_munger. That would make everyone happy. :-)

Well, almost everyone. :)

I think that it would be much more worthwhile for effort to be
expended towards creating an intelligent frequently-asked-question
finder.  Those who don't like seeing so many of these questions here
in c.l.p.m could then use this wonderful new tool to auto-killfile all
the posts from "newbies" that they don't want to see.

Come to think of it, the proposed c.l.p.moderated might very well be
such a tool.  :)

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: 22 Jun 1998 23:01:43 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How to find last modified date of a file?
Message-Id: <6mmnon$k44$3@comdyn.comdyn.com.au>

In article <j6x1eHAq6nj1EwCl@alchemedia.co.uk>,
	"Richard G. Coleman" <richard@see.my.sig> writes:

> My apologies for the misunderstanding.
> 
> As it happens, my provider (Demon Internet UK) does not support perldoc
> from the terminal screen.

Then complain loudly.  Also check the version of your perl. It might
just be incredibly old.  You can always install a copy of perl on your
own machine, and have the documentation locally.  You can always go to
www.perl.com and read the documentation there, which in my opinion is
much inferior to installing it yourself.

Go to http://www.perl.com/, Get the latest version of perl for your
system, and install it. You won't regret it.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd.       | thing but mean your mother.
NSW, Australia                      | 


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

Date: Mon, 22 Jun 1998 17:18:37 -0500
From: Ying Peng <peng@cae.cig.mot.com>
Subject: Re: How to make Web work with "rsh" in Perl
Message-Id: <358ED83D.4036A3EB@cae.cig.mot.com>

Tom Phoenix wrote:
> 
> On Fri, 19 Jun 1998, Ying Peng wrote:
> 
> > The problems I am having are that the file cannot be generated via
> > Web(call request.cgi) and "rsh" doesn't work (do nothing) when you click
> > the submit button in the Web form.
> 
> When you're having trouble with a CGI program in Perl, you should first
> look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
> such problems. It's available on CPAN.
> 
>    http://www.perl.com/CPAN/
>    http://www.perl.org/CPAN/
>    http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
>    http://www.perl.org/CPAN/doc/manual/html/pod/
> 
> > The problems might relate to how to make "web" run the CGI or Perl
> > scripts as root.
> 
> Concerning security issues, that is generally considered a Bad Thing.
> 
> Hope this helps!
> 
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/

Thanks for your info. But I might not write my problme more clearly
resulting in you thinking my question is Idios. I read though the URLs
you provided to me, unfortunately none of them help me find a solution
to solve my problem. The key issue is described below:

the CGI script has to be called by HTML(web
form) under the httpd control. As you know the http daemon can not be
run as root, but in my CGI script I have to use such command "rsh
workstation ls
/home/login". The /home/login might be 0700. "http" as an user has no
right to access  any directories or files with 0700. Do you have any
suggestion to work arund it? 

Thanks

--Ying


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

Date: Mon, 22 Jun 1998 23:03:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: HTML form and Perl script send data to another Perl script
Message-Id: <Pine.GSO.3.96.980622160149.3398E-100000@user2.teleport.com>

On Mon, 22 Jun 1998, p wrote:

> I have a form, where some information can be entered. I then want to
> send that information plus some additional information to another Perl
> script. How do I do that?

You probably want to write a program which handles the information and
passes it on somehow. I'd guess that some of the modules on CPAN, like the
ones in the LWP bundle, might be useful for you. Hope this helps!

> Remove the 'x' from the email address, if you want to send a
> non-commercial email. 

Remove the 'x' from the email address, if you want to get replies by
email. :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 23:30:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: htpasswd in perl?
Message-Id: <Pine.GSO.3.96.980622162322.3398H-100000@user2.teleport.com>

On Mon, 22 Jun 1998, Bart Lateur wrote:

> >use HTTPD::UserAdmin; # found in the CPAN
> 
> Damn strange name for a module to generate and store encrypted
> passwords. 
> 
> Why wasn't this called (for example):
> 
> 	use htpassword;

Well, module names should start with a capital letter, since lowercase is
reserved, by convention, for pragmas. More importantly, though, module's
names should only infrequently be a single word, since the top-level
namespace should be kept relatively small. In this case, it is a module
which works with an HTTPD (a webserver) and is used for administration
related to users, so the name works for me.

There are some guidelines for module names in the list of modules on CPAN. 
I'm sure that this module's author consulted those guidelines before
naming it. Hope this helps! 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 23:21:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Is there any ready for use perl script for this?
Message-Id: <Pine.GSO.3.96.980622162050.3398G-100000@user2.teleport.com>

On Mon, 22 Jun 1998 dubing@lisco.com wrote:

> We would like a perl alias filter, which only alows certain users to
> Email to an alias list. Is there any ready for use perl script for doing
> this? 

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 17:00:15 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: pattern and variable question
Message-Id: <358ED3EF.F8F283E5@execpc.com>



Sylvain Juneau wrote:

> I need help:
> I have a variable called $last_line =
>
> Jun 22 15:50:48: FTP /users/ocean/incoming/ACAQ2B.Jun 22 15:50:48: FTP
> /users/ocean/incoming/ACAQ2B.GRB.22155044.info1 to
> public:/users/public/oceans/ACAQ2B.GRB...OK
>
> and I would like to test this variable using a matching pattern like
> /GRB/
>
> something like this:
>
> if ( $last_line has this pattern /GRB/) {print "SUCCES"}
> else{print "FAIL"}
>
> Thank you
> Sylvain
>
> e-mail sjuneau@microtec.net

I guess one approach could be extract the last line.(I assume that, when u
say last line, you mean lines are delimited '\n' chars.)

Look at the following snippet.
#!/usr/bin/perl

$para = "Jun 22 15:50:48: FTP /users/ocean/incoming/ACAQ2B.Jun 22
15:50:48: FTP
/users/ocean/incoming/ACAQ2B.GRB.22155044.info1 to
public:/users/public/oceans/ACAQ2B....OK ";

@lines = split (/\n/, $para);

# Last line would be the last element of array.
$last_line = $lines[$#lines];

if ($last_line =~ /(.)*GRB(.)*/)
{
    print 'Success';
}
else
{
    print 'Failure';
}

Hope that helps.

Deva



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

Date: Mon, 22 Jun 1998 23:12:46 GMT
From: Juli@my-dejanews.com
Subject: pattern matching with substr
Message-Id: <6mmode$gj0$1@nnrp1.dejanews.com>

$rep_last = "cones III";

$second = substr($rep_last,index($rep_last," "),4);
$second =~ tr/a-z/A-Z/;

open(LIST, "list.pl") || die "Can't open file $!";

while (<LIST>) {
    if (/$second/) {
        print "second found $second\n";
    }
}

What I'm trying to do is search a string to match a pattern in the file
list.pl For example if the string is cones III, I want to search list.pl for
III. Please email me at juli@my-dejanews.com.  Thanks!


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 22 Jun 1998 22:46:17 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Pod::Text -- Unix only?
Message-Id: <6mmmrp$k44$1@comdyn.comdyn.com.au>

In article <6mi5r4$hga$1@srv38s4u.cas.org>,
	lvirden@cas.org writes:
> 
> This is a common problem on Unix / X window system environment.  For instance,
> stty -a isn't of much use when I telnet from my workstation into

I suspect you have a bad implementation of telnet. Mine works fine.

> Wouldn't it be nice if xterm/rxvt/dtterm and so forth had an escape
> sequence to report it's size....

I don't know how they do it, but it works fine. On my xterm:

> stty
speed 9600 baud; evenp hupcl 
rows = 24; columns = 80; ypixels = 320; xpixels = 503;
erase = ^h; kill = ^x; swtch = <undef>; 
brkint -inpck icrnl -ixany imaxbel onlcr 
echo echoe echok echoctl echoke iexten 

[Resize to full screen height]

> stty
speed 9600 baud; evenp hupcl 
rows = 24; columns = 80; ypixels = 320; xpixels = 503;
erase = ^h; kill = ^x; swtch = <undef>; 
brkint -inpck icrnl -ixany imaxbel onlcr 
echo echoe echok echoctl echoke iexten 

The above work both locally, through telnet and through rlogin.

Again: I don't know where this information comes from, but it's
probably documented somewhere.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: Mon, 22 Jun 1998 15:08:28 -0700
From: "Igor Krivokon" <igor.k@usa.net>
Subject: Re: Q: Can I run Perl program regularly?
Message-Id: <6mmknk$7bg$1@news.ncal.verio.com>

Larry Rosler wrote in message ...
>In article <6mminc$3d2@fridge.shore.net>, Scratchie
><upsetter@ziplink.net> says...
>> D <dmgl@dmgl.kirov.ru> wrote:
>> : Dear Sir/Madam
>>
>> : How can I make a program that can run my Perl program regularly
(daily)?
>>
>> If you're on Unix, check out the man pages for cron and crontab.
>
>And if you're on Windows/DOS, look at 'at /every:...'.


Correction: 'at' is NT-only command (not Windows/DOS)

Igor Krivokon
<igor.k@usa.net>





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

Date: Mon, 22 Jun 1998 22:43:22 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Q: Can I run Perl program regularly?
Message-Id: <358ed90d.18171661@news.btinternet.com>

On Tue, 23 Jun 1998 01:24:25 +0400, D wrote :

>Dear Sir/Madam
>
Eh ?

>How can I make a program that can run my Perl program regularly (daily)?
>

The OS may provide some facility for you to do this - it would be more
appropriate to ask a local expert about this.  On some less well
provided systems such as Win 3.1* and Win95 no such provision has been
made - however no doubt you will be able to find one at your favourite
software archive.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: 22 Jun 1998 23:43:29 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Q: Can I run Perl program regularly?
Message-Id: <6mmq71$6id$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    "D" <dmgl@dmgl.kirov.ru> writes:
:How can I make a program that can run my Perl program regularly (daily)?

I don't see what this has to do with Perl.

How can I make a program that can run my python program daily?
How can I make a program that can run my C program daily?
How can I make a program that can run my Pascal program daily?
How can I make a program that can run my Fortran program daily?

The answer, of course, is using the cron(8) or at(1) program.  If you
don't have these programs, then you are trying to do programmer-like
things on an anti-programmer system, and thus are doomed.  

But this is unrelated to Perl.

--tom
-- 
"Those who do not understand Unix are condemned to reinvent it, poorly."
					--Henry Spencer


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

Date: Mon, 22 Jun 1998 22:08:05 GMT
From: Peter A Fein <p-fein@uchicago.edu>
Subject: Re: RTF parsing
Message-Id: <opghg1djdiy.fsf@harper.uchicago.edu>

mick@io.com (Michele Beltrame) writes:

> 
> Hallo!
> 
> I need a Perl module or function to parse RTF (Rich Text Format) or on
> second choice MS WinWord DOC files. Also a RTF->HTML converter would
> be helpful. Any advice?
> 

Decent RTF to HTML converters seem to be a bit of a rarity,
particularly for UNIX, for some reason.  I found a trialware one at
http://www.sunpack.com/RTF/.  It works ok. but required a bit of
customization for my purposes.  As for a perl converter/parser, I've
yet to find one, although I'd gladly help out on such a project.

-- 
Peter A Fein
I'm not in Chicago! Finger pafein@harper.uchicago.edu for contact info.


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

Date: 22 Jun 1998 23:04:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Script to get all IP addesses in Router-Network
Message-Id: <6mmntq$k44$4@comdyn.comdyn.com.au>

In article <diverdi-2206980946540001@tulip12.verinet.com>,
	diverdi@XTRsystems.com (Joseph A. DiVerdi, Ph.D.) writes:

> It's not clear exactly what you are lookign for... I am guessing here but
> this might help. Here is  script that I used to use a long time ago to
> periodically check a small local network where we had a Class C domain to
> see which machines were "alive". Please note that it's a shell script not
> a Perl script. (Of course, if I were to write it today it would be in
> Perl.) 

And of course, this script only tells you which machines respond to a
ping at the moment that your script runs. Not really which IP
addresses have or have not been allocated.

The only way to reliably do that is to keep a database of allocated IP
addresses. 

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.       | password?
NSW, Australia                      | 


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

Date: Mon, 22 Jun 1998 16:30:17 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: xholf03 <xholf03@vse.cz>
Subject: Re: Sending mail in Perl
Message-Id: <358ECCE9.AEB05EA7@houston.Geco-Prakla.slb.com>

xholf03 wrote:
> 
> Hello,
> week ago i've started to learn perl ... (so i don't know anything)
> I've got problem with sending mail. Please, could you tell me what's wrong
> with this?
> 
> #!/usr/bin/perl -w
> $from = 'xholf03@sorry.vse.cz';
> $to = 'xholf03@vse.cz';
> 
> open (Mail, "/usr/bin/sendmail");
Well, several things wrong with the above line (keep in mind, I don't
know much about sendmail, so you might want/need other command line
options to make it do what you want):

1.  Always check for return codes on opens

2.  You are attempting to open a file called '/usr/bin/sendmail' for
reading when you access the Mail filehandle thusly:  print Mail "To: 
$to\n";

You should be receiving a lovely error message from perl complaining
about that bit.  If you don't then something is wrong with your version
of perl, I would wager.

3.  To open a program so you can give it data, you must open (MAIL,
"|/usr/bin/sendmail") to successfully open a 'pipe (|)' to that program.


HTH.

Dave
<snip>

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: Mon, 22 Jun 1998 23:39:00 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Storing and passing object references - html crap
Message-Id: <Pine.GSO.3.96.980622163737.3398J-100000@user2.teleport.com>

On Mon, 22 Jun 1998, Colin Kilburn wrote:

> Why the hell does Netscape let you send HTML
> and text at the same time anyway?

There's a bug in all recent versions of Netscape's newsreader: The 'post'
command is enabled. :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 22:14:57 GMT
From: topher67@my-dejanews.com
Subject: the ?PATTERN? match syntax
Message-Id: <6mml11$cff$1@nnrp1.dejanews.com>

Tom Phoenix said:

> Do you find yourself frequently using some algorithm
> in which that is not a good way to handle it?

Yes. When I am inside a "perl -p" script, and I want
to look for the first occurance of something in
each file.

> Can you give an example of a task for which an
> embedded option like this would be one of
> the best ways to handle the job?

Not off hand but flexability is what perl is all
about.  The main reason that it should be available
as an option is so that I can do something like:

      /(?i)PATT\?ERN/f

instead of:

     ?(\?i)PATT[\?]ERN?

For the above use, it does not have to be embeddable,
but like I said, that would add to its flexability.  I
suppose this is all moot however, as this feature
will never make it into perl -- sigh.

   -Chris



-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 23 Jun 1998 08:10:23 +1000
From: Stephan Carydakis <steph@hotkey.net.au>
Subject: Warnings from environment variables under -w
Message-Id: <358ED64F.55D5@hotkey.net.au>

Hello all,

My Problem:

I am writting a simple search engine script under use strict and -w.
I am declaring subs and vars with 'use vars qw' and 'use subs qw' or
with 'my' where appropriate. I am getting warnings(uninitialised value)
from references to environment variables. I wish to rid myself of these
warnings :]. I have tried including both %ENV and individual environment
variables in the 'use vars qw' list but this doesn't work.

1). Is there a way to get rid of these warnings caused by environment
variables?

2). Is it really necessary to get rid of these warnings?

Thanks for your time.

___________________________________________
Stephan Carydakis    steph@hotkey.net.au
___________________________________________


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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