[11938] in Perl-Users-Digest
Perl-Users Digest, Issue: 5538 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 1 22:07:12 1999
Date: Sat, 1 May 99 19:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 1 May 1999 Volume: 8 Number: 5538
Today's topics:
Re: "learning perl" does not seem to be written well birgitt@my-dejanews.com
Buffering, autoflush the answer? <mark@appal.com>
Re: checking the existence of a directory (Tad McClellan)
Dont use pathetic subject lines (was Re: Help) <gellyfish@gellyfish.com>
Re: Help <ebohlman@netcom.com>
Re: My tuppence worth on pod classes <gellyfish@gellyfish.com>
Re: One file for each Record or all records in one File <walton@frontiernet.net>
Re: One file for each Record or all records in one File <ebohlman@netcom.com>
Re: Passing Params <walton@frontiernet.net>
Re: Perl Mongers - Glasgow, Scotland (brian d foy)
Re: Possible to modify gif/jpeg images with Perl?? <gellyfish@gellyfish.com>
Re: Possible to modify gif/jpeg images with Perl?? <eichner@gmx.de>
Re: Possible to modify gif/jpeg images with Perl?? <eichner@gmx.de>
Question : Maybe I missed something about arrays, how d iggepop@my-dejanews.com
Question : Maybe I missed something about arrays, how d <iggepop@my-dejanews.com>
Question : Maybe I missed something about arrays, how d <iggepop@my-dejanews.com>
Re: Question : Maybe I missed something about arrays, h <ebohlman@netcom.com>
Re: Sorting numbers <gellyfish@gellyfish.com>
Thread module + leaking memory <otis@my-dejanews.com>
Re: Throw a person a fish... <gellyfish@gellyfish.com>
Re: Throw a person a fish... <tchrist@mox.perl.com>
Re: unos problemitas (Lee)
Re: unos problemitas <revjack@radix.net>
Re: unos problemitas (Larry Rosler)
Re: unos problemitas <tchrist@mox.perl.com>
Re: unos problemitas (Larry Rosler)
Re: using perl to manage passwords? (Matthew Bafford)
Re: Won't write to file in the middle of CGI script (Tad McClellan)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 01 May 1999 23:03:18 GMT
From: birgitt@my-dejanews.com
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <7gg17l$l7j$1@nnrp1.dejanews.com>
In article <slrn7ik9ao.6fg.dha@panix.com>,
dha@panix.com (David H. Adler) wrote:
> On Thu, 29 Apr 1999 19:47:29 GMT, birgitt@my-dejanews.com
> <birgitt@my-dejanews.com> wrote:
>
> >All nice and good, but the basic problem is that even Larry Wall pointed
> >out that Perl should not be used as the first programming language to learn.
>
> I don't remember ever seeing that. The closest I'm aware of is:
>
> "Perl should only be studied as a second language. A good first
> language would be English."
>
> ....which doesn't address the question of a first *programming*
> language. In fact, to me, it implies quite the opposite of your
> comment. I'd be interested to see your source.
>
article 703nm3o19@kiev.wall.org
1998/10/14
Re: Are there any "perl.newbie" group or forum ?
in clpm
> >Therefore a Perl book which addresses the non-programmer has not been written
> >yet, AFAIK.
>
> This, however is *quite* true.
>
Well, there are really a lot of online tutorials. But if you take the advice
of most serious programmers here in clpm then you spend more than a year or
two to become a programmer and then may a year more to become a novice Perl
programmer. It is still not recognized as a language to be taught at most
universities and I think it is a shame. And if you read Larry Wall's comment
in the above source, you wonder how serious he would take his own advice.
Having at least one of the three attitudes a programmer should have,
impatience, I can tell you that it is pretty frustrating to learn first
PASCAL, BASIC, (COBOL 8-)), C before finally being released into the halls of
Perl.
But having also a tiny bit of the other attitudes, Larry Wall says a
programmer needs, humility, I actually tried to go that awful road (hmm,
skipped the first three languages though...8-)).
Meanwhile I get very impatient with myself. So much for the advices one gets
on this list. 8-)
Birgitt Funk
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 01 May 1999 13:42:12 -0500
From: Mark Bannister <mark@appal.com>
Subject: Buffering, autoflush the answer?
Message-Id: <372B4B04.F837F8A4@appal.com>
I am confused about buffering, etc.
I am running a simple perl script to run through all htm files on my web
site directory (remote unix system) and change one section of the file.
A sub processfiles reads the old file, modifies it and writes it to a
temp file which is later renamed.
Problem is that the status messages I use so I can watch the progess do
not print any more until the entire script has run. Problem 2 is that
browser times out before the script gets finished. Incidently when I
just had the script process a few files everything printed just fine and
during the scripts execution.
I've tried the autoflush command after printing :
use FileHandle;
STDOUT->autoflush(1);
but it did not seem to help. Would system write work?
I'm sure this is covered somewhere in FAQ's but I have had no luck
finding it.
Sample code:
foreach $mydir (@dirlist) {
print "<b>Dir = $mydir</b><br>\n"; #DOES NOT PRINT
UNTIL SCRIPT COMPLTES
$currbase = $mydir;
chdir $mydir or &mydie("CAN'T change dir $mydir reason $_");
opendir (DIR,".") or mydie("can't open directory $mydir reason
$!");
@filelist = readdir(DIR);
closedir(DIR);
#loop through files and process
foreach $file(@filelist) {
#check to see if directory
next if (($file eq ".") || ($file eq "..")); #skip if dir
if (-d $file) {
print "$tab$file --- found dir --";
adddir($file); #add directory to dilist
} else {
print "$tab$file ";
if (okfile($file)==0) {
print "processing<br>\n";
processfiles($file); # sub modifies html files and
writes them back
} else {
print "skipping<br>\n";
}
}
} #for each file
}
------------------------------
Date: Sat, 1 May 1999 15:26:09 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: checking the existence of a directory
Message-Id: <hgkfg7.hn1.ln@magna.metronet.com>
Bart Lateur (bart.lateur@skynet.be) wrote:
: Paul Davies wrote:
: Or, you can check it's existence before trying to create it, using
: -d $directory.
That does not check its existence.
It only checks that it is a directory.
That test can return false when it _does_ exist, as I noted
in my earlier followup.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 1 May 1999 23:28:37 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Dont use pathetic subject lines (was Re: Help)
Message-Id: <7gg2n5$3cv$1@gellyfish.btinternet.com>
On Sat, 01 May 1999 19:11:40 GMT exorcist1@my-dejanews.com wrote:
> Hello, i need help on deciding something. I need to know if it would be
> faster to build a script in perl rather than c++ or c++ rather than perl. I
> am trying to make it so the script checks if an ftp site is currently up or
> has gone down (I'm not building the script though) Please help!
>
Given that you have the ability to use any arbitrary module then of course
Perl will allow you to do this easier than C++ :
use Net::FTP;
if ( $ftp = Net::FTP->new("some.host.name"))
{
# your ftp server is alright
}
else
{
# your ftp server has gone tits up
}
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 1 May 1999 23:27:29 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Help
Message-Id: <ebohlmanFB2uHu.Ct5@netcom.com>
exorcist1@my-dejanews.com wrote:
: Hello, i need help on deciding something. I need to know if it would be
: faster to build a script in perl rather than c++ or c++ rather than perl. I
: am trying to make it so the script checks if an ftp site is currently up or
: has gone down (I'm not building the script though) Please help!
This is absolutely trivial to do in Perl if you use the Net::FTP module.
One of the most important things to consider when selecting a language
for a particular project is the amount of existing re-usable code that
exists in that language. This is why Fortran and COBOL are still in
use. Perl fares especially well in this regard for a large class of
problems.
------------------------------
Date: 1 May 1999 22:58:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: My tuppence worth on pod classes
Message-Id: <7gg0uq$3c0$1@gellyfish.btinternet.com>
On Sat, 01 May 1999 20:47:00 GMT Daniel Pfeiffer wrote:
> Saluton retanoj!
>
> Why do all recent versions of pod2html have to work so badly when
> other pod2...s work just fine? I believe, the wrong approach is being
> used here.
Please feel free to submit patches <blah balh blah>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 01 May 1999 18:42:26 -0400
From: Bob Walton <walton@frontiernet.net>
To: pejman@pejman.com
Subject: Re: One file for each Record or all records in one File?
Message-Id: <372B8351.476847DC@frontiernet.net>
You give insufficient information to make a decision on database
architecture. You have a trivial number of records, so (assuming each
record is of reasonable size), you could just read the whole thing into
memory and put it into a hash, do your updates, and write the whole
thing back out. Or will the program manipulate one or only a few
records each time it runs? If so, a flat file will be inappropriate --
use one of NDBM, SDBM, DBFILE, etc instead. See tie or dbmopen.
A separate file for each record doesn't sound like a good idea to me --
too much overhead on disk due to directory entries and cluster size,
disk will become fragmented, etc.
If your records are fixed-length, you might be able to use seek to
position to the beginning of a record and then read or print the record
right in place. I would be surprised if this technique would work on
all systems.
pejman@pejman.com wrote:
> Hi,
>
> I am writing a database application using flat-file.
> It will have about 5000-10000 records. There are
> 60% read and 40% write access to those records.
>
> What is the best way to design the DB in order to
> have best performance / scalability coverage?
>
> Is it better to put all the records in a single file, or have
> a separate file for each record? Can OS / ISP handle
> 10000 files in a directory? Is any better way to do a
> large-scale DB using flat-file?
>
> I will appreciate any input.
> (please CC to my email-address.)
>
> Thanks in advance,
> Pejman
------------------------------
Date: Sat, 1 May 1999 23:33:53 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: One file for each Record or all records in one File?
Message-Id: <ebohlmanFB2usI.D2t@netcom.com>
pejman@pejman.com wrote:
: I am writing a database application using flat-file.
: It will have about 5000-10000 records. There are
: 60% read and 40% write access to those records.
Your requirements and your proposed solution are at odds with each other.
: What is the best way to design the DB in order to
: have best performance / scalability coverage?
The best way is to "stand on the shoulders of giants" and use a proper
RDBMS like MySQL rather than trying to build the equivalent from
scratch. Concentrate your effort on your application itself rather than
trying to build its infrastructure from the ground up.
------------------------------
Date: Sat, 01 May 1999 18:17:26 -0400
From: Bob Walton <walton@frontiernet.net>
Subject: Re: Passing Params
Message-Id: <372B7D76.6452CF50@frontiernet.net>
Yep. Sorry about the typo.
Tom Christiansen wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, Bob Walton <walton@frontiernet.net> writes:
> :appear in environment variable QUERY_STRING (in %ENV{QUERY_STRING} in perl),
> :for(sort keys %ENV){print "$_=%ENV{$_}\n";}
>
> Um, no. You mean $ENV{QUERY_STRING}. You can't subscript a %Whatever.
> And you probably don't want to play with your query string on your own.
>
> --tom
> --
> I already have too much problem with people thinking the efficiency of
> a perl construct is related to its length. On the other hand, I'm
> perfectly capable of changing my mind next week... :-) --lwall
------------------------------
Date: Sat, 01 May 1999 21:21:26 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Perl Mongers - Glasgow, Scotland
Message-Id: <brian-ya02408000R0105992121260001@news.panix.com>
In article <m390bbr33e.fsf@guidesrv.socsci.gla.ac.uk>, rory@guidesrv.socsci.gla.ac.uk posted:
> I tried emailing the owner of glasgow.pm about a month ago, and got
> no reply. I'm also on the mailing list for glasgow.pm - last time
> I checked I was the only one.
i've just been in touch with Jeremy, who started Glasgow.pm. he
tells me that he has passed on those duties to Colin McPherson
(CMcphe6584@aol.com). a few people have asked me about this, so
there is definately interest.
there is a mailing list for Glasgow.pm as well. send the message:
subscribe glasgow-pm-list
to majordomo@hfb.pm.org.
good luck :)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: 1 May 1999 22:50:54 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Possible to modify gif/jpeg images with Perl??
Message-Id: <7gg0ge$3bt$1@gellyfish.btinternet.com>
On Sat, 1 May 1999 14:17:07 +0100 darkstar wrote:
> i want to modify a gif or a jpg image with perl. I must resize an existing
> image. Is this possible with perl or have you any ideas?
>
I would go with the Image::Magick module available from CPAN.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 2 May 1999 02:32:07 +0100
From: "darkstar" <eichner@gmx.de>
Subject: Re: Possible to modify gif/jpeg images with Perl??
Message-Id: <7gg9uu$8hk$1@black.news.nacamar.net>
Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
7gg0ge$3bt$1@gellyfish.btinternet.com...
>On Sat, 1 May 1999 14:17:07 +0100 darkstar wrote:
>> i want to modify a gif or a jpg image with perl. I must resize an
existing
>> image. Is this possible with perl or have you any ideas?
>>
>
>I would go with the Image::Magick module available from CPAN.
Where can I download this module?
>
>/J\
>--
>Jonathan Stowe <jns@gellyfish.com>
>Some of your questions answered:
><URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
>Hastings:
<URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 2 May 1999 02:32:07 +0100
From: "darkstar" <eichner@gmx.de>
Subject: Re: Possible to modify gif/jpeg images with Perl??
Message-Id: <7gga83$8j3$1@black.news.nacamar.net>
Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
7gg0ge$3bt$1@gellyfish.btinternet.com...
>On Sat, 1 May 1999 14:17:07 +0100 darkstar wrote:
>> i want to modify a gif or a jpg image with perl. I must resize an
existing
>> image. Is this possible with perl or have you any ideas?
>>
>
>I would go with the Image::Magick module available from CPAN.
Where can I download this module?
>
>/J\
>--
>Jonathan Stowe <jns@gellyfish.com>
>Some of your questions answered:
><URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
>Hastings:
<URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 01 May 1999 23:00:16 GMT
From: iggepop@my-dejanews.com
Subject: Question : Maybe I missed something about arrays, how do i clean up my code to get rid of those warningmessages?
Message-Id: <7gg128$l6i$1@nnrp1.dejanews.com>
open(APACHECONF,$_[0]);
for ($b = 0; $b <= $order ; $b++)
{
while (<APACHECONF>)
{
if (($. >= $hoststart[$b]) && ($. <= $hostend[$b]))
{
push(@singlevirtual,$_);
}
elsif ($. > $hostend[$b])
{
last;
}
}
}
close(APACHECONF);
The $hoststart[$b] and $hostend[$b] are arrays from the lists @hoststart
and @hostend that containes the linenumbers for the begining to the end
line of a <VirtualHost *> in httpd.conf. (etc. $hoststart[1] and
$hostend[1] is the beginline and the endline of the second Virtualhost
in the httpd.conf.) my problem are that when i enable the -w option Perl
complains about those being uninitialized. I just recently started out
perl and just got through the "Learning Perl on Win32 systems" (Cause
my teacher bought it, I use perl on linux boxes mainly.), I found out
that sometimes the book left out little more then what's desirable
(yeah, im waiting for the camel, arriving to my mailbox after this
weekend.). Maybe I missed something about arrays, how do i clean up my
code to get rid of those warningmessages?
----- Posted via Deja.com, The People-Powered Information Exchange -----
------ http://www.deja.com/ Discussions * Ratings * Communities ------
------------------------------
Date: Sat, 01 May 1999 23:17:04 GMT
From: Igor Berg Mogielnicki <iggepop@my-dejanews.com>
Subject: Question : Maybe I missed something about arrays, how do i clean up my code to get rid of those warningmessages?
Message-Id: <7gg21t$lo7$1@nnrp1.dejanews.com>
open(APACHECONF,$_[0]);
for ($b = 0; $b <= $order ; $b++)
{
while (<APACHECONF>)
{
if (($. >= $hoststart[$b]) && ($. <= $hostend[$b]))
{
push(@singlevirtual,$_);
}
elsif ($. > $hostend[$b])
{
last;
}
}
}
close(APACHECONF);
The $hoststart[$b] and $hostend[$b] are arrays from the lists @hoststart
and @hostend that containes the linenumbers for the begining to the end
line of a <VirtualHost *> in httpd.conf. (etc. $hoststart[1] and
$hostend[1] is the beginline and the endline of the second Virtualhost
in the httpd.conf.) my problem are that when i enable the -w option Perl
complains about those being uninitialized. I just recently started out
perl and just got through the "Learning Perl on Win32 systems" (Cause
my teacher bought it, I use perl on linux boxes mainly.), I found out
that sometimes the book left out little more then what's desirable
(yeah, im waiting for the camel, arriving to my mailbox after this
weekend.). Maybe I missed something about arrays, how do i clean up my
code to get rid of those warningmessages?
----- Posted via Deja.com, The People-Powered Information Exchange -----
------ http://www.deja.com/ Discussions * Ratings * Communities ------
------------------------------
Date: Sat, 01 May 1999 23:35:19 GMT
From: Igor Berg Mogielnicki <iggepop@my-dejanews.com>
Subject: Question : Maybe I missed something about arrays, how do i clean up my code to get rid of those warningmessages?
Message-Id: <7gg33o$mjc$1@nnrp1.dejanews.com>
open(APACHECONF,$_[0]);
for ($b = 0; $b <= $order ; $b++)
{
while (<APACHECONF>)
{
if (($. >= $hoststart[$b]) && ($. <= $hostend[$b]))
{
push(@singlevirtual,$_);
}
elsif ($. > $hostend[$b])
{
last;
}
}
}
close(APACHECONF);
The $hoststart[$b] and $hostend[$b] are arrays from the lists @hoststart
and @hostend that containes the linenumbers for the begining to the end
line of a <VirtualHost *> in httpd.conf. (etc. $hoststart[1] and
$hostend[1] is the beginline and the endline of the second Virtualhost
in the httpd.conf.) my problem are that when i enable the -w option Perl
complains about those being uninitialized. I just recently started out
perl and just got through the "Learning Perl on Win32 systems" (Cause
my teacher bought it, I use perl on linux boxes mainly.), I found out
that sometimes the book left out little more then what's desirable
(yeah, im waiting for the camel, arriving to my mailbox after this
weekend.). Maybe I missed something about arrays, how do i clean up my
code to get rid of those warningmessages?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 1 May 1999 23:49:46 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Question : Maybe I missed something about arrays, how do i clean up my code to get rid of those warningmessages?
Message-Id: <ebohlmanFB2vIy.Dvx@netcom.com>
iggepop@my-dejanews.com wrote:
: open(APACHECONF,$_[0]);
*Always* check whether or not an attempt to open a file succeeded!
: for ($b = 0; $b <= $order ; $b++)
: {
: while (<APACHECONF>)
Your logic would be clearer if you changed this to:
while ($_ = <APACHECONF> && $. <= $hostend[$b])
: {
: if (($. >= $hoststart[$b]) && ($. <= $hostend[$b]))
: {
: push(@singlevirtual,$_);
: }
and dropped the 'elsif' block.
: elsif ($. > $hostend[$b])
: {
: last;
: }
: }
: }
: close(APACHECONF);
: The $hoststart[$b] and $hostend[$b] are arrays from the lists @hoststart
: and @hostend that containes the linenumbers for the begining to the end
: line of a <VirtualHost *> in httpd.conf. (etc. $hoststart[1] and
: $hostend[1] is the beginline and the endline of the second Virtualhost
: in the httpd.conf.) my problem are that when i enable the -w option Perl
: complains about those being uninitialized. I just recently started out
That suggests that you're letting $b run past the last entries in
@hoststart and @hostend. Where did $order get set? Is it possible that
you have an "off-by-one" problem?
You are aware that for this to work, the entries in @hoststart and
@hostend have to be sorted in ascending order? And that if
$hoststart[n]==$hostend[$n-1]+1, you'll miss the first line in the new
group because when you see a line past the end of the last group, you
fall out of your inner loop, advance the host-group pointer $b, and then
read a new line as you go back into your inner loop, discarding the line
you just saw?
------------------------------
Date: 1 May 1999 23:11:17 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sorting numbers
Message-Id: <7gg1ml$3c6$1@gellyfish.btinternet.com>
On 1 May 1999 11:06:40 -0700 Tom Christiansen wrote:
>
> Don't appease the spammers. Fight them.
>
Ye' man Ye' man - We think that we can nail these [sf]uckers under the
Misuse of Computers act* - unauthorised modification of data - I believe
that includes my /var/log/mail ...
* In the UK at least
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 02 May 1999 00:30:24 GMT
From: Otis Gospodnetic <otis@my-dejanews.com>
Subject: Thread module + leaking memory
Message-Id: <7gg6b0$os1$1@nnrp1.dejanews.com>
Hello,
I'm trying to implement a 'work crew' of threads with the script below. The
problem is that the script and/or Thread module leaks memory which means that
it uses more RAm with each new Thread created. Do I have a bug in my script?
The problem with Threads in perl that I see is that Thread constructor
requires me to specify a subroutine which starts executing immediately. This
means that I have to create a separate Thread object for each thread instead
of creating X number of threads and reusing them (well, not 100% true, but I
wish there is something like Java's .start() for Threads in perl)
Thanks,
Otis
#!/usr/bin/perl
use Thread;
my $tMax = 10;
my @allocated = ();
my $tCount;
my @ids = (1 .. 4000);
&main;
sub main {
while (1) {
for ($tCount = 1; $tCount <= $tMax; $tCount++) {
my $fsn = &getFreeSlot();
if (defined $fsn) {
print "Got Thread $fsn\n";
my $id = &getID();
if (defined $id) {
print "\tGot ID $id\n";
my $t = Thread->new(\&foo, $fsn);
$t->detach();
}
else {
print "\tNo ID\n";
exit;
}
}
else {
print "No avail thread, sleep....\n";
sleep 1;
}
}
}
}
sub getFreeSlot {
for (my $i = 1; $i <= $tMax; $i++) {
next if (defined $allocated[$i]);
$allocated[$i] = 1;
return $i;
}
return undef;
}
sub getID { return (shift @ids); }
sub foo {
my ($tn) = @_;
print "Thread $tn in foo\n";
$allocated[$tn] = undef;
print "Free Thread Slot $tn\n";
}
__END__
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 1 May 1999 23:15:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Throw a person a fish...
Message-Id: <7gg1us$3c9$1@gellyfish.btinternet.com>
On Sat, 1 May 1999 09:55:20 -0700 Larry Rosler wrote:
> Esteemed colleagues,
>
> This just came to me by email. I've left off the signature, because I
> didn't ask for permission to publish it.
>
I'm glad I'm not the only one who gets unsolicited requests for help ...
;-P
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 1 May 1999 17:23:06 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Throw a person a fish...
Message-Id: <372b8cda@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Jonathan Stowe <gellyfish@gellyfish.com> writes:
:I'm glad I'm not the only one who gets unsolicited requests for help ...
You have *NO* *IDEA*. :-(
--tom
--
> (It's sorta like sed, but not. It's sorta like awk, but not. etc.)
Guilty as charged. Perl is happily ugly, and happily derivative.
--Larry Wall in <1992Aug26.184221.29627@netlabs.com>
------------------------------
Date: Sat, 01 May 1999 17:36:25 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: unos problemitas
Message-Id: <B350EC1996682A55F8@204.112.166.88>
In article <372b73b8.952509@news.skynet.be>,
bart.lateur@skynet.be (Bart Lateur) wrote:
>Tom Christiansen wrote:
>
>>Cool -- a new language! "problemo" is not a word in any language I have
>>ever heard of. What language was that?
>
>It sounds a bit like Italian. It could be just slang.
I think it's Californian for "big whoop." I'll ask my son.
Lee
------------------------------
Date: 1 May 1999 22:30:17 GMT
From: Eliot Copeland <revjack@radix.net>
Subject: Re: unos problemitas
Message-Id: <7gfv9p$71i$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Tom Christiansen explains it all:
:Although "problem" ends up being masculine in the Romance tongues,
:that certainly does not mean it has an -o ending. Like "planet",
:"problem" is derived from the Greek, and it has either a -a (e.g. Sp,
:Pt, It) ending despite its masculine grammatical gender, or a -e ending
:in French, where it remains masculine. What is this -o thing, eh?
It means the Problem is owned by effective uid. Duh!
--
/~\ Cahill forfeiture guardian exogamous lepidolite stringent spoon
C oo radical tilde kleenex hotrod abreast brazier Borealis shufflebo
_( ^) 1 , 0 0 0 , 0 0 0 m o n k e y s c a n ' t b e w r o n g
/___~\ http://www.radix.net/~revjack/mnj revjack@radix.net
------------------------------
Date: Sat, 1 May 1999 16:58:10 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: unos problemitas
Message-Id: <MPG.119534f1a7c0efc498998e@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <372b6f90@cs.colorado.edu> on 1 May 1999 15:18:08 -0700, Tom
Christiansen <tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, bart.lateur@skynet.be (Bart Lateur) writes:
> : open (FILE, ">$fn") || print "Problemo: $!";
>
> Cool -- a new language! "problemo" is not a word in any language I have
> ever heard of. What language was that?
>
> Although "problem" ends up being masculine in the Romance tongues,
> that certainly does not mean it has an -o ending. Like "planet",
> "problem" is derived from the Greek, and it has either a -a (e.g. Sp,
> Pt, It) ending despite its masculine grammatical gender, or a -e ending
> in French, where it remains masculine. What is this -o thing, eh?
Time to take you to task for asking a question here (when was the last
time you actually asked a question here -- though this isn't a separate
posting, is it?) off-topic, at that, that could have been answered
quickly by a little web research using your favorite search engine: 4541
pages from 'problemo' via AltaVista.
"No problemo!" is pure Simpson-speak. Of course, 'The Simpsons' may not
air in Boulder, and even so you may have no idea what I'm talking about.
But you might also have found <URL:http://www.noproblemo.com/> NO
PROBLEMO - 1hre Web Radio frangaise !
So though 'problemo' may not be legit in any known language, lots of
people say it, in several languages. Live with it.
Use the tools, O master toolmaker! :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 1 May 1999 18:14:58 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: unos problemitas
Message-Id: <372b9902@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
:"No problemo!" is pure Simpson-speak.
Hence my complaint. It's not real. Now and then I flail
out at words ignorantly mutilated. This is one such case.
--tom
--
"The purpose of most computer languages is to lengthen your resume by
a word and a comma." --Larry Wall
------------------------------
Date: Sat, 1 May 1999 18:03:13 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: unos problemitas
Message-Id: <MPG.1195443047d44adb98998f@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <372b9902@cs.colorado.edu> on 1 May 1999 18:14:58 -0700, Tom
Christiansen <tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
> :"No problemo!" is pure Simpson-speak.
>
> Hence my complaint. It's not real. Now and then I flail
> out at words ignorantly mutilated. This is one such case.
Some thought the same about 'disgression'. (But not I :-)
The Simpson ignorance is part of the joke -- Bart is an undereducated
pre-teener, and his father is worse. Such things are catching.
My current favorite:
You've got mail!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 02 May 1999 00:06:12 GMT
From: dragons@dragons.duesouth.net (Matthew Bafford)
Subject: Re: using perl to manage passwords?
Message-Id: <slrn7in4cl.glp.dragons@dragons.duesouth.net>
On Sat, 01 May 1999 16:23:18 -0500, Dan Baker <dtbaker@bus-prod.com>
lucked upon a computer, and thus typed in the following:
: mmmm, well... running on windoze is a special sort of mitigating factor;
: like being raised in an abusive family. It is not a minor matter to grep
: the perdocs as far as I have been able to determine. If there is a good
: way to do so, I'd love to hear about it! The docs are all there on my
: installation, but I haven't found any really good way to find out where
: to start looking when in unfamiliar ground in the windows environment.
With glob, readline, command line parsing, and a regular expression, it
would be quite easy to make a program to search it for you.
Or, you could run down to PPT (<URL: http://language.perl.com/ppt>).
Failing that, many of the Unix tools are available for Windows.
Or, you could even *gasp* resort to the program that comes with Windows!
The Find program (start menu) will search files.
Or, you could go to somewhere like tucows, I'm sure you'll find quite a
few gooey grepers.
: Dan
--Matthew
------------------------------
Date: Sat, 1 May 1999 15:27:45 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Won't write to file in the middle of CGI script
Message-Id: <hjkfg7.hn1.ln@magna.metronet.com>
Steve Horne (hornes@rpi.edu) wrote:
: I have a cgi
: script where if I run it from the prompt, it runs fine and will output the
: files it should, but if I run it from a webpage as a CGI, it keeps having a
: problem creating a file.
Perl FAQ, part 9:
"My CGI script runs from the command line but not the browser.
(500 Server Error)"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 5538
**************************************