[12343] in Perl-Users-Digest
Perl-Users Digest, Issue: 5943 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 10 07:07:42 1999
Date: Thu, 10 Jun 99 04:01:34 -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 Thu, 10 Jun 1999 Volume: 8 Number: 5943
Today's topics:
Re: Perldoc and Perlfaq <h.c.a.bokhoven@kpn.com>
Re: problem with html pop mail <anfi@bigfoot.com>
Re: Problems sorting. I'm stupid and I'll die (Sitaram Chamarty)
Q: How unlock flock of a other process (Henri Periat)
Re: quotemeta (Sitaram Chamarty)
Re: Regexpr for loop to handle e-address list dalehend@flash.net
Re: Sub on another drive (Bart Lateur)
Re: System command (Michel Dalle)
Re: Using CGI.pm (Sitaram Chamarty)
Re: VERSION numbers (I.J. Garlick)
Re: VERSION numbers <garethr@cre.canon.co.uk>
Re: waiting... (Larry Rosler)
Re: waiting... <rhrh@hotmail.com>
What's the "halting problem"? (Philip 'Yes, that's my address' Newton)
Re: What's the "halting problem"? <rra@stanford.edu>
Re: Where is sendmail on NT using Perl <gellyfish@gellyfish.com>
Re: Where is sendmail on NT using Perl <anfi@bigfoot.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 Jun 1999 12:42:02 +0200
From: Henk Bokhoven <h.c.a.bokhoven@kpn.com>
Subject: Re: Perldoc and Perlfaq
Message-Id: <375F967A.91501EDA@kpn.com>
"R.Joseph" wrote:
>
> I know this may sound stupid but I just got my hands on a copy of
> Slackware Linux, and I keep hearing much about "perldoc" and "perlfaq"
> and these things. Are these availible in Linux? If so, how would I go
> about using them? Any help is great, thanks.
"perlfaq" are man-pages.
Just type "perldoc" for the syntax, "perldoc perldoc" for ehr... yeah
right :) and "perldoc Net::NNTP" for info about that specific module.
HTH, cheers,
--
___ ___ __ | Henk C.A. Bokhoven, Groningen, NL
/ / / /____ (__)__ ___ | E-mail : hbokh at worldonline dot nl
/ /_/ / _ \/ /\ \/ / | day : HP-UX, Digital OSF1, Linux
\___,__/__//__/__/ /__/\__\ | night : Linux SuSE 6.1 on an i686
------------------------------
Date: Thu, 10 Jun 1999 12:32:21 +0200
From: Andrzej Filip <anfi@bigfoot.com>
Subject: Re: problem with html pop mail
Message-Id: <375F9435.772446A1@bigfoot.com>
Tarmo Mitt wrote:
> The problem goes here:
> I have looked the html based perl pop mail checkers and senders.
> But the problem is that when i check mail and read it, then it deletes from
> server it too.
> Is it any possible to force the script to leave a copy of msg to server.
> If anybody can help me i would be wery thankful.
>
> Also a little example is welcome.
POP3 protocol requires a special command to delete the message.
So it is just a matter of how POP protocol is used.
WARNING:
I have seen at least one ISP which changed its POP server
to delete all read email (a violation of POP3 specification)
--
Andrzej (Andrew) A. Filip
http://www.bigfoot.com/~anfi
E-mail: anfi@bigfoot.com
I NO LONGER USE anfi@polbox.com
Posting history (all addresses):
http://www.dejanews.com/profile.xp?author=Andrzej%20Filip&ST=PS
------------------------------
Date: Thu, 10 Jun 1999 10:42:05 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Problems sorting. I'm stupid and I'll die
Message-Id: <slrn7ltdqm.6sf.sitaram@diac.com>
On Wed, 09 Jun 1999 09:07:16 GMT, Stuart Wright
<stuw@dial.pipex.com.remove.everything.after.com> wrote:
>I have some script which I copied from a resource somewhere and it doesn't
>work because the version of Perl on my host's server doesn't like the '->'
What people usually do is to bring the problem down to a small
number of lines (less than 10-20 is good) and post it. That'll
get much better responses.
>syntax.
>I have an array @record which contains about 500 records, each made up of
>$manufacturer,$model,$rating,$date
How? Do you mean that each element of @record is an arrayref
where each of those arrayref's points to an array of manufacturer,
model, rating, date?
Without knowing how even the data is structured, it's impossible
to help!
>I need to do a case insensitive sort by $rating.
>I have read the Perl documentation and I simply don't understand it. I'm
>sorry - I'm stupid and I'll die.
Excessive modesty or self-flagellation is almost as bad as the
other extreme ;-)
>In the brief spell before I expire, could someone please give me the script
>to sort my array?
>like @records = (sort {uc($rating{a}) cmp uc($rating{b})} @records) type
>stuff. Nice and simple.
You've got the right idea. You have 'a' and 'b' as barewords
there - they need a $ sign in front. Also, $rating{$a} doesnt
seem to fit with my guess up there about your data structure. But
that's only a guess - only you can tell us what the truth is!
>I'd love to get this script to work so I can go back to killing my brain
>with beer. Many thanks in advance.
Beer? And how come you dont ask for help with that? ;-)
------------------------------
Date: 10 Jun 1999 10:52:23 GMT
From: periat@ens.ascom.ch (Henri Periat)
Subject: Q: How unlock flock of a other process
Message-Id: <7jo5d7$g1$1@ascomax.hasler.ascom.ch>
I have a perl script to launch programs, that log used programs in a file.
The log file is locked with 'flock(FH,2)'. The lock is blocking and if
it takes longer than 5s to get back from the 'flock()' the script should
unlock the file and try again.
- Who can i unlock the lock even when the lock was made by a other process?
- Who can i get back to the beginning?
...
&Loging(LogFile, Program);
exec(Program)
sub Loging {
if ( open(FH, ">>$LogFile) ) {
flock(FH, 2);
print FH $Program;
close(FH);
else {
print error message
}
}
Thanks in advance
Henri
------------------------------
Date: Thu, 10 Jun 1999 10:42:06 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: quotemeta
Message-Id: <slrn7lte1q.6sf.sitaram@diac.com>
On Wed, 09 Jun 1999 05:53:56 GMT, dalehend@flash.net <dalehend@flash.net> wrote:
>I have quotemeta to put the backslash before a non-alphanumeric
>character. How about taking it out? Is there a function to take the
>backslash out?
eval
------------------------------
Date: Thu, 10 Jun 1999 07:54:34 GMT
From: dalehend@flash.net
Subject: Re: Regexpr for loop to handle e-address list
Message-Id: <375f6e3d.56922029@news.flash.net>
I don't know, maybe senility has finally started to set in for me.
Is the character following this sentence a backslash? \
Anyway, I think I found the function that will remove the backslash
and will try it later. It is
"ewords in Text::ParseWords
On Thu, 10 Jun 1999 01:18:18 -0500, rlb@intrinsix.ca (Lee) wrote:
>In article <375f26d1.38627413@news.flash.net>,
>dalehend@flash.net wrote:
>
>>The Backslash acts as a delimiter to assign the quoted list to a
>>variable. The variable is for WebBBS.
>
>1) I'm not sure what that sentence is supposed to mean, but it's difficult
>to see how a backslash that isn't there can be acting as much of anything.
>Try these and see what you get:
>
> print "younme\@work.com shenhim\@work.com" . "\n";
>
> print "younme\\@work.com shenhim\\@work.com" . "\n";
>
> print 'younme\@work.com shenhim\@work.com' . "\n";
>
>2) This ain't Jeopardy, son. The text of your replies should follow the
>text of what you're replying to.
>
>>On Wed, 9 Jun 1999 17:27:13 -0700, Tom Phoenix <rootbeer@redcat.com>
>>wrote:
>>
>>>On Thu, 10 Jun 1999 dalehend@flash.net wrote:
>>>
>>>> Thanks for your feedback Tom. I did look at Mail::Address, but I do
>>>> not think it can handle the backslash delimiter that must be present
>>>> in each email address as a part of the list.
>>>
>>>This one?
>>>
>>>> >> $emaillist = "younme\@work.com shenhim\@work.com";
>>>
>>>There's no backslash in there. :-) You _could_ have a backslash in a
>>>valid address, but I don't think that's what you meant.
>
>Lee
>
>
------------------------------
Date: Thu, 10 Jun 1999 10:17:00 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Sub on another drive
Message-Id: <376289b7.3338890@news.skynet.be>
ANK wrote:
>Hi, I would like to use subroutine which is on another drive
>I am using "use X:\\somedir\somefile" in myfile.pl on NT.
>Subroutine is in somefile.pm which is on UNIX.
>
>It doesn't work..
>It gives me syntax error near "use X:
I should think so.
Try including "X:\\somedir" in @INC, for example by doing
use lib "X:\\somedir";
use somefile;
HTH,
Bart.
------------------------------
Date: Thu, 10 Jun 1999 10:44:11 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: System command
Message-Id: <7jo4ue$mdg$1@news.mch.sbs.de>
In article <375F264F.4054EE7@workmail.com>, Raj <technology@workmail.com> wrote:
>Hi, I have another CGI/Perl issue.
>In my CGI Script,
>
>System("cp $file1 tmp.ext");
>
>is not working for a valid $file1.permissions, dir, extensions are ok.
>Its able to delete that file thru unlink but not a copy thru System
>command. Any help please...!!? TIA,
Well, since you've checked all the rest already, does the command 'cp' exist
on your system ? :-)
Some systems tend to reply with the following message :
C:\>cp
The name specified is not recognized as an
internal or external command, operable program or batch file.
But I guess that's too obvious :o
Did you check the return code of the system command (with $?) ?
Michel.
------------------------------
Date: Thu, 10 Jun 1999 10:42:08 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Using CGI.pm
Message-Id: <slrn7ltef0.6sf.sitaram@diac.com>
On Wed, 09 Jun 1999 05:13:20 GMT, R.Joseph <streaking_pyro@my-deja.com> wrote:
>I have been writing CGI for a couple of months, and the instructor in
>my class always used CGI-LIB.pl by Steven Brenner. However, I keep
>hearing more and more about this CGI.pm module. Is there someone who
>can explain it's differences from CGI-LIB.pl and if it is better than
>CGI-LIB.pl or not? Any help is much appreciated. Thanks.
Never used CGI-LIB.pl (case?). CGI.pm is the preferred way to do
CGI programming in Perl. I believe the .pl version pertains to
Perl 4.
Better? Is Perl 5 better than Perl 4? Is Linux 2.2.9 better than
2.0.36? Is Windows 98 bett.... oh heck I went too far ;-)
------------------------------
Date: Thu, 10 Jun 1999 09:52:23 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: VERSION numbers
Message-Id: <FD3vFB.4xo@csc.liv.ac.uk>
In article <x7zp29483k.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> writes:
>
> those $....$ strings are used by RCS (a source control system) and are
> automatically updated. so to have perl get just the plain version number
> into $VERSION, you have to mung the string. those are two different ways
> to do it.
Ahhhh. Hold on... Yep we have it here. man rcs produced gobs of info.
>
> IJG> # $Id: Headers.pm,v 1.36 1998/04/10 14:51:22 aas Exp $
>
> IJG> $Revision: 4.115 $ $Date: 1998/05/01 19:52:15 $
>
> those are also RCS values.
>
> you can find rcs at many sites. it is a very useful tool to know and use.
Take your word for it, looks a complicated little beasty. :-) (Mind you if
it means I don't have to remember to increment my version numbers it's
probably worth it.)
Thanks Uri, in fact thanks to all those that responded, you were all most
informative.
--
Ian J. Garlick
ijg@csc.liv.ac.uk
Don't look back, the lemmings are gaining on you.
------------------------------
Date: Thu, 10 Jun 1999 10:36:17 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: VERSION numbers
Message-Id: <sipv342vha.fsf@cre.canon.co.uk>
I.J. Garlick <ijg@csc.liv.ac.uk> wrote:
> For instance Gisle Aas seems to favour this style (in HTTP modules
> anyway)
>
> $VERSION = sprintf("%d.%02d", q$Revision: 1.36 $ =~ /(\d+)\.(\d+)/);
This is not necessarily a technique you should adopt without considering
the pros and cons. It conflates revision number (roughly speaking, the
number of times a particular source file has been checked into your
source control system) with release number (the number of times the
whole package has been released to CPAN).
The kind of problems you might encounter are:
* RCS minor revision numbers can go over 100, so version 1.99 is
accidentally followed by version 1.100, and people who wrote
use Module 1.99;
find their code fails.
* "missing" versions - you check in your source every couple days
(whenever it passes the test suite) but release only once every
three months. People wonder what happened to all those versions
between 1.24 and 1.63.
* If your package takes its VERSION from source file Module.pm, you
can't make a release without chaning Module.pm and thus getting a
new revision number - but you might want to make a release that
just fixes a problem with MANIFEST or the test suite.
* You start doing development on a CVS branch, and your revision
numbers look like 1.1.3.2. Unfortunately you can't make releases
from the branch because all the $VERSIONs come out as 1.01.
--
Gareth Rees
------------------------------
Date: Wed, 9 Jun 1999 23:52:27 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: waiting...
Message-Id: <MPG.11c9007ccb1b2cc9989ba9@nntp.hpl.hp.com>
In article <7jnf6m$7tj$1@nnrp1.deja.com> on Thu, 10 Jun 1999 04:33:26
GMT, outlaw_torn <outlaw_torn@mailexcite.com> says...
> Thanks to both for the reply, but what then if I fork...I still have to
> wait. The only way I can see to do that is with wait (which from my doco
> says that the parent waits...and waits...and waits) or parse the ps
> stuff until the child finishes, or kill it when the time is up. What I
> basically need is a wait, which gives up waiting when necessary.
perldoc -f alarm
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 10 Jun 1999 08:51:49 +0100
From: Richard H <rhrh@hotmail.com>
Subject: Re: waiting...
Message-Id: <375F6E95.E6B51DBD@hotmail.com>
outlaw_torn wrote:
>
> In article <slrn7lt203.qks.hasant@borg.intern.trabas.co.id>,
> hasant@trabas.co.id (Hasanuddin Tamir) wrote:
>
> > fork(), get the child's pid, exec(), send the pid some signal.
> > That's basically...
> >
>
> Thanks to both for the reply, but what then if I fork...I still have to
> wait. The only way I can see to do that is with wait (which from my doco
> says that the parent waits...and waits...and waits) or parse the ps
> stuff until the child finishes, or kill it when the time is up. What I
> basically need is a wait, which gives up waiting when necessary.
Ive not checked this, but Im pretty sure theres a sleep() function
somewhere which would seem to be in the direction of what u want.
Richard H
------------------------------
Date: Thu, 10 Jun 1999 07:13:16 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: What's the "halting problem"?
Message-Id: <375f64fd.52480076@news.nikoma.de>
Hi,
the term "halting problem" occurred a couple of times in the thread
"Syntax checking a Perl script". What does this term mean? I had a
quick grep through perl*.pod but didn't find it there.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.net>
------------------------------
Date: 10 Jun 1999 01:04:31 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: What's the "halting problem"?
Message-Id: <yl3e0032i8.fsf@windlord.stanford.edu>
Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> writes:
> the term "halting problem" occurred a couple of times in the thread
> "Syntax checking a Perl script". What does this term mean? I had a quick
> grep through perl*.pod but didn't find it there.
It's something from theoretical computer science, particular computability
theory. It's provably impossible to write a program that, given another
arbitrary program, can tell you whether or not that program halts (ie,
terminates rather than runs forever).
You can obviously tell whether some particular programs, and possibly
programs written in some particular styles, will halt, but you can't solve
the halting problem for a general, arbitrary program.
This result is extremely important, since it sets a boundary on
computability theory by establishing that there are a class of problems
which are impossible to solve with a computer. There are a number of
problems which have been proven equivalent to the halting problem and
therefore are known to similarly be impossible to solve with a computer.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 10 Jun 1999 10:27:32 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Where is sendmail on NT using Perl
Message-Id: <375f8504@newsread3.dircon.co.uk>
RG <roland@oco.net> wrote:
> My sysop is out of town , but is not real familiar with perl, and I need
> to know where to point my formmail.pl script's tag to "sendmail" on the
> NT server. I believe the right path would be d:/perl/lib/sendmail
>
> $mailprog="d://perl//lib//sendmail";
> or
> $mailprog="d:/perl/lib/sendmail";
>
> Both of these do not work, as the form doesnt get sent to my email
> address. I do not get an error message, though.
>
NT doesnt by default have sendmail at all - you will need to find some
other method of delivering mail - this however is not really a Perl
question so you would be advised to check out:
<http://www.geocities.com/SiliconValley/Park/8312/mail.htm>
Which offers a number of solutions.
/J\
--
"If homo sapiens really were 'homo' sapiens is that why they're
extinct?" - Joey, Friends
------------------------------
Date: Thu, 10 Jun 1999 12:29:01 +0200
From: Andrzej Filip <anfi@bigfoot.com>
Subject: Re: Where is sendmail on NT using Perl
Message-Id: <375F936D.AF95B200@bigfoot.com>
RG wrote:
> My sysop is out of town , but is not real familiar with perl, and I need
> to know where to point my formmail.pl script's tag to "sendmail" on the
> NT server. I believe the right path would be d:/perl/lib/sendmail
>
> $mailprog="d://perl//lib//sendmail";
> or
> $mailprog="d:/perl/lib/sendmail";
>
> Both of these do not work, as the form doesnt get sent to my email
> address. I do not get an error message, though.
1) sendmail is a unix beast.
2) try to a module to send email via SMTP
--
Andrzej (Andrew) A. Filip
http://www.bigfoot.com/~anfi
E-mail: anfi@bigfoot.com
I NO LONGER USE anfi@polbox.com
Posting history (all addresses):
http://www.dejanews.com/profile.xp?author=Andrzej%20Filip&ST=PS
------------------------------
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 5943
**************************************