[19530] in Perl-Users-Digest
Perl-Users Digest, Issue: 1725 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 10 14:05:34 2001
Date: Mon, 10 Sep 2001 11:05: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: <1000145112-v10-i1725@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 10 Sep 2001 Volume: 10 Number: 1725
Today's topics:
Re: @INC on VMS (Malcolm Dew-Jones)
Annoying warning message <alicia090677@hotmail.com>
Re: Annoying warning message (Anno Siegel)
Re: Baiting Gozilla to obtain quality code for nothing! (Anno Siegel)
Re: Baiting Gozilla to obtain quality code for nothing! <godzilla@stomp.stomp.tokyo>
Re: color output in perl? <wizard@psychodad.com>
Re: Daily iteration news@roaima.demon.co.uk
Error in perlrun: "Bad option" <alicia090677@hotmail.com>
Re: Error in perlrun: "Bad option" <jason-hoffoss@prodigy.net>
Re: Error in perlrun: "Bad option" <alicia090677@hotmail.com>
globbing problems <mdulrich@unity.ncsu.edu>
Re: globbing problems <wizard@psychodad.com>
Re: globbing problems (Tad McClellan)
Re: globbing problems (Garry Williams)
HELP: Capture a page? <Nigel_member@newsguy.com>
Re: HELP: Capture a page? (Tad McClellan)
Re: How can I correct "Use of uninitialized value in su (Tad McClellan)
Re: How can I popup a info window in perltk, and have e <wizard@psychodad.com>
Re: How can I popup a info window in perltk, and have e (Stan Brown)
Re: How to code windows service ? <news@simonflack.com>
Re: Is there any perl script formater? <pne-news-20010910@newton.digitalspace.net>
Re: lost children after fork() news@roaima.demon.co.uk
Re: lost children after fork() (Randal L. Schwartz)
mod_perl and "Modification of read-only value" <o.moser@mobilkom.at>
mysql INSERT is broken by some charactors in the insert <bing-du@tamu.edu>
PERL DBI module question <tschultz@lynx.neu.edu>
Re: PERL DBI module question (John J. Trammell)
Re: Perl docs <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Sep 2001 10:00:39 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: @INC on VMS
Message-Id: <3b9cf1b7@news.victoria.tc.ca>
Patrick Flaherty (Patrick_member@newsguy.com) wrote:
: How do I define @INC on VMS? (Presumably with a logical name). Looked through
: the documentation and it's not yet apparent to me.
: thanx.
: pat
I did the following to put [.temp] into the INC path
$ define PERL5LIB "[.temp]"
also
$ perl "-I[.temp]"
and also
BEGIN{ unshift @INC , "[.temp]"; }
--
Want to access the command line of your CGI account? Need to debug your
installed CGI scripts? Transfer and edit files right from your browser?
What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgi
------------------------------
Date: 10 Sep 2001 11:35:12 -0400
From: Alicia <alicia090677@hotmail.com>
Subject: Annoying warning message
Message-Id: <9nimjg$h8s$1@panix3.panix.com>
The following snippet:
use Getopt::Std qw(getopts);
getopts("h");
if(defined $Getopt::Std::opt_h) {
print HELP;
exit(0);
}
produces the infuriating message:
Name "Getopt::Std::opt_h" used only once: possible typo at ./MakeEvidenceTallies.p l line 22.
One workaround is to prepend the line:
use vars '$opt_h'
Is there no other better way to silence the idiotic warning? The
warning shouldn't be there anyway. $Getopt::Std::opt_h *is* a package
variable (according to the documentation for Getopt::Std, anyway).
Thanks,
ali
------------------------------
Date: 10 Sep 2001 17:30:16 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Annoying warning message
Message-Id: <9nitb8$7t5$1@mamenchi.zrz.TU-Berlin.DE>
According to Alicia <alicia090677@hotmail.com>:
>
> The following snippet:
>
> use Getopt::Std qw(getopts);
> getopts("h");
> if(defined $Getopt::Std::opt_h) {
> print HELP;
> exit(0);
> }
>
> produces the infuriating message:
>
> Name "Getopt::Std::opt_h" used only once: possible typo at
> ./MakeEvidenceTallies.p l line 22.
>
> One workaround is to prepend the line:
>
> use vars '$opt_h'
>
> Is there no other better way to silence the idiotic warning? The
Yes, give getopt a hash(ref) to populate:
my %opts;
getopts( 'h', \ %opts);
if ( $opts{ h} ) {
# etc
}
Much better than infesting a symbol table with unforseeable variable
names.
Anno
------------------------------
Date: 10 Sep 2001 15:33:13 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Baiting Gozilla to obtain quality code for nothing!!
Message-Id: <9nimfp$3nu$1@mamenchi.zrz.TU-Berlin.DE>
According to Kate <kathrynmwood@earthlink.com>:
>
>
>
> > Until I learned that this Godzilla goes by the "name" kira and claims to
> be
> > female, that's exactly what I took the monikers to mean. Whoever this
> person
> > is, s/he definitely has some serious issues. A desperate need for
> attention
> > coupled with an underlying fear of being exposed isn't the sign of a
> normal
> > person. I've taken the route of ignoring anything it writes now because it
> > isn't worth the wasted effort to get through the pretentious verbosity to
> > see what it has to say - and anyone who hides behind pseudonyms isn't
> worth
> > debating with.
> >
> > Matt
> >
>
> 2 words - lighten up! This isn't a group therapy session, which is a good
> thing cuz we might all be in a lot of trouble if it was. She obviously
> enjoys her work, and she's good at it.
Trouble is, she isn't, but talks as if she were. Explicitly, and by
example, she spreads bad coding practices. Otherwise, even fewer people
would bother to reply to her.
> And if she just says what every woman
> that ever went into a "man's" profession thinks 50 times a day - good!
> Someone has to say it, don't they.
You say that as if her feminist phraseology wasn't just so much balderdash,
just like the occasional mention of Che Guevara and the "Rouge Programmer"
attitude. Kira has discredited herself politically to a degree that
nothing she says can be taken at face value.
Anno
------------------------------
Date: Mon, 10 Sep 2001 08:41:10 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Baiting Gozilla to obtain quality code for nothing!!
Message-Id: <3B9CDF16.B2813604@stomp.stomp.tokyo>
Randal L. Schwartz wrote:
> Kate wrote:
(snipped)
> > She obviously enjoys her work, and she's good at it.
> Sounds like you have your *own* axe to grind....
As do you and others, Randal.
My ostentatious opinion is you Sissified Geeks do not
have the prerequisite mental muscle to effectively and
efficiently wield a revanchist axe.
Godzilla! Queen Of Axeblunters
------------------------------
Date: Mon, 10 Sep 2001 12:06:34 -0500
From: "Michael D. Kirkpatrick" <wizard@psychodad.com>
Subject: Re: color output in perl?
Message-Id: <3B9CF31A.B1B085A@psychodad.com>
Wyzelli wrote:
> "Philip Newton" <pne-news-20010910@newton.digitalspace.net> wrote in message
> news:a1ioptg100047f729l961q8r7f99u4lmqs@4ax.com...
> >
> > Cheers,
> > Philip, who notes that `perldoc -q colour` would not have been as
> > helpful
>
> Yeah, well that's the yanks for you. :)
>
> --
> push@x,$_ for(a..z);push@x,' ';
> @z='092018192600131419070417261504171126070002100417'=~/(..)/g;
> foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
Check out this one:
use LWP::Simple;
$doc = get 'http://www.yahoo.com';
if ($doc =~ /.{14}(.).{7}(...).+?"(.).+r(.)(
).(.).+td.{2}(.).{4}(.).{3}(..).{4}(.)(.).+/){
$text = uc($1);
$text .= "'$4$5$6$5$3$9$7$5$11$6$8k$9$5$10$2";
print $text;
}
------------------------------
Date: 10 Sep 2001 09:36:23 -0700
From: news@roaima.demon.co.uk
Subject: Re: Daily iteration
Message-Id: <cf81ce2d.0109100836.7bed228b@posting.google.com>
"Sean Hamilton" <sh@planetquake.com> wrote in message news:<YvQl7.5148$C57.684838@news1.telusplanet.net>...
> This is hardly a wheel. It should be a simple correction for when we are in
> DST. A one-liner.
Timezones are hard to get right properly. Sadly, if you think they're
easy then you've missed the complexities.
Chris
------------------------------
Date: 10 Sep 2001 11:07:47 -0400
From: Alicia <alicia090677@hotmail.com>
Subject: Error in perlrun: "Bad option"
Message-Id: <9nil03$d9n$1@panix3.panix.com>
There seems to be an error in the perlrun page (or else in bash!).
If I try the suggested:
#!/bin/sh -- -*- perl -*- -w
eval 'exec perl -S $0 ${1+"$@"}'
if 0
I get:
% myprog.pl
sh: --: bad option
If I try
#!/bin/sh
# -*- perl -*- -w
eval 'exec perl -S $0 ${1+"$@"}'
if 0
I now get
% myprog.pl
/bin/sh: -S: bad option
Bug? Feature?
Workaround?
I'm running under Linux RH6.2 + bash.
Thanks,
ali
------------------------------
Date: Mon, 10 Sep 2001 16:11:47 GMT
From: "JASON HOFFOSS" <jason-hoffoss@prodigy.net>
Subject: Re: Error in perlrun: "Bad option"
Message-Id: <7D5n7.4103$CY6.401323183@newssvr17.news.prodigy.com>
"Alicia" <alicia090677@hotmail.com> wrote in message
news:9nil03$d9n$1@panix3.panix.com...
>
> There seems to be an error in the perlrun page (or else in bash!).
>
> If I try the suggested:
>
> #!/bin/sh -- -*- perl -*- -w
> eval 'exec perl -S $0 ${1+"$@"}'
> if 0
Ok, /bin/sh is not bash. That is sh. You should use /bin/bash instead if
you really want bash.
> I get:
>
> % myprog.pl
> sh: --: bad option
This doesn't surprise me.
> If I try
>
> #!/bin/sh
> # -*- perl -*- -w
> eval 'exec perl -S $0 ${1+"$@"}'
> if 0
>
> I now get
>
> % myprog.pl
> /bin/sh: -S: bad option
This is a bit more confusing. I don't really know shell programming very
well, though. Is eval a valid shell command or program? It looks like it
must be. That almost looks like it's perl code, though, which if that's
what it's meant to be you should be using #!/usr/bin/perl instead of
#!/bin/sh.
> Bug? Feature?
>
> Workaround?
>
> I'm running under Linux RH6.2 + bash.
>
> Thanks,
>
> ali
------------------------------
Date: 10 Sep 2001 13:45:44 -0400
From: Alicia <alicia090677@hotmail.com>
Subject: Re: Error in perlrun: "Bad option"
Message-Id: <9niu88$dl1$1@panix3.panix.com>
In <7D5n7.4103$CY6.401323183@newssvr17.news.prodigy.com> "JASON HOFFOSS" <jason-hoffoss@prodigy.net> writes:
>Ok, /bin/sh is not bash. That is sh. You should use /bin/bash instead if
>you really want bash.
In RH6.2:
$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Dec 23 2000 /bin/sh -> bash
------------------------------
Date: Mon, 10 Sep 2001 11:21:14 -0400
From: Marc Ulrich <mdulrich@unity.ncsu.edu>
Subject: globbing problems
Message-Id: <3B9CDA6A.89816A5B@unity.ncsu.edu>
Why doesn't the following print a list of files in my directory? It
seems I don't know the syntax for glob though I've looked at the man
page & various websites.
@filenames = glob([A-Za-z0-9]);
foreach $file (@filenames)
{ print "$file\n"; }
Thanks,
Marc
------------------------------
Date: Mon, 10 Sep 2001 10:52:00 -0500
From: "Michael D. Kirkpatrick" <wizard@psychodad.com>
Subject: Re: globbing problems
Message-Id: <3B9CE1A0.FB087565@psychodad.com>
Marc Ulrich wrote:
> Why doesn't the following print a list of files in my directory? It
> seems I don't know the syntax for glob though I've looked at the man
> page & various websites.
>
> @filenames = glob([A-Za-z0-9]);
> foreach $file (@filenames)
> { print "$file\n"; }
>
> Thanks,
> Marc
Does any of your file names contain a '.' in them?
Your regex is only looking for the following:
Letters A-Z, a-z, and 0-9.
If a file name contains '.', it does not meet the regex criteria. Add
the '.' in your regex.
------------------------------
Date: Mon, 10 Sep 2001 16:22:48 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: globbing problems
Message-Id: <slrn9ppn3m.ul8.tadmc@tadmc26.august.net>
Michael D. Kirkpatrick <wizard@psychodad.com> wrote:
>Marc Ulrich wrote:
>
>> Why doesn't the following print a list of files in my directory? It
>> seems I don't know the syntax for glob though I've looked at the man
>> page & various websites.
glob() takes a string to expand. You are passing it a reference
to an anonymous array.
You should enable warnings (and "strict" too, while we're at it).
You should put quotes around your strings.
>> @filenames = glob([A-Za-z0-9]);
my @filenames = glob( '[A-Za-z0-9]' );
That will only match 1-character long filenames, just like
it would at the shell prompt. You don't have any wildcards
there.
You haven't said what it is that you want to glob(), so we
cannot help you fix your glob pattern. If you want to glob
files that _start with_ those characters, then:
my @filenames = glob( '[A-Za-z0-9]*' );
>Does any of your file names contain a '.' in them?
Does not matter.
>Your regex
There are *no* regular expressions anywhere in this thread!
Globbing patterns are NOT regular expressions.
Regular expressions have boatloads of metacharacters, globbing
has only 3 metacharacters.
>If a file name contains '.', it does not meet the regex criteria. Add
>the '.' in your regex.
There is no regex. Adding dot to the pattern does not fix (or even
address!) the real problem.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 10 Sep 2001 16:59:07 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: globbing problems
Message-Id: <slrn9ppsar.344.garry@zfw.zvolve.net>
On Mon, 10 Sep 2001 11:21:14 -0400, Marc Ulrich <mdulrich@unity.ncsu.edu> wrote:
> Why doesn't the following print a list of files in my directory? It
> seems I don't know the syntax for glob though I've looked at the man
> page & various websites.
>
> @filenames = glob([A-Za-z0-9]);
> foreach $file (@filenames)
> { print "$file\n"; }
Perl would tell you why, if you ask it.
Enable warnings and more will become clear. Enable strictures and
even more will become clear.
The glob() function wants a string. You are passing it an anonymous
array reference instead. If you were using strict, that would not
compile because of the bare words. If you meant "[A-Za-z0-9]" instead
of [A-Za-z0-9], then that glob would only match one-character file
names.
You probably want "*" to match all file names that don't begin with a
period (.).
--
Garry Williams
------------------------------
Date: 10 Sep 2001 08:16:06 -0700
From: Nigel Heinsius <Nigel_member@newsguy.com>
Subject: HELP: Capture a page?
Message-Id: <9nilfm02l9t@drn.newsguy.com>
I hope someone can help me with this.
Is it possible to capture a complete HTML page that has been written to a
browser and save this in some variable?
Someone at work has asked me to 'capture' a page his ASP script has written to
the browser (with variables). This page will then be sent to a script which will
write the page to a server and email it as an attachment to the end user. I can
do this with a PERL script, but I need to "get" the page without having to
completely rebuild it using javascript forms and the PERL script.
Any thoughts?
------------------------------
Date: Mon, 10 Sep 2001 16:22:49 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: HELP: Capture a page?
Message-Id: <slrn9ppncn.ul8.tadmc@tadmc26.august.net>
Nigel Heinsius <Nigel_member@newsguy.com> wrote:
>I hope someone can help me with this.
^^^^^^^
Too lazy to spend even 30 seconds trying to help yourself first?
That's what it is going to look like to most of us...
>Is it possible to capture a complete HTML page
perldoc -q HTML
"How do I fetch an HTML file?"
You are expected to check the Perl FAQs *before* posting to the
Perl newsgroup.
>write the page to a server and email it as an attachment to the end user. I can
>do this with a PERL script,
^^^^^^^^^^^
You mean either "Perl script" or "perl script" there.
Only those not in the know spell it "PERL"...
>but I need to "get" the page without having to
^^^
^^^ serendipitous, heh.
>completely rebuild it using javascript forms and the PERL script.
>
>Any thoughts?
use LWP::Simple; # part of the 'libwww' bundle from CPAN
my $htmlpage = get 'http://www.somewhere.com/silly.asp';
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 10 Sep 2001 15:10:25 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How can I correct "Use of uninitialized value in substitution iterator at ..."?
Message-Id: <slrn9ppj8h.u9q.tadmc@tadmc26.august.net>
guest <guest@email.com> wrote:
>I'm having a problem of using the example of "removing C/C++ comments" in
>page 293 of in the "Mastering Regular Expressions" book
>written by Jeffrey E. F. Friedl. The problem occurred when I used "(?:" in
^^^^^^^^^^^
>the "Traditional C comments" statement.
That has nothing to do with your problem.
>Dan
>(316-636-8484)
There are lots of kooks on the internet. You should consider
carefully whether you want to give them your phone number...
Your word-wrapping has broken the code. Please don't post broken code.
>###Line below is 8
>$dataFile =~ s {
> # First, we'll list things we want to match, but not throw
>away
> (
> [^"'/]+ # other stuff that couldn't possibly
>begin one of other alternatives
> | # -or-
> (?:"[^"\\]*(?:\\.[^"\\]*)*" [^"'/]*)+ #
>doublequoted string
> | # -or-
> (?:'[^'\\]*(?:\\.[^'\\]*)*' [^"'/]*)+ #
>singlequoted constant
> )
> | # OR...
> # ...we'll match a comment. Since it's not in the
>$1 paraenthese above,
> # the comments will disappear when we use $1 as the
>replacement text.
>
> / # (all
>comments start with a slash)
> (?:
> \*[^*]*\*+(?:[^/*][^*]*\*+)*/ #
>Traditional C comments
> | # -or-
> /[^\n]* # C++
>//-style comments
> )
> }{$1}gsx;
[snip]
>Use of uninitialized value in substitution iterator at rcomments line 8.
There are only 2 variables on line 8, $dataFile and $1. A quick
print $dataFile;
before the s/// shows that that isn't the one, so it must be $1
that is not defined ("uninitialized value" means "undef").
Q: How can $1 be undef at this point?
A: When the "OR" part above matches (when we've found a comment to ignore).
To avoid the warning, just check the define()edness of $1:
...
}{defined $1 ? $1 : ''}gsxe; # used to be }{$1}gsx;
^
^
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 10 Sep 2001 10:54:34 -0500
From: "Michael D. Kirkpatrick" <wizard@psychodad.com>
Subject: Re: How can I popup a info window in perltk, and have executuon continue?
Message-Id: <3B9CE23A.A00DF633@psychodad.com>
Stan Brown wrote:
> I have a perlTK script which does a (potenialy long) db query. I would like
> to popup n information window to advise the user that this may take a
> whi;e. I would like this window to popup, and have the main executuin
> return to the TK mainloop. I will dismiss this opoup when the process is
> done. Or the user can dismiss it.
>
> The only way I see to do this is to spawn a child process. Is this really
> necessary? is there a simpler way?
Use javascript...
------------------------------
Date: 10 Sep 2001 13:26:27 -0400
From: stanb@panix.com (Stan Brown)
Subject: Re: How can I popup a info window in perltk, and have executuon continue?
Message-Id: <9nit43$8uf$1@panix2.panix.com>
In <3B9CE23A.A00DF633@psychodad.com> "Michael D. Kirkpatrick" <wizard@psychodad.com> writes:
>Stan Brown wrote:
>> I have a perlTK script which does a (potenialy long) db query. I would like
>> to popup n information window to advise the user that this may take a
>> whi;e. I would like this window to popup, and have the main executuin
>> return to the TK mainloop. I will dismiss this opoup when the process is
>> done. Or the user can dismiss it.
>>
>> The only way I see to do this is to spawn a child process. Is this really
>> necessary? is there a simpler way?
>Use javascript...
Now thats a helpful reply.
------------------------------
Date: Mon, 10 Sep 2001 18:33:19 +0100
From: "Simon Flack" <news@simonflack.com>
Subject: Re: How to code windows service ?
Message-Id: <9nitf2$7tt2u$1@ID-83895.news.dfncis.de>
> 2. Dave Roth's win32::daemon module
> This module is released under gnu GPL license and
> it requires external ini file. Both of these features
> does not suit to my purpose.
I've used Win32::Daemon several times and haven't ever had to use an
external ini file. Can you explain what you mean?
> Does somebody know how to code a program which can be
> executed as windows service ?
> (Standalone code which can be defined as service in
> the registry.)
The other option is PerlCtrl (from activestate) - it's part of the Perl
Development Kit. Although I think that you have to subscribe to "ASPN Perl"
to get it these days. It allows you to distribute freestanding windows
services written in Perl. It uses PerlApp to compile your script into an
.exe.
Bes of luck
Simon
------------------------------
Date: Mon, 10 Sep 2001 18:56:13 +0200
From: Philip Newton <pne-news-20010910@newton.digitalspace.net>
Subject: Re: Is there any perl script formater?
Message-Id: <a0sppt008873uviphfg40bb70fa9u288eo@4ax.com>
On Mon, 10 Sep 2001 14:18:59 GMT, tadmc@augustmail.com (Tad McClellan)
wrote:
> You are expected to check the Perl FAQs *before* posting to the
> Perl newsgroup.
This particular FAQ is slightly out of date due to the existence of
perltidy.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: 10 Sep 2001 16:54:52 GMT
From: news@roaima.demon.co.uk
Subject: Re: lost children after fork()
Message-Id: <3b9ce24b@news.netserv.net>
Brandon Hines <brandon_usenet@2i.com> wrote:
> I am attempting to write some code that will run a few pools of sub
> processes. I think I've got this fork() thing figured out but I am
> having one problem--I leave defunct children.
Me too. I solved it in my case by logging all the child pids, and
periodically testing to see whether they're still around (kill 0,
pidlist...). It's most interesting to discover that children are indeed
disappearing without trace. I assumed it was (my) flakey code, but we
seem both to be doing the same thing.
Chris
------------------------------
Date: 10 Sep 2001 10:25:07 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: lost children after fork()
Message-Id: <m14rqbj6vg.fsf@halfdome.holdit.com>
>>>>> "news" == news <news@roaima.demon.co.uk> writes:
news> Brandon Hines <brandon_usenet@2i.com> wrote:
>> I am attempting to write some code that will run a few pools of sub
>> processes. I think I've got this fork() thing figured out but I am
>> having one problem--I leave defunct children.
news> Me too. I solved it in my case by logging all the child pids, and
news> periodically testing to see whether they're still around (kill 0,
news> pidlist...). It's most interesting to discover that children are indeed
news> disappearing without trace. I assumed it was (my) flakey code, but we
news> seem both to be doing the same thing.
As I said in private mail, but I guess I'll now repeat it publicly:
There is not a 1-to-1 correlation between "kid dying" and SIGCHLD.
First, signals are 1-bit deep, so if many events of the same type
trigger before a process gets a chance to respond, only one of that
signal is noted.
Second, Perl itself waits for processes when it performs wait(),
waitpid(), or even things like system() and ``. It notes any
processes it sees while performing those in a place that SIGCHLD
cannot see (but a "wait" can fake later), so you won't ever get a
SIGCHLD for those either.
So, at best, you wait for a SIGCHLD, and you reap *all* kids that have
come up at that point. But don't wait for a SIGCHLD for a dead kid,
and especially not one for *every* dead kid.
Search my columns for "fork", and you'll see how I handle it.
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Mon, 10 Sep 2001 19:25:32 +0200
From: Oliver Moser <o.moser@mobilkom.at>
Subject: mod_perl and "Modification of read-only value"
Message-Id: <iltppt80p51fp6th2hpr2f3hjireop6rtu@4ax.com>
Dear NG,
I ran into problems using a while loop after a file open. This
is exactly what i do:
open( TEMPLATE, "<$TEMPLATE" ) || die "Canno...:$!";
while (<TEMPLATE>) {
print $_;
}
and i get this error mesage "Modification of read-only value attempted
at... "
Any ideas?
regards,
Oliver
------------------------------
Oliver Moser
mobilkom austria AG & Co. KG
IT://mob.app
Mobil: +43-664-331-2544
mailto:o.moser@mobilkom.at
------------------------------
Date: Mon, 10 Sep 2001 12:36:24 -0500
From: Bing Du <bing-du@tamu.edu>
Subject: mysql INSERT is broken by some charactors in the inserted record
Message-Id: <3B9CFA18.D2020A6C@tamu.edu>
Hi,
Mysql version: 3.23.39. Perl 5.005.
My Perl script has the following statement. But sometimes it gives
'ERROR 1064: You have an error in your SQL syntax near...'. Then I
notice that the value that $value holds has a "'" or maybe some other
characters that INSERT does not like.
$sth = $dbh->prepare("INSERT INTO $table (var_name,var_value) values
('$name','$value')");
What should I do to get the record inserted? Seems PHP has
addslashes(). Does Perl have some similar funtion that can help prevent
SQL statement from being broken by weird characters?
Appreciate any help!
Bing
------------------------------
Date: Mon, 10 Sep 2001 16:02:52 GMT
From: "Tim Schultz" <tschultz@lynx.neu.edu>
Subject: PERL DBI module question
Message-Id: <Cu5n7.1930$m5.2057320@newsfeed1.thebiz.net>
I have the DBI module (or specifically the Msql-Mysql-modules) installed.
(Linux Apache PERL 5.00503)
My test script (chmod 755ed) compiles and runs fine from the command line
however running this script from the browser generates the garden variety
505. tailing the error log generates "failed to open log file fopen:
Permission denied".
Server config problem?.Anyone have any suggestions?
Thanks in advance,
-Jamie
------------------------------
Date: 10 Sep 2001 16:21:31 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: PERL DBI module question
Message-Id: <slrn9ppq4b.npc.trammell@haqq.hypersloth.net>
On Mon, 10 Sep 2001 16:02:52 GMT, Tim Schultz <tschultz@lynx.neu.edu> wrote:
> I have the DBI module (or specifically the Msql-Mysql-modules) installed.
> (Linux Apache PERL 5.00503)
> My test script (chmod 755ed) compiles and runs fine from the command line
> however running this script from the browser generates the garden variety
> 505. tailing the error log generates "failed to open log file fopen:
> Permission denied".
> Server config problem?.Anyone have any suggestions?
Is your script trying to open the log file? My guess is that your
Apache daemon is running your CGI script as nobody.nobody, and that's
your problem. Not a Perl problem, really.
--
If the organizational structure is threatening in any way, nothing is
going to be documented until it is completely defensible.
- F. Brooks, _The Mythical Man-Month_
------------------------------
Date: Mon, 10 Sep 2001 15:11:20 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl docs
Message-Id: <2nlppt0mbaiffcpla09sh8gjhep3vu5rs2@4ax.com>
"ekkis" <e@nospam:[arix.com]> wrote:
>does anyone know where I could download the Perl HTML documentation? I
>don't want to keep using perldoc.com because it's sometimes unavailable so
>I'd like to install this on my web server... but I can't find it!
Your "web server"? Why don't you have a local installation of Perl?
Writing the scripts and debugging can then be done faster, because you
don't have to upload the file everytime to test it.
And then, you'll have a local copy of the documentation as well. In
fact, if you have a Windows Perl (Activestate or IndigoPerl), you'll
have them in two formats: plain pod, usable/searchable with perldoc, and
in HTML.
For pod, use a text editor that allows you to call external programs,
with a user supplied argument, and capture the output. Then you can make
"perldoc" into a tool callable from the editor as plain text. I do that.
It doesn't look as "cool" as the html, but I prefer using this method
for searching.
If your server is on Unix you can telnet in and run perldoc from the
command line.
--
Bart.
------------------------------
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 1725
***************************************