[11011] in Perl-Users-Digest
Perl-Users Digest, Issue: 4611 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 10 06:07:12 1999
Date: Sun, 10 Jan 99 03:00:17 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 10 Jan 1999 Volume: 8 Number: 4611
Today's topics:
Re: Beginner problem <design@raincloud-studios.com>
Chat on the web.. check these out 484 tdnguc@start.com.au
Re: CONCLUSIVE PROOF: Jesus *is* King of the Jews ! (FUCAUFLED)
Re: Delete Directory Paradox?? <design@raincloud-studios.com>
Re: Easy question... <rigbyr@earthlink.net>
Re: fork under Win32 -- Activestate!? ruxfounder@my-dejanews.com
Form Prefill - How To? (Robb Sands)
Re: Form Prefill - How To? <design@raincloud-studios.com>
Re: I don't know ANYTHING <design@raincloud-studios.com>
Re: messageboard <design@raincloud-studios.com>
Re: Newbie Question - Matt's wwwboard <chatmaster@c-zone.net>
Not printing if blank line found <melton@diagdata.com>
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl Criticism <ajohnson@gatewest.net>
Re: Perl Criticism <design@raincloud-studios.com>
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl Criticism <dgris@moiraine.dimensional.com>
Re: Perl Criticism <chatmaster@c-zone.net>
Re: Perl Criticism (Bart Lateur)
Re: Perl Criticism <design@raincloud-studios.com>
Prefilling a form - how to? (Robb Sands)
PROBLEM with Win32::EventLog <buga@ipm.lviv.ua>
Rambling through hash.... <design@raincloud-studios.com>
Threads Solaris memory leak ? signals handling? ruxfounder@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Jan 1999 07:59:51 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Beginner problem
Message-Id: <779mln$kg@bgtnsc03.worldnet.att.net>
>#!/usr/local/bin/perl
>print "content-type: text/plain\n\n";
>print "This is a test";
Since you were caught early enough... start adding a -w to that path..
like so...
>#!/usr/local/bin/perl -w
It will help you in debugging as you go along.
Now for your problem...
>Internal Server Error
>The server encountered an internal error or misconfiguration and was
>unable to complete your
>request.
>Please contact the server administrator, and inform them of the time
the
>error occurred, and anything you might have done that may have caused
>the error.
Your hint here are the words misconfiguration and internal error. Your
coding is okay, but something is causing the system to go Huh? It is
your path to Perl.
Check with your hosting provider and make sure the _path to Perl_ is
correct.
Some common variations...
>#!/usr/local/bin/perl -w
>#!/usr/bin/perl -w
The top two are the most likely, although I have used servers with these
before...
>#!/usr/bin/perl5 -w
>#!/usr/bin/perl5.002 -w
Again, look on the website for your hosting provider, they should have
this information posted in a scripts section or CGI area.
CT
------------------------------
Date: 10 Jan 1999 09:56:36 GMT
From: tdnguc@start.com.au
Subject: Chat on the web.. check these out 484
Message-Id: <779tgk$unb$4@news.wantree.com.au>
Hi,
Checkout these forums for webmasters: http://www.htmldirectory.com
very nice interface, lots of related topics.
Cya
htmldirectory@start.com.au
jzfqbmmzlhjqzijrbyilevkgusknlpjwrelwoiumnehkfdodqkimukenexylvzmtqpcb
------------------------------
Date: 10 Jan 1999 09:47:49 GMT
From: fucaufled@aol.com (FUCAUFLED)
Subject: Re: CONCLUSIVE PROOF: Jesus *is* King of the Jews ! ! !
Message-Id: <19990110044749.01577.00007424@ng36.aol.com>
"It sure seems fitting that your entire religion is based on worshiping a dead
jew on a stick"
- Ron Kuby
------------------------------
Date: 10 Jan 1999 07:13:57 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Delete Directory Paradox??
Message-Id: <779jvl$bsl@bgtnsc02.worldnet.att.net>
>> rmdir($fullpath) || &CgiDie("Cannot remove directory in delete
>> directory subroutine. Reason: $!");
>> Cannot remove directory in delete directory subroutine. Reason: Is a
>> directory
>- Check the permissions of the parentdirectory of the directory to be
> removed.
>- Check whether the directory is empty
>- Check whether the directory is in use by something
i would like to add...
check if you are using " or ' when setting up $fullpath with another
variable a few lines earlier. <shaking head>
CT
------------------------------
Date: Sun, 10 Jan 1999 01:44:54 -0500
From: "rigbyr" <rigbyr@earthlink.net>
Subject: Re: Easy question...
Message-Id: <779hs2$ns7$1@fir.prod.itd.earthlink.net>
Luc,
An easy way to ensure that a variable contains only digits is to pattern
match with the \d (digit,same as [0-9]) regular expression
STATEMENT if ( $variable =~ /^\d+$/ ) # do statement if you match on line
containing only digits
Rob
rigbyr@earthlink.net
news.rogers.ca wrote in message <777vuk$2el$1@news.on>...
>In perl, how do I do an IF statement to make sure a variable is only
>digits... not chars (like isalpha() / isdigit())
>
>ie: if ( isdigit($variable) )
>
>Thanks,
>
>Luc,
>luc2@travelpod.com
>
>
------------------------------
Date: Sun, 10 Jan 1999 08:33:30 GMT
From: ruxfounder@my-dejanews.com
Subject: Re: fork under Win32 -- Activestate!?
Message-Id: <779okq$vsr$1@nnrp1.dejanews.com>
In article <3697c4c4.4581898@news.skynet.be>,
bart.lateur@skynet.be (Bart Lateur) wrote:
Hi !
> Richard Bateman wrote:
>
> > I seem to have run into a brick wall as far
> >as spawning child processes to process the requests. I figured out how
> >to have a program wait on a port, in this case port 110, but only one
> >person can connect to it at a time. Does anybody know a way to work
> >around the missing "fork" function in WindowsNT?
>
> I never understood how it's possible for several programs to share the
> same port, and yet, each client finding it's way back to the copy of the
> program it originally connected to. But anyway.
May be I'm wrong,
but each TCP (and UDP?) packet contains information
about port number and APPLICATION number. And therefore it is
possible:-)
>
> Isn't it possible to asynchroniously launch another script, that takes
> care of one connection? It's definitely possible in Windows to have
> multiple copies of one program running at the same time, if the program
> allows it.
I'm not sure about AS Perl, but as of Perl 5.005_02 you can
use threds instead of fork()... I've tested one script both on
Solaris and NT that use threads to serve many simultaneous
connections. Solaris version of Perl or (more probably)
Solaris itself has a memory leak or something in threads lib, and
Windows NT Perl (or system?) version has a different meaning of recv() call.
Probably bugs in Borland libs?
Anyway, I can send you a script to test and think about.
-Dima.
>
> It looks like system and `...` do work synchroniously. Using
> system("start script.pl") MAY help. (I've never used "start" in my
> life).
>
> HTH,
> Bart.
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 09 Jan 1999 23:36:03 PST
From: n2zen@concentric.net (Robb Sands)
Subject: Form Prefill - How To?
Message-Id: <36995874.56318798@news.concentric.net>
I'm trying to write a perl script to log me into my favorite internet
auction site. Where can I find how to info on posting data to a form,
then getting it to submit. This isn't my server, but rather one 1/2
way around the country. TIA, Robb.
------------------------------
Date: 10 Jan 1999 08:06:20 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Form Prefill - How To?
Message-Id: <779n1s$3m7@bgtnsc03.worldnet.att.net>
Robb Sands wrote in message
<36995874.56318798@news.concentric.net>...
>I'm trying to write a perl script to log me into my favorite
internet
>auction site. Where can I find how to info on posting data to
a form,
>then getting it to submit. This isn't my server, but rather
one 1/2
>way around the country. TIA, Robb.
Try the comp.infosystems.www.authoring.cgi newsgroup. The
information end is there.
CT
------------------------------
Date: 10 Jan 1999 08:50:14 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: I don't know ANYTHING
Message-Id: <779pk6$e52@bgtnsc03.worldnet.att.net>
>Being a newbie myself, I suggest that you learn some basic
programming in C
>or Pascal before tackling Perl.
C is a tackle, Perl is like Waltzing... with large German
women.. but it is still Waltzing. C makes me feel like I'm in a
constant fistfight. Perl feels like a discussion.
Learn perl right from the start. I can't tell you how many C
programmers have written Perl scripts that I downloaded which
aren't really 'Perl' optimized, they are just C hacks squeezed
into Perl format. This only set me up from the start for many
bad coding habits.
If learning basic C was a commonly recommended prequisite to
Perl, it probably would not be near as popular as it is. I
myself have found Perl to be a *very approachable language*, and
I came from Visual Basic. That's about as low as you can go on
the totem pole of languages.
Only after Perl did I go to Pascal. The biggest problem with
perl is that too many folks start it from the CGI point of view
(as I did). They wanna build webstores (which was my first
script.. egads what a hellish 3 months)or messageboards and
don't really spend as much time at the prompt as they should.
They get more concerned with permissions and mysterious server
configurations that coding. That's why so many CGI questions pop
up here.
>Third, its highly useful for
>writing CGI programs and for anything Unix; so if you are using
Linux, Unix,
>or doing Web programming, it's THE language.
Agreed... I've got friends who do stuff on MS IIS stuff. They
look at me like I'm from Pluto, but my scripts don't need
this...
&require "reset_button"; :)
>If you want to start learning it, I suggest that you begin with
Jon Orwant's
>"Perl 5 Interactive Course". There is another CD based course
on the
>market, but I haven't seen it.
I have that one... it's a bit too 'cute' for me. They jump in
with both feet & the book is way too large for a beginner. No
one will ever finish that thing without the diligence of a
crusader.
The Camel book is not as scary as it seems, and much more
digestible. I think Chapter 1 "A Stroll Through Perl" does an
excellent job of presenting the basic of the language and many
of the coding techniques and methods someone starting out needs
to learn. I wish I would have started with it instead of Using
Perl5. I would have been much better off.
This (the camel book) is a book I can start at chapter 1 and
eventually close the back cover with insightful knowledge. The
Interactive book probably becomes a bookshelf reference after
about Session 5 or so.
.02
CT
------------------------------
Date: 10 Jan 1999 08:08:16 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: messageboard
Message-Id: <779n5g$49p@bgtnsc03.worldnet.att.net>
>I was wondering if anyone could tell me how to write a simple
song.
>I mean just a normal song with lyrics that refer to things and
ideas.
>Is that a hard thing?
Okay.. if you buy the rubber bands and a cigar box, I'll explain
it.
------------------------------
Date: Sun, 10 Jan 1999 00:43:23 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Newbie Question - Matt's wwwboard
Message-Id: <3698682B.256C5E02@c-zone.net>
Rich Snow wrote:
>
> Hi Folks,
>
> I've downloaded and set up Matt's wwwboard PERL script.
> http://www.worldwidemart.com/scripts/
>
> Trying to get this up and running.
> The problem I am having is that when I enter data in the
> html form and submit; the perl script returns the error message
> "You forgot to fill in the 'Name' field in your posting".
>
> I can muck with the PERL code in wwwboard.pl - so I know
> I'm not just pulling cached pages down. I guess I can't tell
> why the form data isn't making it to the script.
>
> The setup strings appear to be correct -
>
> Any pointers would be gladly accepted!
>
> TIA,
>
> -Rich
>
> Remove # in email to respond directly
Maybe you should fill in a name.. :-) Just kidding, of course. Your best
bet, would be to ask around at Matt's site, or one of his "help forums",
which should be listed on that site. Then go at it with the script and
have fun.. _Then_ get yourself some good ORA Perl books and learn to do
it yourself, because Matt's scripts are mainly meant for people to "get
the job done and going". They leave a lot to be desires in many areas.
However, to solve your immediate problem, again, I suggest you take a
look through that site, through the FAQ's and help boards, because
you're no going to get much help in a NG asking what's what with someone
else's script that you're trying to "get to work". :-)
Good luck...
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1999 TRG Software and The Link Worm.
------------------------------
Date: Sun, 10 Jan 1999 07:34:37 GMT
From: A Melton <melton@diagdata.com>
Subject: Not printing if blank line found
Message-Id: <369855D6.8F3793C2@diagdata.com>
I am reading through a file:
new
January
8
1999
73.60
6.44
5.00
85.04
Call
@
0-520-21446-3 (10)
ANTH
34302
1
1555
1555
DISCIPLINED HEARTS (P)
0-8135-1762-1 (17)
ANTH
34302
2
1865
3730
ANTHROPOLOGY OF SELF & BEHAVIOR
and have written a program that will extract line 10 and line
17 but if lines 17-23 do not exist, I do not want a blank
line printed for line 17.
Program example below:
open IN, $filename or die "Cannot read $filename: $!";
@a = <IN>; # read all lines of this file
chomp ($val=@a[10]);
$val =~ s/-//g;
$final="978".$val;
print unless ($a[10]) eq "";
print OUTPUT ("$final \n");
chomp ($val=@a[17]);
$val =~ s/-//g;
$final1="978".$val;
print unless ($a[17]) eq "";
print OUTPUT ("$final1 \n");
The print unless does not stop the printing
of the blank line probably because it is followed by print OUTPUT
How do I exclude line 17 if it does not exist.
A Melton
------------------------------
Date: 10 Jan 1999 06:56:55 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79gjpn.cjr.dformosa@godzilla.zeta.org.au>
In article <778jci$16h$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <slrn79adli.mcd.dformosa@godzilla.zeta.org.au>,
> dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
[...]
>> I think that you should have done a little bit of study into languge
>> thory. At least enougth to use the correct terms for a number of the
>> features/options.
>>
>
>Language design is more about Pshycology than math. After all,
>computer languages are an INTERFACE between humans and computers.
>It is the HUMAN side that is the tough part.
Dose this non sequitur supposed to mean anything? The thory of
languages and there design is now a quite rich one. If you wish to
learn from others mistakes, (as you claim that you wish to do) a study
into this field of CS would do you a world of good.
Such a study would include the Pshycologial aspects as well as the
mathmatical. In addtion it would equip you with the vocaburary so
that when you express a concept outhers would understand what you are
talking about.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: 10 Jan 1999 07:04:11 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79gk7b.cjr.dformosa@godzilla.zeta.org.au>
In article <778jml$1b7$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <yzhsbtk9y2xj.fsf@netcom15.netcom.com>,
> UG <mcampbel@netcom.com> wrote:
[...]
>> $counter = $index = $how_many_have_I_seen = 0;
>>
>
>How about this for initialization:
>
>Store 0 to counter, index, how_many, etc.
>
>It comes from a real language.
It is very verbose isn't it? This goes against yhour rapid
development rquirement.
>It can even be done with a function.
>
>Init(0, counter, index, how_many, etc.)
>
>(How to process an infinite number of parameters
>makes for some interesting thinking.)
Perl handels a veribal number of parameters, why can't your lang?
>No need to introduce leaky assigments and their related
>headaches to initialize stuff.
Ok, what is so wrong with leaky assigments? You state that they are
bad but don't tell us why they are bad.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: Sun, 10 Jan 1999 02:02:44 -0600
From: Andrew Johnson <ajohnson@gatewest.net>
Subject: Re: Perl Criticism
Message-Id: <36985EA4.5FB013D2@gatewest.net>
Charles R. Thompson wrote:
>
> I don't really have anyhting to say about any of this, I just feel left
> out not being part of the longest thread ever recorded in the history of
> newsgroups.
this can't be the longest already... not even in this newsgroup ... or
did the reese thread just seem so much longer?
andrew
------------------------------
Date: 10 Jan 1999 08:13:23 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Perl Criticism
Message-Id: <779nf3$5ms@bgtnsc03.worldnet.att.net>
>(I'm also working on my OCR.)
You too? Small world. Maybe we should compare notes after class.
That Mr. Tmind... his lectures are so long and hard to follow.
:)
CT
------------------------------
Date: 10 Jan 1999 08:10:22 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79go3d.cjr.dformosa@godzilla.zeta.org.au>
In article <778kbb$1rs$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
[...]
>> I really do find it amusing that, somebody with *no* substantive
>> experience in a language, is so vocal about its complexity. If it is
>> too difficult for you to use, what is so difficult about moving
>> elsewhere?
>>
>> Seriously, please, present your alternative language so that we may be
>> amazed or continue our amusement }:-^
>>
>Is my 85k webpage not enough detail on my suggestions?
No where neer enought detail I wish something that I could read and
use to implement your new langage. Is your langugage Dynamicly or
staticly bound, what is the typing, static, dynamic? Strict or loose?
Is the scope dynamic or static? Will it be functional, logical or
procedule. Will it havve magic white space like python? Where is the
BNF description of the language or an implementation that demonstrates
how the lang works?
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: 10 Jan 1999 01:32:30 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Perl Criticism
Message-Id: <m3lnjb7ckh.fsf@moiraine.dimensional.com>
trollboy <topmind@technologist.com> spewed forth across our group:
> In article <3696A757.E2AE40D4@mediaone.net>,
> "Michael D. Schleif" <mds-resource@mediaone.net> wrote:
> > Seriously, please, present your alternative language so that we may be
> > amazed or continue our amusement }:-^
> >
> Is my 85k webpage not enough detail on my suggestions?
No, it's not.
In matters technical the only thing that matters, the only thing that
has ever mattered, and the only thing that will ever matter is a
working implementation. Since you have such a deep grasp of the finer
points of language design and construction implementing your language
should be none too difficult.
We eagerly await your results.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: Sun, 10 Jan 1999 00:37:14 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Perl Criticism
Message-Id: <369866BA.B9E378EB@c-zone.net>
Andrew Johnson wrote:
>
> Charles R. Thompson wrote:
> >
> > I don't really have anyhting to say about any of this, I just feel left
> > out not being part of the longest thread ever recorded in the history of
> > newsgroups.
>
> this can't be the longest already... not even in this newsgroup ... or
> did the reese thread just seem so much longer?
>
> andrew
Geez, I was joking about the record. :-) I really hope it doesn't get
_that_ long! *cringe*.. maybe this is his entire "mission"? To see how
long this tread will get. After all, why else would he be pushing this
so much? It's infinite it seems. Oh great, now I've just contributed to
this horror story again. :-)
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1999 TRG Software and The Link Worm.
------------------------------
Date: Sun, 10 Jan 1999 09:44:26 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl Criticism
Message-Id: <369870b2.862102@news.skynet.be>
Uri Guttman wrote:
> how do you access globals with isolate?
One of the few things I like about AppleScript, is that ALL variables in
a sub are local, unless you declare them exmplicitely as global.
"global" makes an explicit window through the "isolate".
Bart.
------------------------------
Date: 10 Jan 1999 10:18:35 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Perl Criticism
Message-Id: <779upr$n8e@bgtnsc03.worldnet.att.net>
>Geez, I was joking about the record. :-) I really hope it
doesn't get
>_that_ long! *cringe*.. maybe this is his entire "mission"? To
see how
>long this tread will get. After all, why else would he be
pushing this
>so much? It's infinite it seems. Oh great, now I've just
contributed to
>this horror story again. :-)
Record? What record? It doesn't exist anymore. We left that
behind yesterday when this thread attributed to 75% of the total
Internet traffic for Earth. The thread is now the equivalent of
the virtual Blob, slowly oozing out into our newsreaders with
all the grace of a mudslide.
>After all, why else would he be pushing this
>so much?
Pushing what? To be perfectly honest, I don't even know what the
hell this whole thing is about. One can only assume something of
this grandure has stemmed from either total ignorance or
incompetence.
No more posts on this from me...unless somebody says something
else I can be witty about :)
CT
------------------------------
Date: 09 Jan 1999 23:38:26 PST
From: n2zen@concentric.net (Robb Sands)
Subject: Prefilling a form - how to?
Message-Id: <369857ef.56186239@news.concentric.net>
I'm trying to write a script to automate my logon to a familiar page
(an internet auction site). How do I post data and force a submit,
using perl? TIA, Robb
------------------------------
Date: Sun, 10 Jan 1999 11:45:00 +0200
From: "Yaroslav Buga" <buga@ipm.lviv.ua>
Subject: PROBLEM with Win32::EventLog
Message-Id: <779sp1$63f$1@MU.icmp.lviv.ua>
I have written this script:
use Win32::EventLog;
Win32::EventLog::Open( $EventLog , "System", ' ') || die $!;
$ReadFlags = EVENTLOG_FORWARDS_READ ;
$RecordOffset = 5;
$EventLog->Read($ReadFlags, $RecordOffset, %Event) || die $!;
print ($Event{'Strings'});
but it doesn't work.
When I try to launch it from Command Prompt I have this:
usage: Read(flags, RecordOffSet, hashref)
Can anyone help me?
I will be greatly appreciated for any help.
------------------------------
Date: 10 Jan 1999 10:29:58 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Rambling through hash....
Message-Id: <779vf6$pft@bgtnsc03.worldnet.att.net>
I had some code up last week that someone commented on there
being a problem with the foreach % hash loop. I didn't quite
understand what was wrong about it, and decided to post part of
some code I was helping someone with in authoring.cgi to see if
it comes out again. Is there anything wrong with this line...
foreach $item(keys %checkboxes){
... when I am trying to match incoming data to the hash in a
situation like this?
my %checkboxes = ('box1' => '1', 'box2' => '2','box3' =>
'3','box4' => '4','box5' => '5','box6' => '6','box7' =>
'7','box8' => '8');
my $item = '';
foreach $item(keys %checkboxes){
if (defined
rm_data{$item}){
print qq~$checkboxes{$item} is selected<br>~;
}
else{
print qq~$checkboxes{$item} not selected<br>~;
}
}
Also... I noticed earlier the hash does not run in the order it is built... it goes 7,8,1,2,3,4,5,6. I'd ask, but I know... perldoc. :)
CT
------------------------------
Date: Sun, 10 Jan 1999 09:32:08 GMT
From: ruxfounder@my-dejanews.com
Subject: Threads Solaris memory leak ? signals handling?
Message-Id: <779s2o$27b$1@nnrp1.dejanews.com>
Hi !
I've kicked by sysadmin that my script uses too many
system resources, yeah, server is hard working and
sometimes shows 'table is full' message.
I mean that server has a lot of virtual memory, but
runs too many processes...(kernel bounds apply)
My script was actually a simple http proxy server with fork().
I've switched to cool new feature Threads in perl 5.005_02.
After all, it just works!!!
and uses only one PID, so sysadm now happy, I think.
But I've 2 problems
1. After about 1000-2000 connections my server with threads hangs.
I use ps -ael command and see VERY huge memory allocation for perl
process. I have to restart my script-server once a day. I've written
a small "test" suite:
use strict;
use Thread;
my $i;
for ($i=0; $i<1000000; $i++){
my $t = new Thread \&thread;
sleep 1;
}
sub thread{
sleep(1);
}
while it executed I run ps -ael:
butthead@zeus:~/Scripts>ps -ael | grep 11747
8 S 1002 11747 8484 0 41 20 613c8248 418 ef45989c pts/15 0:00
test.plx
and after some minutes it looks like this:
butthead@zeus:~/Scripts>ps -ael | grep 11747
8 S 1002 11747 8484 0 41 20 613c8248 1529 ef45989c pts/15 0:00
test.plx
and like this:
butthead@zeus:~/Scripts>ps -ael | grep 11747
8 S 1002 11747 8484 0 41 20 613c8248 3240 ef45989c pts/15 0:00
test.plx
Ok , 418 1529 3240 - it is a SZ field:
SZ (l) The total size of the process in virtual
memory, including all mapped files and
devices, in pages. See pagesize(1).
And pagesize is 8192 bytes....
I'm really not a debugger, but could send any info you interested in, if any?
Why this simple script grabs memory?
2. Second problem is a signal support.
When a user click stop button in a browser, connection with my proxy
closed by browser, and when my proxy try send a data to a client
SIGPIPE arrives. But how I can handle this single in a right thread?
Now I use SIG handler within threaded function like this:
sub spawn{
my ($pipe_flg,$tid);
$SIG{PIPE} = $href = sub {
$SIG{PIPE} = 'IGNORE';
logmsg "SIGPIPE recieved in thread [$tid] $href";
$pipe_flg = Thread->self->tid;
return;
};
......
But i've discovered that SIGPIPE catched in the last active thread, that
handles some active connection, but not in thread that handle aborted
connection. Is it correct behavior?
Have anybody same problems & expirience ?
Any idea?
Pls, reply Cc: to my email too.
Thank you for interest
-Dima.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 4611
**************************************