[19211] in Perl-Users-Digest
Perl-Users Digest, Issue: 1406 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 30 11:10:47 2001
Date: Mon, 30 Jul 2001 08:10:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <996505813-v10-i1406@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 30 Jul 2001 Volume: 10 Number: 1406
Today's topics:
Re: Odd tie DBI problem <bkennedy99@Home.com>
Re: Odd tie DBI problem (Michel Dalle)
Re: Odd tie DBI problem <rlf@proimages.net>
Re: PERL compiler...... <Pcmann1@btinternet.com>
Regexp question <Svein.Seldal@q-free.com>
Re: Regexp question <peter.sogaard@tjgroup.com>
Re: Regexp question <Thomas@Baetzler.de>
Re: sprintf <strawSPAM_BEGONEman@plexi.com>
Re: sprintf <arthur.haas@westgeo.com>
Re: sprintf <strawSPAM_BEGONEman@plexi.com>
Starting a deamon from another deamon <gortona@cs.man.ac.uk>
Re: Starting a deamon from another deamon <ilya@martynov.org>
Re: Starting a deamon from another deamon <bart.lateur@skynet.be>
Re: Starting a deamon from another deamon <nowhere@dot.com>
VVP: Displaying records 1 by 1? (vivekvp)
Re: where is poetry.ps? <peter.sogaard@tjgroup.com>
Re: where is poetry.ps? <t98675nk@sfc.keio.ac.jp>
Re: Who can help me about the confused (..) operator? (Mark Jason Dominus)
Re: Who can help me about the confused (..) operator? (Mark Jason Dominus)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 30 Jul 2001 12:40:31 GMT
From: "Ben Kennedy" <bkennedy99@Home.com>
Subject: Re: Odd tie DBI problem
Message-Id: <3Bc97.52385$EP6.11648611@news1.rdc2.pa.home.com>
"Robert Fonda" <rlf@proimages.net> wrote in message
news:3B6424AF.4F0E300A@proimages.net...
> I am sure this has come up before. I have a very simple CGI program that
> takes basic name and address goo, looks them up in a hashed database. If
> the there is an entry in the DB already, I just display some info. If
> there is not, then I write small record to the database vi a tie. The
> problem is, when I write a record, all seems fine, but when I VI the
> file, there is a whole bunch of Perl code inside the database. I don't
> get why/how the corruption is occuring. It's almost like a "leak".
>
> Thoughts?
By the time you get the the runtime portion of the script, all Perl code has
been parsed and turned into bytecode - if you are seeing Perl code at this
point in the script (runtime), then its not getting parsed in the first
place. Is this Perl code from your script? Perhaps you have an unhappy
pair of misquoted strings, or some badly terminated here-docs. Try dumping
some test vars to STDERR and examine your web logs, this should help you
isolate the issue.
--Ben Kennedy
------------------------------
Date: Mon, 30 Jul 2001 13:30:12 GMT
From: news@mikespub.net (Michel Dalle)
Subject: Re: Odd tie DBI problem
Message-Id: <9k3ndm$37l$1@news.mch.sbs.de>
In article <3B6424AF.4F0E300A@proimages.net>, Robert Fonda <rlf@proimages.net> wrote:
>I am sure this has come up before. I have a very simple CGI program that
>takes basic name and address goo, looks them up in a hashed database. If
>the there is an entry in the DB already, I just display some info. If
>there is not, then I write small record to the database vi a tie. The
>problem is, when I write a record, all seems fine, but when I VI the
>file, there is a whole bunch of Perl code inside the database. I don't
>get why/how the corruption is occuring. It's almost like a "leak".
>
>Thoughts?
I suppose you meant DB_File instead of DBI ? This sounds
suspiciously like the following "Common Question" :
"Why is there Perl source in my database?"
mentioned in the DB_File documentation.
Try typing 'perldoc DB_File' for more information.
Michel.
------------------------------
Date: Mon, 30 Jul 2001 07:50:46 -0700
From: Robert Fonda <rlf@proimages.net>
Subject: Re: Odd tie DBI problem
Message-Id: <3B657446.26D6F45A@proimages.net>
Michel Dalle wrote:
>
> I suppose you meant DB_File instead of DBI ?
Yup, that's what I meant.
>This sounds
> suspiciously like the following "Common Question" :
> "Why is there Perl source in my database?"
> mentioned in the DB_File documentation.
>
> Try typing 'perldoc DB_File' for more information.
>
> Michel.
Well, this is novel. I did indeed find the section. From what I gather,
there is not much I can do about it either. It certainly doesn't seem to
interfere with anything. I guess I will have to live with it.
Thank you very much!
Robert
------------------------------
Date: Mon, 30 Jul 2001 11:49:00 +0100
From: "Peter Mann" <Pcmann1@btinternet.com>
Subject: Re: PERL compiler......
Message-Id: <9k3e1r$j8o$1@neptunium.btinternet.com>
Hi there!
goto: http://www.suite101.com/article.cfm/7977/53268 and read this article!
For the software visit, www.indigostar.com and the software that might help
you is called Perl2EXE
Regards,
Peter C. Mann
"Kolorove Nebo" <sky@mail.lviv.ua> wrote in message
news:3B6501CE.8C421EDA@mail.lviv.ua...
> Is there any PERL compiler to build exe files from perl files on win32
> platforms?
>
> Thanks...
------------------------------
Date: Mon, 30 Jul 2001 14:27:40 +0200
From: "Svein Erling Seldal" <Svein.Seldal@q-free.com>
Subject: Regexp question
Message-Id: <msc97.2020$e%4.51211@news3.oke.nextra.no>
Hello,
I want to match the following text:
persist=<some_argument> or
per=<some_argument>
For this I use /^(persist|per)=(.*)/i
I want to put an asterisk(*) after the command, and thus match 'persist*='
or 'persist=', but not 'persistsomething=' nor 'persist*something='. How can
I do this? I.e. I want to match \* or nothing. Is there a quantifier which
matches nothing?
Svein Erling Seldal
------------------------------
Date: Mon, 30 Jul 2001 14:42:15 +0200
From: "Peter Søgaard" <peter.sogaard@tjgroup.com>
Subject: Re: Regexp question
Message-Id: <3b655627$0$2645$edfadb0f@dspool01.news.tele.dk>
> I want to put an asterisk(*) after the command, and thus match 'persist*='
> or 'persist=', but not 'persistsomething=' nor 'persist*something='. How
can
> I do this? I.e. I want to match \* or nothing. Is there a quantifier which
> matches nothing?
\*? will match zero or one asterisk...
------------------------------
Date: Mon, 30 Jul 2001 14:48:12 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Regexp question
Message-Id: <7klamtkjm37cu7o790copstnouk980s8c5@4ax.com>
On Mon, 30 Jul 2001,
"Svein Erling Seldal" <Svein.Seldal@q-free.com> wrote:
>I want to match the following text:
>
>persist=<some_argument> or
>per=<some_argument>
>
>For this I use /^(persist|per)=(.*)/i
Try "/^per(:?sist)?=(.*)/i".
? matches 0 or 1 occurences of the preceeding expression. The "(:?"
declares a set of brackets that do not use memory, so you will get
your match in $1.
HTH,
--
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.
------------------------------
Date: Mon, 30 Jul 2001 09:55:44 -0400
From: Edward Little Titan/SRC x4621 <strawSPAM_BEGONEman@plexi.com>
Subject: Re: sprintf
Message-Id: <3B656760.264E133B@plexi.com>
I admit I didn't win a spelling bee in grade school. That's a short coming
I'll have to live with I guess. But, enough about me.
Based on what you have written in this reply of yours, it seems you have a
few issues too. The first of which is you don't read very carefully. My
message says clearly exactly two digits for minutes. Not one or two digits. I
was hoping to avoid ugly code like this:
if ($minutes < 10) {
$minutes = '0' . $minutes;
}
which, while it may be second nature to you, I was hoping for something a
little more elegant.
The next issue, of course, is one of personality. You seem to make a lot of
assumptions about the background of people you don't know. While I'm not a
doctor, my suspicion is that you lack any degree of self esteem and this is
your way of proving to yourself you own self worth.
Here are some search terms to assist you in being a little more
introspective.
Pitfalls of Toilet Training
psychoanalysis
Id, Ego, and the SuperEgo
Good Luck.
------------------------------
Date: 30 Jul 2001 09:00:08 -0500
From: Art Haas <arthur.haas@westgeo.com>
Subject: Re: sprintf
Message-Id: <lrae1mms9j.fsf@haasart1.dhcp.wg.waii.com>
Edward Little Titan/SRC x4621 <strawSPAM_BEGONEman@plexi.com> writes:
>
> Based on what you have written in this reply of yours, it seems you have a
> few issues too. The first of which is you don't read very carefully. My
> message says clearly exactly two digits for minutes. Not one or two digits. I
> was hoping to avoid ugly code like this:
>
> if ($minutes < 10) {
> $minutes = '0' . $minutes;
> }
>
> which, while it may be second nature to you, I was hoping for something a
> little more elegant.
>
sprintf("%02d", $minutes);
--
###############################
# Art Haas
# (713) 689-2417
###############################
------------------------------
Date: Mon, 30 Jul 2001 10:47:01 -0400
From: Edward Little Titan/SRC x4621 <strawSPAM_BEGONEman@plexi.com>
Subject: Re: sprintf
Message-Id: <3B657365.2C8B3852@plexi.com>
Art Haas wrote:
> Edward Little Titan/SRC x4621 <strawSPAM_BEGONEman@plexi.com> writes:
>
> >
> > Based on what you have written in this reply of yours, it seems you have a
> > few issues too. The first of which is you don't read very carefully. My
> > message says clearly exactly two digits for minutes. Not one or two digits. I
> > was hoping to avoid ugly code like this:
> >
> > if ($minutes < 10) {
> > $minutes = '0' . $minutes;
> > }
> >
> > which, while it may be second nature to you, I was hoping for something a
> > little more elegant.
> >
>
> sprintf("%02d", $minutes);
>
> --
> ###############################
> # Art Haas
> # (713) 689-2417
> ###############################
Thanks Mr. H.
That works for me.
------------------------------
Date: Mon, 30 Jul 2001 12:32:23 +0100
From: Andrew Paul Gorton <gortona@cs.man.ac.uk>
Subject: Starting a deamon from another deamon
Message-Id: <3B6545C7.975AF654@cs.man.ac.uk>
Hi All,
I have implemented a client/server architecture and on the server I need
it to start other deamon processes, such as a portscan detector. I have
tried using system () to start the other deamon process, which works but
it will not return control to the server. Does anyone know of a way
around this.
Cheers Andy
------------------------------
Date: 30 Jul 2001 16:05:11 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Starting a deamon from another deamon
Message-Id: <87itgabp1k.fsf@abra.ru>
APG> Hi All,
APG> I have implemented a client/server architecture and on the server I need
APG> it to start other deamon processes, such as a portscan detector. I have
APG> tried using system () to start the other deamon process, which works but
APG> it will not return control to the server. Does anyone know of a way
APG> around this.
On UNIX platforms you can fork() child process and run system() from
it.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Mon, 30 Jul 2001 13:03:43 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Starting a deamon from another deamon
Message-Id: <msmamtc219pb2suvlktime3p4rckaq99b3@4ax.com>
Andrew Paul Gorton wrote:
>I have implemented a client/server architecture and on the server I need
>it to start other deamon processes, such as a portscan detector. I have
>tried using system () to start the other deamon process, which works but
>it will not return control to the server. Does anyone know of a way
>around this.
fork() and exec()?
--
Bart.
------------------------------
Date: Mon, 30 Jul 2001 23:21:31 +1000
From: "Gregory Toomey" <nowhere@dot.com>
Subject: Re: Starting a deamon from another deamon
Message-Id: <8Yc97.17769$a04.72376@newsfeeds.bigpond.com>
"Andrew Paul Gorton" <gortona@cs.man.ac.uk> wrote in message
news:3B6545C7.975AF654@cs.man.ac.uk...
> Hi All,
>
> I have implemented a client/server architecture and on the server I need
> it to start other deamon processes, such as a portscan detector. I have
> tried using system () to start the other deamon process, which works but
> it will not return control to the server. Does anyone know of a way
> around this.
>
> Cheers Andy
You need daemonize (not sure which faq it is in; try searching perldoc.com).
use POSIX 'setsid';
sub daemonize {
chdir '/' or die "Can't chdir to /: $!";
open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
open STDOUT, '>/dev/null'
or die "Can't write to /dev/null: $!";
defined(my $pid = fork) or die "Can't fork: $!";
exit if $pid;
setsid or die "Can't start a new session: $!";
open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
}
gtoomey
------------------------------
Date: 30 Jul 2001 07:18:55 -0700
From: vivekvp@spliced.com (vivekvp)
Subject: VVP: Displaying records 1 by 1?
Message-Id: <9bf633be.0107300618.757258d9@posting.google.com>
Sorry, I think I have left out some info.
Yes -I am using an informix Database - but I want to use Perl as the
interface to the web.
I want to use Perl code to output the data to the web by interfacing
with the Informix database via ODBC (setup and working fine.)
I would like to take the results of a query - and have the user be
able to scroll through - record by record - thus the next buttons.
I do not want to use Informix 4gls to output the data to the web.
Possible with Perl?
Sorry for the confusion.
Thanks,
V
"Prasad, Victor [FITZ:K500:EXCH]" wrote:
>
> Hello,
>
> I am connected to an Informix database. I want to be able to query a
> table and output to a web page with NEXT and PREVIOUS buttons so they
> can scroll through the data record by record. Not getting all the data
> dumped out on the page.
>
> ie.
>
> NAME [john]
> JOB [math]
>
> -------
>
> (next record after next button is pressed)
>
> NAME [mary]
> JOB [spelling]
>
> etx.
>
> Thanks,
>
> V
------------------------------
Date: Mon, 30 Jul 2001 13:27:16 +0200
From: "Peter Sogaard" <peter.sogaard@tjgroup.com>
Subject: Re: where is poetry.ps?
Message-Id: <3b654494$0$2610$edfadb0f@dspool01.news.tele.dk>
> now I'm searching for sharon's report about perl poem
> "poetry.ps"."Programming Perl" wrote it's on
> www.perl.com/CPAN/misc/poetry.ps but I can't
> find any copies there.
Hmm, I've been unable to find any copies of the paper itself too...but i
found a copy of some of the poems in the paper though...
http://internet.ls-la.net/index.html#comppoetry
------------------------------
Date: Mon, 30 Jul 2001 20:59:13 +0900
From: "miyahara makoto" <t98675nk@sfc.keio.ac.jp>
Subject: Re: where is poetry.ps?
Message-Id: <9k3hna$t94$1@news.sfc.keio.ac.jp>
> Hmm, I've been unable to find any copies of the paper itself too...but i
> found a copy of some of the poems in the paper though...
>
> http://internet.ls-la.net/index.html#comppoetry
thanx a lot!
Every scripts are so cool. perl poetry seems to "require"
some senses of philosophy and coding sense anyway...
------------------------------
Date: Mon, 30 Jul 2001 11:27:56 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Who can help me about the confused (..) operator?
Message-Id: <3b6544bc.4082$122@news.op.net>
In article <th52mt4nd1hjrocb0p55j9i7o9ko4k6paf@4ax.com>,
MMX166+2.1G HD <no@mail.addr> wrote:
>but, on my Agent reader, they are just a lot of source codes.
That's right. It is a Perl program.
If you want to see what it does, you run it.
But it probably won't work on a Windows system.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Mon, 30 Jul 2001 11:31:13 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Who can help me about the confused (..) operator?
Message-Id: <3b654556.4090$60@news.op.net>
In article <9jhs4r$26fs$1@agate.berkeley.edu>,
Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
>Thinking about it, I discovered that I do not know where this bit is
>stored.
I don't remember, but there is some discussion of this in the p5p
archive in the 'Shared OPs Among Closures' thread.
>Is it documented anywhere?
I do not think so.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1406
***************************************