[13893] in Perl-Users-Digest
Perl-Users Digest, Issue: 1337 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 10 09:05:30 1999
Date: Wed, 10 Nov 1999 06:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942242711-v9-i1337@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 10 Nov 1999 Volume: 9 Number: 1337
Today's topics:
a quick question about sleep. <k.thomson@scet.com>
Re: a quick question about sleep. <eedalf@eed.ericsson.se>
Can perl access COM port?? <citidancer@hongkong.com>
Re: Can perl access COM port?? (Simon Cozens)
Re: Can perl access COM port?? (Abigail)
can't locate MD%.pm in @INC ??? <eric.chin@pinnacle.co.uk>
Re: can't locate MD%.pm in @INC ??? <eedalf@eed.ericsson.se>
Re: can't locate MD%.pm in @INC ??? <kypriot@algo.com.gr>
Re: can't locate MD%.pm in @INC ??? <gellyfish@gellyfish.com>
Re: can't locate MD%.pm in @INC ??? <gellyfish@gellyfish.com>
Can't use Berkeley DB with your <db.h> <eedalf@eed.ericsson.se>
GTK+/Perl Tutorial <tyndiuk@ftls.org>
I guess this should not happen <Friedrich.Dominicus@inka.de>
Re: Is $$variable allowed like in PHP ? (Sam Holden)
Re: Language specifications (Bart Lateur)
Re: perl as first language? <uri@sysarch.com>
Re: perl as first language? <uri@sysarch.com>
Re: PERLHUMOR: self-printing resume <bcl914@bellsouth.net>
Re: PERLHUMOR: self-printing resume <rick.delaney@home.com>
Re: PERLHUMOR: self-printing resume <rick.delaney@home.com>
Re: Portable Perl Code (Bart Lateur)
print formatter wanted <ulrich.reichert@hl.siemens.de>
Scheduling PERL scripts <dejaerudite@my-deja.com>
Re: Scheduling PERL scripts <eedalf@eed.ericsson.se>
Re: Scheduling PERL scripts <gellyfish@gellyfish.com>
Re: Scoping (Bart Lateur)
script dumps core <news@mtvwebdesign.hypermart.net>
Tim O Reilly interview. Very good read. <ivanwalsh@my-deja.com>
Re: Tim O Reilly interview. Very good read. <eedalf@eed.ericsson.se>
Re: Tim O Reilly interview. Very good read. (Simon Cozens)
Re: Tim O Reilly interview. Very good read. <gellyfish@gellyfish.com>
timeout operation for less than 1 second <qchen@snet.net>
using the 'Location :' command stuart@ecs-telecom.demon.co.removethisfirst.uk
Re: using the 'Location :' command <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 10 Nov 1999 11:53:10 -0000
From: "Kevin Thomson" <k.thomson@scet.com>
Subject: a quick question about sleep.
Message-Id: <80bm03$2vs$1@nclient5-gui.server.ntli.net>
anybody know a quick fix
I have a program that pipes some info out to stdout using printf
perlprog.pl > myfile
but when I want the program to sleep for five seconds
sleep(5);
I get nothing in sent to my file any suggestions
on how to fix?
------------------------------
Date: Wed, 10 Nov 1999 13:01:40 +0100
From: Alex Farber <eedalf@eed.ericsson.se>
Subject: Re: a quick question about sleep.
Message-Id: <38295EA4.7FF6C3F8@eed.ericsson.se>
Kevin Thomson wrote:
>
> anybody know a quick fix
>
> I have a program that pipes some info out to stdout using printf
>
> perlprog.pl > myfile
>
> but when I want the program to sleep for five seconds
> sleep(5);
>
> I get nothing in sent to my file any suggestions
>
> on how to fix?
I haven't understood the question, but maybe $|=1; helps?
Please see "perldoc perlvar"
/Alex
------------------------------
Date: Wed, 10 Nov 1999 19:43:22 +0800
From: "Calvin" <citidancer@hongkong.com>
Subject: Can perl access COM port??
Message-Id: <80blfa$8nh$1@hfc.pacific.net.hk>
Hi,
Just a quick question to see i want to use perl in my college project or
not. Can perl access the COM port and send signals through it???
Best regards
Calvin
------------------------------
Date: 10 Nov 1999 12:25:46 GMT
From: simon@othersideofthe.earth.li (Simon Cozens)
Subject: Re: Can perl access COM port??
Message-Id: <slrn82ip2a.dp4.simon@othersideofthe.earth.li>
Calvin (comp.lang.perl.misc):
> Just a quick question to see i want to use perl in my college project or
>not. Can perl access the COM port and send signals through it???
That's a FAQ.
--
Please ignore previous sig.
------------------------------
Date: 10 Nov 1999 06:26:04 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Can perl access COM port??
Message-Id: <slrn82ip9l.6es.abigail@alexandra.delanet.com>
Calvin (citidancer@hongkong.com) wrote on MMCCLXII September MCMXCIII in
<URL:news:80blfa$8nh$1@hfc.pacific.net.hk>:
"" Hi,
"" Just a quick question to see i want to use perl in my college project or
"" not. Can perl access the COM port and send signals through it???
Well, yes, why not?
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 10 Nov 1999 11:40:08 -0000
From: "Eric Chin" <eric.chin@pinnacle.co.uk>
Subject: can't locate MD%.pm in @INC ???
Message-Id: <942233907.20408.0.nnrp-10.9e980b2b@news.demon.co.uk>
Greetings,
I am new to perl and we run a perl script which generates a reverse dns
lookup file. This script successfully on perl 5.004 but I get the follwing
error when I run it on perl 5.005 :
"Can't locate MD5.pm in @INC (@INC contains:
/usr/lib/perl5/5.00503/i386-linus /usr/lib/perl/perl5/5.00503
/usr/lib/perl5/site_perl5/5.005/i386-linux /usr/lib/perl/site_perl5/5.005 .)
at mkrdns.pl line 31.
BEGIN failed--compilation aboarted at ./mkrdns.pl line 31."
I have a look at the perl script and found line 31 is : 'use MD5;'. The
MD5.pm file is in /usr/lib/perl5/site_perl directory
Does anyone know what the error messages means and I do overcome this error
?
TIA
Eric Chin
Please reply to : eric.chin@pinnacle.co.uk
------------------------------
Date: Wed, 10 Nov 1999 13:00:10 +0100
From: Alex Farber <eedalf@eed.ericsson.se>
Subject: Re: can't locate MD%.pm in @INC ???
Message-Id: <38295E4A.EF194D63@eed.ericsson.se>
Eric,
Eric Chin wrote:
> I have a look at the perl script and found line 31 is : 'use MD5;'. The
> MD5.pm file is in /usr/lib/perl5/site_perl directory
set the PERL5LIB variable (see "perldoc perlrun") or put
use lib qw (/usr/lib/.....); into your scripts. I wonder however
if your perl installation is ok, since /usr/lib/perl5/site_perl
should probably be checked by perl anyway...
/Alex
------------------------------
Date: Wed, 10 Nov 1999 15:08:18 +0200
From: "Angel Kypriotis" <kypriot@algo.com.gr>
Subject: Re: can't locate MD%.pm in @INC ???
Message-Id: <80br0s$jbm$1@ulysses.noc.ntua.gr>
It;s not due to an installation problem, I have the same problem also both
with perl5.00503 of RedHat 6.0 and with a precompiled perl dist for Solaris
2.6 which I installed it myself.
I even used PERL5LIB as well as the use lib pragma, even the FindBin module
and the system doesn't seem to find the modules.
Alex Farber <eedalf@eed.ericsson.se> wrote in message
news:38295E4A.EF194D63@eed.ericsson.se...
> Eric,
>
> Eric Chin wrote:
> > I have a look at the perl script and found line 31 is : 'use MD5;'. The
> > MD5.pm file is in /usr/lib/perl5/site_perl directory
>
> set the PERL5LIB variable (see "perldoc perlrun") or put
> use lib qw (/usr/lib/.....); into your scripts. I wonder however
> if your perl installation is ok, since /usr/lib/perl5/site_perl
> should probably be checked by perl anyway...
>
> /Alex
------------------------------
Date: 10 Nov 1999 13:43:10 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: can't locate MD%.pm in @INC ???
Message-Id: <3829766e_1@newsread3.dircon.co.uk>
Eric Chin <eric.chin@pinnacle.co.uk> wrote:
> Greetings,
>
> I am new to perl and we run a perl script which generates a reverse dns
> lookup file. This script successfully on perl 5.004 but I get the follwing
> error when I run it on perl 5.005 :
>
> "Can't locate MD5.pm in @INC (@INC contains:
> /usr/lib/perl5/5.00503/i386-linus /usr/lib/perl/perl5/5.00503
> /usr/lib/perl5/site_perl5/5.005/i386-linux /usr/lib/perl/site_perl5/5.005 .)
> at mkrdns.pl line 31.
> BEGIN failed--compilation aboarted at ./mkrdns.pl line 31."
>
> I have a look at the perl script and found line 31 is : 'use MD5;'. The
> MD5.pm file is in /usr/lib/perl5/site_perl directory
>
But if you look at the message you get you will see that
/usr/lib/perl5/site_perl is not in @INC - however if you had installed
the module correctly the module would have been put in the right place.
Reinstall the module properly ...
/J\
--
"I must call a man in - I want to get felt laid down in the loft" -
Graham Norton
------------------------------
Date: 10 Nov 1999 13:55:42 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: can't locate MD%.pm in @INC ???
Message-Id: <3829795e_1@newsread3.dircon.co.uk>
Angel Kypriotis <kypriot@algo.com.gr> wrote:
> It;s not due to an installation problem,
It is - he has put his file in a directory which is not in @INC.
> I have the same problem also both
> with perl5.00503 of RedHat 6.0 and with a precompiled perl dist for Solaris
> 2.6 which I installed it myself.
Both precompiled versions of Perl - print out @INC to see what directories
it refers to. Modules that are installed correctly will always be put
in the correct place - unless your Perl installation is horribly broken.
Of course if you are simply copying .pm files into random places then all
bets are off ...
/J\
--
"I don't have access to the intelligence" - Michael Howard
------------------------------
Date: Wed, 10 Nov 1999 12:22:54 +0100
From: Alex Farber <eedalf@eed.ericsson.se>
Subject: Can't use Berkeley DB with your <db.h>
Message-Id: <3829558E.46CF4253@eed.ericsson.se>
Hi,
I have used egcs 1.1.2 on my Solaris 2.6 to compile the Berkeley
DB 2.7.7 (tried both without and with --enable-compat185) and it
worked fine. But now I have troubles running the Configure script
for Perl 5.005_03:
<db.h> found.
Checking Berkeley DB version ...
I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB.
even though I submitted -I/home/eedalf/BerkaleyDB/include and
-L/home/eedalf/BerkeleyDB/lib... Does anyone have any hints?
I will be glad to provide more information, if needed.
Thank you.
/Alex
------------------------------
Date: Wed, 10 Nov 1999 12:16:07 +0100
From: Frederic TYNDIUK <tyndiuk@ftls.org>
Subject: GTK+/Perl Tutorial
Message-Id: <382953F7.B13C9D2F@ftls.org>
Could you say were I can find a GTK+/Perl Tutorial ?
Thanks
FTLS
--
*-----------------------------------------------------------*
| FTLS E-Mail: - tyndiuk@ftls.org / tyndiuk@abul.org |
|(TYNDIUK Frederic) |
| WWW Perso : - http://www.ftls.org/ |
*-----------------------------------------------------------*
------------------------------
Date: Wed, 10 Nov 1999 14:05:31 +0100
From: Friedrich Dominicus <Friedrich.Dominicus@inka.de>
Subject: I guess this should not happen
Message-Id: <38296D9B.8245D1E3@inka.de>
It's just a guess and I just found out by accident. I was running a
recursive
version of the fibonacci numbers. And between 25 and 30 on my computer
Perl seems to get a bit confused or so. The memory consumption raises
above 100!!! MB and that is quite much. I do know that this is as
inefficient as can be but Perls consumes a bunch of time
Here's the source:
sub fib {
local($n)=@_;
if( $n<2 ){
return $n;
} {
return fib($n-2)+ fib($n-1)
}
}
print &fib(29), "\n";
Please don't tell me that I have to use another implementation I know
that I have to I just want to ask if this is a known problem or not.
Just to give you an impression of the run-time this takes s.th around
150 user seconds.
Machine: PII 300 MHz 128 MB RAM
Linux: Debian Version 2.1, glibc 2.0.7 and abit
perl 5.004_04
Other languages I try did not show this driving nuts. So I do not know
why Perl has trouble here.
Regards
Friedrich
~
------------------------------
Date: 10 Nov 1999 13:31:25 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <slrn82istm.37c.sholden@pgrad.cs.usyd.edu.au>
On 10 Nov 1999 10:55:57 +0000 (GMT),
Ben Evans <bene@chiark.greenend.org.uk> wrote:
>In article <3804ef5f.247014768@news.ford.com>,
>Clinton Pierce <cpierce1@ford.com> wrote:
>>
>>Yes, they're called soft references (or symbolic references).
>>
>>Using them is generally considered a Bad Idea, which is one reason why
>>"use strict" won't put up with them. Other syntax like hashes of hashes,
>>or hard references should be used instead.
>
>Why are soft references considered a Bad Idea?
>
>Admittedly, most of the perl I write is for CGI, but I find it really
>handy to be able to set a form parameter called mode, check that $in{'mode'}
>is in some list of valid modes, then set $mode = $in{'mode'} and call
>&$mode.
>
>That way, I can quickly and easily add new areas to a site, by writing the
>logic, making the relevant template, and adding my new mode to the valid
>modes list.
You could just as quickly and easily add the new mode to the hash of valid
modes, also adding the subref that is the value in the has. Then you can use
a real reference...
No symbolic references, achieves the same effect.
>
>On a related point, this script:
>
>#!/usr/bin/perl/
>
>$dog = 'woof!';
>
>$string = 'the quick red fox jumped over the lazy brown $dog';
>
>$string =~ s/\$(.*)/${$1}/g;
>
>print "$string\n";
>
>produces:
>the quick red fox jumped over the lazy brown woof!
>on the command line, but:
>the quick red fox jumped over the lazy brown
>if run as a CGI program.
>
>The perl version running is 5.004_03. Any thoughts, anyone?
It works as a CGI script for me:
This is perl, version 5.005_02 built for sun4-solaris-thread
--
Sam
So I did some research. On the Web, of course. Big mistake...
--Larry Wall
------------------------------
Date: Wed, 10 Nov 1999 11:59:26 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Language specifications
Message-Id: <382d5d3e.18107014@news.skynet.be>
Jean-Patrick Madelon wrote:
>What kind of language specifications are available?
>Are they formal?
No. Perl is a very ad hoc programming language. Some people (most
notably Larry Wall) think that is a Good Thing.
>Are there some standard?
Perl is what the Perl Gods say it is. So it's an evolution in progress.
But there is no need for a standard, since there is basically only one
distribution. What doesn't confirm to what the Perl Gods like, simply is
not Perl. No fear of M$ trying to break the standard in order to get the
monopoly... as they tried to pull with Java. And let's hope it stays
that way. Forever and ever.
--
Bart.
------------------------------
Date: 10 Nov 1999 08:47:28 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: perl as first language?
Message-Id: <x7emdyzcen.fsf@home.sysarch.com>
>>>>> "JL" == Jean-Louis Leroy <jll@skynet.be> writes:
JL> These scripts gets handed business objects, talks to them in
JL> normal OO fashion, performs queries, and traverse relationships.
JL> Here's a short example. It's part of the document generation
JL> system. The script is responsible for computing the values of MIF
JL> document variables. In this case we're printing all the 'parties'
JL> in a Criminal Case.
so it is just like someone else conjectured, pure OO manipulation of
externally provided objects. you trained this guy in a coding vacuum. he
should learn other perl stuff fast or he will vaporize!
JL> I'm glad that books like Damian Conway's are finally coming out. I
JL> wonder if they come in time to save Perl from oblivion.
i don't think perl is going away anytime soon. and damian's book is
definitely a winner regardless. you and your cow-orker should read it.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 10 Nov 1999 08:50:18 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: perl as first language?
Message-Id: <x7bt92zc9w.fsf@home.sysarch.com>
>>>>> "AJ" == Andrew Johnson <andrew-johnson@home.com> writes:
AJ> however, there have also been indications that Perl has not had a
AJ> suitable first language book either :-)
boy, we are shameless, aren't we?
:-)
have manning send a few cases to damian for his newbie classes.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 10 Nov 1999 08:37:53 -0500
From: "Brian Landers" <bcl914@bellsouth.net>
Subject: Re: PERLHUMOR: self-printing resume
Message-Id: <7veW3.4950$oW2.21248@news2.atl>
Uri Guttman <uri@sysarch.com> wrote in message
news:x7hfivylsg.fsf@home.sysarch.com...
> >>>>> "BL" == Brian Landers <bcl914@bellsouth.net> writes:
>
>
> BL> #!/usr/bin/perl
> BL> # --------------------------------------------------------------
>
> no -w nor strict!
Judgement call. I turned off warnings to stop a particular warning from
allowing me to use the formatting I wanted to. Also, many people recommend
leaving -w off in production code (I refuse to get into an argument about
that one). Hopefully, in the next release we have more granular control over
warnings.
I always use strict, but in this case I removed it when the app was done for
asthetics sake.
> BL> my( $name ) = "BRIAN CLAY LANDERS, MCP";
> BL> my( %addr ) = (
> BL> POSTAL => 'xxx Collier Road #xxxx' .
> BL> 'Atlanta GA 30318',
> BL> HOME => '404-xxx-xxxx',
> BL> CELL => '678-xxx-xxxx',
> BL> EMAIL => 'brian@bluecoat93.org',
> BL> WEB => 'http://www.bluecoat93.org'
> BL> );
>
> BL> my( %work );
> BL> $work{ "1. SAPIENT CORPORATION" } = {
> you sort on that key but if you ever get more than 10 jobs, it will not
> work.
>
True, true...but I needed a quick way to make the keys come out in the order
I inserted them. If I had more than 10 jobs I would do (01. 02. etc.) Also,
I deliberately did NOT use Tie::IxHash to keep the keys in order because I
wanted the person receiving my resume to be able to run it without the
possibility of having to install modules.
> BL> print "$name\n\n";
> BL> foreach(keys %addr)
> BL> {$a=lc($_);$a=~s/\b(.)/\U$1/g;print "$a\t$addr{$_}\n\n";};
>
> print "\u\L$_\E\t$addr{ $_ }\n\n" ;
> also you my all the vars above, why not $a? strict would have caught it.
>
> also the fields come out in hash order which doesn't look so great.
Again, a judgement call. The my() was almost for asthetics "My Experience",
"My Education", etc. where the $a was a worker variable. In a real app I'd
be using strict so it would be my'ed.
Thanks for the feedback!
Brian
------------------------------
Date: Wed, 10 Nov 1999 13:40:27 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: PERLHUMOR: self-printing resume
Message-Id: <382975DC.AAA7CAC9@home.com>
[posted & mailed]
Uri Guttman wrote:
>
> also you my all the vars above, why not $a? strict would have caught it.
strict wouldn't catch that since $a and $b are exempt as the globals
used by sort. An oversight on your part, I'm sure, but I point this out
in case someone actually tries it and is confused.
This is poorly documented. I knew it but couldn't find it anywhere in
the docs. Anyone?
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Wed, 10 Nov 1999 14:00:35 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: PERLHUMOR: self-printing resume
Message-Id: <38297A9A.7BC3B290@home.com>
[posted & mailed]
Brian Landers wrote:
>
> I always use strict, but in this case I removed it when the app was done for
> asthetics sake.
What exactly does this mean? I see this argument again and again when
people are called out for not using strict.
use strict;
I'm sitting here staring at this line wondering what is so displeasing
to the eye. Maybe it needs some balance?
use strict; # ;strict use
or
use strict; # ;tcirts esu
Ugh. That last one might look okay if I had a character set with
backwards letters.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Wed, 10 Nov 1999 12:01:54 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Portable Perl Code
Message-Id: <382e5e77.18419263@news.skynet.be>
Steven Glicker wrote:
>I would greatly appreciate knowing how one typically writes portable
>code in Perl in cases where a function (say alarm) exists in Linux but
>not in Windows.
Funny enough: alarm() works on DJGPP DOS perl, but not on Activestate.
>In C this is typically handled at compile-time with
>#ifdef's. Is there a convention for handling this (at run-time) in Perl?
Check $^0 .
--
Bart.
------------------------------
Date: Wed, 10 Nov 1999 13:18:05 +0100
From: Ulrich Reichert <ulrich.reichert@hl.siemens.de>
Subject: print formatter wanted
Message-Id: <3829627D.E49E95DF@hl.siemens.de>
Hi,
does anybody of you have or know about a perl procedure for formatting
printouts like the unix tools "ascii to postscript (a2ps)" or "mpage" ?
Thanks
Ulrich
--
---------------------------------------------------------------------------
Ulrich Reichert Product Development, Computer Peripherals, MD CP D
Infineon Technologies AG, Tel.: +49 89 234 23367
St. Martinstr. 76 Fax : +49 89 234 83319
D-81617 Muenchen, PO Box 801760 Email: ulrich.reichert@infineon.com
---------------------------------------------------------------------------
------------------------------
Date: Wed, 10 Nov 1999 10:57:29 GMT
From: Rich D. <dejaerudite@my-deja.com>
Subject: Scheduling PERL scripts
Message-Id: <80bj2o$jut$1@nnrp1.deja.com>
I am trying to get a PERL script to run automatically each day, say at
4am. It is a simple script to strip out guestbook entries that are
older than x days. I want this to happen whilst I sleep!
I think I have seen in the past the "exec" instuction used with an
option that delays it's execution to a certain time and date. This
would be ideal, it's value being updated each day when the script has
finished running. Am I on the right track here? The server runs
Apache by the way.
Regards
Rich D
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 10 Nov 1999 13:06:55 +0100
From: Alex Farber <eedalf@eed.ericsson.se>
To: "Rich D." <dejaerudite@my-deja.com>
Subject: Re: Scheduling PERL scripts
Message-Id: <38295FDF.5F13BCC4@eed.ericsson.se>
"Rich D." wrote:
>
> I am trying to get a PERL script to run automatically each day, say at
> 4am. It is a simple script to strip out guestbook entries that are
> older than x days. I want this to happen whilst I sleep!
>
> I think I have seen in the past the "exec" instuction used with an
> option that delays it's execution to a certain time and date. This
> would be ideal, it's value being updated each day when the script has
> finished running. Am I on the right track here?
No, better read "man crontab"
> The server runs
> Apache by the way.
Regards
Alex
------------------------------
Date: 10 Nov 1999 12:32:32 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Scheduling PERL scripts
Message-Id: <382965e0_1@newsread3.dircon.co.uk>
Rich D. <dejaerudite@my-deja.com> wrote:
> I am trying to get a PERL script to run automatically each day, say at
> 4am. It is a simple script to strip out guestbook entries that are
> older than x days. I want this to happen whilst I sleep!
>
most people use cron
/J\
--
"Malcolm, what have I told you about putting chocolate near your
crotch?" - Mrs Merton
------------------------------
Date: Wed, 10 Nov 1999 11:51:09 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Scoping
Message-Id: <382b3f1a.10390381@news.skynet.be>
Jean-Patrick Madelon wrote:
>Does it support call by name or call by value?
Neither. Perl calls by reference. That means that if you change the
value of an argument, that you change the *original value*.
$x = 'before';
&modify($x);
print $x;
sub modify {
$_[0] = 'after';
}
-->
after
Note that usually programmers make this a "call by value" by copying the
values themselves. In Perl, arguments are anonymous, and you can give
them a meaningful at the same time.
sub test {
my($x,$y) = @_; # copy arguments
$x = 'ignored';
}
$a = 'no change there'; $b = 123;
test($a,$b);
print $a;
-->
no change there
--
Bart.
------------------------------
Date: Wed, 10 Nov 1999 13:29:59 +0100
From: "Maarten Veerman" <news@mtvwebdesign.hypermart.net>
Subject: script dumps core
Message-Id: <80bogn$rtl$1@news.tudelft.nl>
Hi.
My script dumped its core twice this month, and I don't like that:))
By renaming and therefor "deleting" one of the databases the script starts
working again.
This means that the database is corrupted. WHY!!!????
I use the following code to flock the database:
Example script:
#!/usr/local/bin/perl
use CGI::Carp qw(fatalsToBrowser); # Provides you with fatal error message
if they occur.
use CGI qw/:standard/;
use Fcntl qw(:DEFAULT :flock);
use DB_File;
$database = "data.db";
$db = tie(%hash, "DB_File", $database, O_CREAT|O_RDWR, 0666);
&writelock;
$hash{'name'} = "Maarten";
&unlock;
untie %hash;
sub readlock {
$fd = $db->fd;
open(DB_FH, "+<&=$fd") || die "dup $!";
unless (flock (DB_FH, LOCK_SH | LOCK_NB)) {
unless (flock (DB_FH, LOCK_SH)) { die "flock: $!" }
}
}
sub writelock {
$fd = $db->fd;
open(DB_FH, "+<&=$fd") || die "dup $!";
unless (flock (DB_FH, LOCK_EX | LOCK_NB)) {
unless (flock (DB_FH, LOCK_EX)) { die "flock: $!" }
}
}
sub unlock {
$db->sync; # to flush
if ($use_flock eq "1") {flock(DB_FH, LOCK_UN);}
undef $db;
close(DB_FH);
}
#END
Now, my second question:
Is there any way to save the database after it got corrupted?? Should I
study the core file for that using adb?
Thanks.
Maarten
------------------------------
Date: Wed, 10 Nov 1999 11:51:59 GMT
From: ivan walsh <ivanwalsh@my-deja.com>
Subject: Tim O Reilly interview. Very good read.
Message-Id: <80bm8v$lu1$1@nnrp1.deja.com>
Hello All,
Anyone who enjoys the O'Reilly books might be interested in this
interview with Tim O Reilly.
His ideas are worth a read if your involved in open source, Microsoft's
future, Linux, or the Next Big Thing.
http://www.softwareireland.com/terrybyte/tim_oreilly.asp
Best Regards,
Ivan Walsh
General Manager
_____________________________________________________
Email: ivan@softwareireland.com
Web: http://www.softwareireland.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 10 Nov 1999 13:10:05 +0100
From: Alex Farber <eedalf@eed.ericsson.se>
Subject: Re: Tim O Reilly interview. Very good read.
Message-Id: <3829609D.74D9E92E@eed.ericsson.se>
ivan walsh wrote:
> His ideas are worth a read if your involved in open source, Microsoft's
> future, Linux, or the Next Big Thing.
>
> http://www.softwareireland.com/terrybyte/tim_oreilly.asp
^^^ Apache::ASP ?
/Alex
------------------------------
Date: 10 Nov 1999 12:28:38 GMT
From: simon@othersideofthe.earth.li (Simon Cozens)
Subject: Re: Tim O Reilly interview. Very good read.
Message-Id: <slrn82ip7m.dp4.simon@othersideofthe.earth.li>
ivan walsh (comp.lang.perl.misc):
>Anyone who enjoys the O'Reilly books might be interested in this
>interview with Tim O Reilly.
Oh, I did one of them.
http://www.linuxplanet.com/linuxplanet/interviews/1048/1/
--
"It's God. No, not Richard Stallman, or Linus Torvalds, but God."
(By Matt Welsh)
------------------------------
Date: 10 Nov 1999 12:39:45 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Tim O Reilly interview. Very good read.
Message-Id: <38296791_1@newsread3.dircon.co.uk>
Alex Farber <eedalf@eed.ericsson.se> wrote:
> ivan walsh wrote:
>> His ideas are worth a read if your involved in open source, Microsoft's
>> future, Linux, or the Next Big Thing.
>>
>> http://www.softwareireland.com/terrybyte/tim_oreilly.asp
> ^^^ Apache::ASP ?
> /Alex
'Fraid not:
tom.dircon.net# telnet www.softwareireland.com 80
Trying 209.196.190.166...
Connected to softwareireland.com.
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.0 200 OK
Server: Microsoft-IIS/4.0
Date: Wed, 10 Nov 1999 12:39:21 GMT
Content-Type: text/html
Set-Cookie: ASPSESSIONIDGGGGGXEQ=ACLDPCJAEPOJAEJHHMMFEAPG; path=/
Cache-control: private
Connection closed by foreign host.
/J\
--
"Nourishes at the root and penetrates right to the tip" - Pantene
Advertisement
------------------------------
Date: Wed, 10 Nov 1999 08:19:29 -0500
From: Richard Chen <qchen@snet.net>
Subject: timeout operation for less than 1 second
Message-Id: <382970E1.E1BD39C9@snet.net>
VGhlIHVzdWFsIGRvY3VtZW50ZWQgbWV0aG9kIGZvciB0aW1pbmcgb3V0IG9wZXJhdGlvbnMg
YXJlDQp1c2luZyBhbGFybSBvciBTeXM6OkFsYXJtQ2FsbC4gVGhlc2UgaGF2ZSByZXNvbHV0
aW9ucyBvZg0KMSBzZWNvbmQgb3IgbW9yZS4NCg0KSSBjb3VsZCBub3QgZmluZCBhbnkgZG9j
cyBvbiB0aW1pbmcgb3V0IGFuIG9wZXJhdGlvbiBmb3IgbGVzcw0KdGhhbiAxIHNlY29uZC4g
QW55IHBvaW50ZXJzPw0KDQpUaGFua3MgZm9yIGFueSBpbmZvLg0KDQpSaWNoYXJkDQo=
------------------------------
Date: Wed, 10 Nov 1999 12:14:15 -0000
From: stuart@ecs-telecom.demon.co.removethisfirst.uk
Subject: using the 'Location :' command
Message-Id: <MPG.129371e686e3b00698970c@news.ecs.local>
I'm trying to use Perl on my NT4 server to return a Word document to a user
in their web browser and I've came across a little problem.
I use
print "Content-type: text/plain\n";
print "Location: $fullpath \n\n";
with $fullpath containing 'file://t:\docs\filename.doc' and this works up to
a point.
The point being that if the filename contains spaces then the browser
(IE5) doesn't display the document.
Any clues to what I'm doing wrong? ;-)
--
Stuart Halliday
------------------------------
Date: 10 Nov 1999 12:35:46 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: using the 'Location :' command
Message-Id: <382966a2_1@newsread3.dircon.co.uk>
stuart@ecs-telecom.demon.co.removethisfirst.uk wrote:
>
> I'm trying to use Perl on my NT4 server to return a Word document to a user
> in their web browser and I've came across a little problem.
>
>
> I use
>
> print "Content-type: text/plain\n";
> print "Location: $fullpath \n\n";
>
> with $fullpath containing 'file://t:\docs\filename.doc' and this works up to
> a point.
>
> The point being that if the filename contains spaces then the browser
> (IE5) doesn't display the document.
>
> Any clues to what I'm doing wrong? ;-)
>
I would suggest that you ask in comp.infosystems.www.authoring.cgi -
it is immaterial what language you wrote this in ....
/J\
--
"Some saw Noel Edmonds as a stinking slimy downmarket local rep from a
package holiday firm. His critics were less kind" - Victor Lewis-Smith,
TV Offal
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1337
**************************************