[11534] in Perl-Users-Digest
Perl-Users Digest, Issue: 5134 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 14 21:07:29 1999
Date: Sun, 14 Mar 99 18:00:18 -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, 14 Mar 1999 Volume: 8 Number: 5134
Today's topics:
Re: 1000 thread limit? <wells@cedarnet.org>
@ARGV is not working <paulhadley@earthlink.net>
Re: [Q] Popping an array element (Tad McClellan)
Re: [Q] Popping an array element (Andre L.)
Re: Can Perl do this? Matthew.Wickline@usa.net
CGI.pm -- popup_menu <dewy@NOSPAMhome.com>
Re: CGI.pm -- popup_menu (Bill Moseley)
Check return values on close() (Bill Moseley)
Re: Database thru Perl <JimOrona@ElegantSolutionsInc.com>
Re: Editing array content <u4ia@nospam.videotron.ca.nospam>
Re: HELP!! <jonesy@rmi.nospam.net>
Re: Help- query_string <alex@kawo2.rwth-aachen.de>
Re: HELP: #$ARGV is -1 <msholund@bigfoot.com>
Re: HELP: $#ARGV is -1 <alex@kawo2.rwth-aachen.de>
Re: Here 's a good one !!! (brian d foy)
Re: Here 's a good one !!! <kprice@cardinal.co.nz>
Re: Here 's a good one !!! <wells@cedarnet.org>
make depend error while building Perl5.004_04 <nimesh@smanap.harvard.edu>
Re: Multiple Users Corrupting File (brian d foy)
Re: need cgi application <janko@bellay.com>
newbie question <erpeng@cs.auc.dk>
Re: searching a flat file database (William Herrera)
Segmentation Fault (Bill Moseley)
Setting LD_LIBRARY_PATH inside perl script lathropj@elite.net
Re: Setting LD_LIBRARY_PATH inside perl script <jhi@alpha.hut.fi>
UNIQUE variable... <wells@cedarnet.org>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 15 Mar 1999 00:18:26 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: 1000 thread limit?
Message-Id: <36EC51D2.73B8FEF4@cedarnet.org>
Dan Sugalski wrote:
>
> archon16@my-dejanews.com wrote:
> : In article <7c9qju$l3c$1@news.NERO.NET>,
> : Dan Sugalski <sugalskd@netserve.ous.edu> wrote:
> :> archon16@my-dejanews.com wrote:
> :> : I'm playing with the Thread module... and I was dismayed to discover a
> :> : limit of about 1000 threads allowed at a time (on my machine, at least.)
> :> : After hitting this limit, the program simply dumps core. Does anyone know
> :> : of a way to get around this limitation? (Without recompiling the Linux
> :> : kernel, that is.) I really, really need to have about 30,000 simultaneous
> :> : threads. (Don't ask. I just do. ;-)
> :>
> :> IIRC, Linux creates a new process (more or less) for each thread, so you
> :> need to up the total # of processes allowed on the system. (I think
> :> there's a text file someplace you can twiddle with to do this)
>
> : That is good advice ... however, I don't own the machine I'm using. :-( My
> : home machine's net connection doesn't have the necessary bandwidth for 30,000
> : simultaneous connections (see below).
>
> What're the hardware specs for the machine you're going to be running on?
> 30k threads are going to eat up a fair amount of system resources, and
> Linux isn't all that great when it comes to thread handling. (I'd
> recommend switching to either VMS, Solaris, or OS/2, but that'd be a
> futile recommendation as it sounds like you've got a fixed hardware
> platform)
>
> :> However.... Are you really sure you want to do this? You may find that
> :> Linux gets a bit cranky with that many threads. (Heck, it wouldn't
> :> surprise me if most OSes got cranky with a single process that had 30k+
> :> threads in it) It might be better to consider using a thread pool or
> :> something like that.
>
> : Well, then I'm stumped. I don't see how using a thread pool would help ... I
> : mean, the pool itself would still be constrained by the same 1000 thread
> : limit, right? Well, maybe you can think of a better way to do what I'm
> : doing.
>
> Yep.
>
> : Basically, I'm trying to connect to several million machines and perform a
> : complex dialogue with each machine. Naturally, this means I need to open as
> : many simultaneous connections as possible, and it's critical that none of
> : them block. This may sound daunting, but it actually only takes a couple
> : hours in my current implementation. I'm currently doing this using a state
> : machine approach: each connection has a state, and each time through my
> : program's outer loop I update the state of each connection. However, I keep
> : having to add more states as I develop the program, and the transition rules
> : from one state to the next are growing heinously complex as I refine my
> : understanding of the dialogue carried out over these connections. The
> : frustrating thing is that I can see how very simple the program would be to
> : write if I were only worrying about one connection -- no states or transition
> : tables, no non-blocking sockets (which never seem to work right on some
> : platforms), just one simple, small routine with a couple nested if's! That's
> : when it suddenly occured to me that, if I were to use threads, then I could
> : just write that one simple small routine and hand it off to multiple threads!
> : Much easier code to maintain.
>
> Ah, I see. Clever. Writing a web crawler? :)
>
> Using a thread pool would make scaling easier in some ways--set up a queue
> that holds the connection info (pouring more into it if need be) and then
> create a boatload of threads that each snag a record out of the queue and
> Do The Right Thing with it. (Which may well be the approach you're
> considering)
>
> : But then I ran into the 1000 thread limit (which is much reduced from my
> : current capability of about 30,000 simultaneous connections), and now you
> : tell me that even if I could increase the thread limit, it still might thrash
> : Linux... Well, then, I'm all out of ideas. I guess I'll just have to stay
> : with the increasingly heinous state-machine implementation, unless anyone can
> : think of another way to do it. Hey, if you do, let me know!
>
> Well, more than 1000 simultaneous outbound connections is likely to put
> some strain on things, though it sounds like you're currently managing
> with 30K. (Yow!) Just out of curiosity, how much longer does it take with
> 1000 threads vs your current 30K version? (It's always possible that it
> just doesn't matter, since you're bottlenecking other places)
>
> Unfortunately what you're running into is a Linux limitation, rather than
> a perl one, so there's not much that perl can do to make things better.
> The machine you're running on is limited to ~1000 processes/threads, so to
> get more threads you'll need to up that limit if you can.
>
> Dan
Slightly off topic for this thread ;-) but...
Can you dynamically update the Pool as it runs?
Scenerio:
I have program that I want to take one minute to run.
It consists of 12 threads and each thread takes about
15 seconds to run. So I start up my thread pool with
a max of 4 threads so they will complete within my one
minute time frame.
but...
Let's say that thread number three ends up taking 30
seconds to run...
(I want to add a thread to the pool after 15 seconds)
or...
that threads 5,6 and 7 takes only 5 seconds to run...
(I want to subtract a thread from the pool and open
system resources back up that I don't need now)
Is it possible to dynamically update the pool?
TIA,
STEVE
-----------
Stephen D. Wells
http://www.iren.net/wellss/
------------------------------
Date: Sun, 14 Mar 1999 15:15:57 +0000
From: Paul Hadley <paulhadley@earthlink.net>
Subject: @ARGV is not working
Message-Id: <36EBD2AD.54ACFDA2@earthlink.net>
I want to thank Tad McClellan and Bart Lateur for responding to my
previous message regarding #$ARGV is -1. They both correctly
diagnosed that my email had a serious typo (#$ARGV vs $#ARGV);
however, my email had a typo which as my perl script did not.
I am trying to pass command line arguments into a perl script using
the diamond operator or @ARGV. Neither method is working. I have
included a number of examples. Any help would be greatly appreciated.
(My System: Windows NT SP3; Perl 5.004_02 (binary distribution)
Here are the examples:
Perl Script:
#!/bin/perl -w
#kitty.pl
while( <> )
{
print $_;
}
Command line$ kitty.pl kitty.pl
Output$ (Accepts STDIN until Ctrl-D/Ctrl-Z is pressed)
Perl Script:
#!/bin/perl -w
#kitty2.pl
@ARGV=("kitty.pl");
while( <> )
{
print $_;
}
Command line$ kitty2.pl kitty.pl
Output$ <prints out kitty.pl without problems>
Perl Script:
#!/bin/perl -w
#argvtest1.pl
print "$0\n", join( " ", @ARGV), "\n";
Command line$ argvtest1.pl one two three
Output$ D:\PERLSC~1\ARGUTE~1.PL
<EMPTY LINE>
<EMPTY LINE>
Perl Script:
#!/bin/perl -w
#argvtest2.pl
print "$#ARGV\n";
Command line$ argvtest2.pl one two three
Output$ -1
Thank You very much
Scott Selberg
------------------------------
Date: Sun, 14 Mar 1999 11:17:31 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: [Q] Popping an array element
Message-Id: <rengc7.3j1.ln@magna.metronet.com>
Peter Moore (pmoore@interaccess.com) wrote:
: Chi-Feng Wu wrote in message <7cgqph$2rq$1@news.ee.nthu.edu.tw>...
: > The Book tell us that
: > $tmp = pop ARRAY
: > has the same effect as
: > $tmp = $ARRAY[$#ARRAY--];
: >
: > But why I just get an undefined $tmp while I use the second
: > method? Well, like this:
: >
: > @bugs = qw/Flik Atta Hopper/;
: > print @bugs, $/;
: > $bugger = $bugs[$#bugs--];
: > print $bugger, $/;
: >
: > then $bugger gets undef.
: >
: Well the 1st thing is that an array starts a [0] and goes to [2] here and
: your asking for $#bugs which is $bugs[3]
No it isn't.
$#bugs is 2.
: and then a post decriment which
: wont become 2 until after the expression is evaluated. i suppose you would
: need pre decriment $bugger = $bugs[--$#bugs];
: However, looking at this closer i see someting else which makes me think
: that perl uses double linked lists to track its arrays and you are messing
: with the link header it seems by doing this "$#bugs--" altering it (which
: might be your intention).
: ie $bugs[3] and $bugs[-4] are the same reference to the same memory
: localtion.
$bugs[3] and $bugs[-4] are both undef.
But that is OK since he isn't using $bugs[3] or $bugs[-4]
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 14 Mar 1999 19:04:38 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: [Q] Popping an array element
Message-Id: <alecler-1403991904380001@dialup-598.hip.cam.org>
In article <7cgqph$2rq$1@news.ee.nthu.edu.tw>, Chi-Feng Wu
<cfwu@slugger.ee.nthu.edu.tw> wrote:
> The Book tell us that
> $tmp = pop ARRAY
> has the same effect as
> $tmp = $ARRAY[$#ARRAY--];
Maybe that used to be true at the time that entry in perlfunc was written,
but it seems that it is no longer correct (not with perl 5.004_04 anyway).
It looks like the array is shrunk before the assignation is made,
resulting in $tmp getting an undefined value.
Andre
------------------------------
Date: Sun, 14 Mar 1999 22:54:33 GMT
From: Matthew.Wickline@usa.net
To: soclc@hkusua.hku.hk
Subject: Re: Can Perl do this?
Message-Id: <7chen5$e18$1@nnrp1.dejanews.com>
soclc@hkusua.hku.hk wrote:
> Can a Unix server remotely execute a Windows 95 program (with command
> line parameters) residing over a TCP network with Perl?
yes.
You need something on the winbox to listen for a msg from the unixbox, and
then act. You could implement this by writting your own client/server apps,
or you could do something as simple as having a cgi on the winbox which would
respond to a GET directive by executing that win95 exe... the the unix box
could send that HTTP GET via lynx, perl, whatever...
There are oodles of options.
Keep an eye on security though... you don't want any old usenet hound to start
toying with your servers to see if they can now execute arbitrary win95
apps w/o jumping any significant authentication hurdles ;)
-matt
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 14 Mar 1999 23:31:19 GMT
From: Donovan Wade <dewy@NOSPAMhome.com>
Subject: CGI.pm -- popup_menu
Message-Id: <36EC46C7.3ECD45C9@NOSPAMhome.com>
--------------50F4766D7F3E9A040F57B048
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I am very new to perl and CGI.pm
I can create popup_menu's in a table, edit values w/mouse, and save
entered vales to a file.
That works very cool. I got frustrated with the classes and reverted to
the functional names (model).
My problem is I want to save the table (popup_menu) values to several
different files, (that works)
but when I retrieve earlier saved popup_menu values, I can *not* change
the shown popup_menu
values.
How does one change the popup_menu value displayed??? (in functional
model)
Yes, I've RTFM 14 times, and have no more hair to pull out!!!
TIA,
Donovan Wade
--
Please remove NOSPAM to reply
--------------50F4766D7F3E9A040F57B048
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
I am very new to perl and CGI.pm
<BR>I can create popup_menu's in a table, edit values w/mouse, and save
entered vales to a file.
<BR>That works very cool. I got frustrated with the classes and reverted
to the functional names (model).
<P>My problem is I want to save the table (popup_menu) values to several
different files, (that works)
<BR>but when I retrieve earlier saved popup_menu values, I can *not* change
the shown popup_menu
<BR>values.
<P>How does one change the popup_menu value displayed??? (in functional
model)
<P>Yes, I've RTFM 14 times, and have no more hair to pull out!!!
<P>TIA,
<BR>Donovan Wade
<BR>
<PRE>--
Please remove NOSPAM to reply</PRE>
</HTML>
--------------50F4766D7F3E9A040F57B048--
------------------------------
Date: Sun, 14 Mar 1999 16:01:22 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: CGI.pm -- popup_menu
Message-Id: <MPG.1155edabf30406df9896dd@206.184.139.132>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <36EC46C7.3ECD45C9@NOSPAMhome.com>, dewy@NOSPAMhome.com
says...
> My problem is I want to save the table (popup_menu) values to several
> different files, (that works)
> but when I retrieve earlier saved popup_menu values, I can *not* change
> the shown popup_menu
> values.
>
> How does one change the popup_menu value displayed??? (in functional
> model)
Look at the -override parameter in the CGI.pm docs.
>From the docs:
If you want to change the value of a field from its previous value, you
have two choices:
(1) call the param() method to set it.
(2) use the -override (alias -force) parameter (a new feature in
version 2.15). This forces the default value to be used,
regardless of the previous value:
> Please remove NOSPAM to reply
I'll be the spammers know this one:
s/NOSPAM//;
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Sun, 14 Mar 1999 15:56:11 -0800
From: moseley@best.com (Bill Moseley)
Subject: Check return values on close()
Message-Id: <MPG.1155ec78d476ca549896dc@206.184.139.132>
It's dangerous to post code here that doesn't check the return values on
open and close functions...
Here's a small chunk of my sendmail routine:
sub send_mail {
my $params = "|$sendmail -t -oi -oem";
return "Failed open of sendmail:$sendmail:$!"
unless (open MAIL, $params );
print MAIL $body;
return "Failed close of sendmail:$sendmail:$!" unless (close MAIL);
0;
}
The routine that calls this writes any non-zero return values to a log
file. It works MOST of the time, but I get a few of these in my log
file:
Error during mail send - send_mail returned:
"Failed close of sendmail:/usr/lib/sendmail:"
What does it mean if the close() failed? Sendmail didn't exit properly
or a failed pipe. And it doesn't look like $! is very helpful in this
case, either.
Thanks,
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Sun, 14 Mar 1999 20:24:45 -0500
From: "Jim Orona III" <JimOrona@ElegantSolutionsInc.com>
Subject: Re: Database thru Perl
Message-Id: <36ec60ca$0$26213@mojo.crosslink.net>
Yes, there is an excellent book for this and more for Perl on the Win32
platform:
Win32 Perl Programming: The Standard Extensions
by Dave Roth, Macmillan Technical Publishing
ISBN: 1578700671
Price: $36 plus shipping from www.buybooks.com
I got it for the Win32::ODBC module documentation. I'm using Perl to get to
an Access database, but it can use any defined ODBC data source. And, of
course, CGI.pm for the CGI interaction.
And there's always DBI / DBD for ODBC and other database access. But I
don't think there's a book out for that. There's the docs that come with
it, but sometimes I prefer books. Yeah, I can always print the electronic
version out.....
Good luck.
Jim Orona III
tszeto <tszeto@mindspring.com> wrote in message
news:36E79FE3.DB1BD87E@mindspring.com...
>Is there a good book on how to access and manipulate
>database files (Microsoft Access) using Perl/Cgi ?
>
>Thanks in advance.
>
>Ted
>tszeto@mindspring.com
>
------------------------------
Date: Sun, 14 Mar 1999 19:20:58 -0500
From: "u4ia" <u4ia@nospam.videotron.ca.nospam>
Subject: Re: Editing array content
Message-Id: <JnYG2.726$AI1.23@weber.videotron.net>
Tad McClellan a icrit dans le message ...
>for ($i=0; $i<@ra; $i+=3) {
> $name = $ra[$i];
> $email = $ra[$i+2];
>
> print "$email <$name>\n";
>}
Thanks, It works perfectly. (I modified it to print it in HTML format)
I have a final question and my little program will do what I want ;o)
In my array, the last line is a carriage return (empty line). This empty
line is processed by the for loop, and an empty <A HREF=""></A> appears on
my webpage source.
So how I can remove the last line? The array have a static lenght, the empty
line is the line 34.
I tried $chomp($ra[34]) since the last line is a carriage return but it
didn't work and I can't see any other operators to remove array content.
*sigh* :o) (did I already said that I'm coding Perl for two days only? :P ).
Thanks. :o)
Martin.
------------------------------
Date: 14 Mar 1999 23:29:55 GMT
From: Jonesy <jonesy@rmi.nospam.net>
Subject: Re: HELP!!
Message-Id: <7chgpj$943$1@news1.rmi.net>
dccobb@yahoo.com wrote:
: Subject: HELP!!
You need to understand that anyone that's been reading ng's for
more than 2 or 3 days does *NOT* read a posting whose Subject:
says "Help!!"
So, what you end up with is answers from clueless folks and
more usless email spam.
But, you knew that...
Jonesy
--
292 days to go until the Year 2000 -- So what!
658 days to go until the 3rd Millennium of the C.E.
------------------------------
Date: Mon, 15 Mar 1999 01:35:51 -0500
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: olmert@netvision.net.il
Subject: Re: Help- query_string
Message-Id: <36ECAA47.3D3A4825@kawo2.rwth-aachen.de>
olmert@netvision.net.il wrote:
> I need to pass parameters to a CGI using the GET method. Can any body please
> send me a function that takes the query string and identifies the variables in
> it? I need to make use of these variables during my program, but I do not know
> how to make the program identify them.
Shalom Shaul,
you should better use the CGI.pm module
instead of reinventing the wheel. Type
"perldoc CGI" to get more information.
/Alex
--
http://www.simplex.ru/pref.html
------------------------------
Date: Sun, 14 Mar 1999 20:28:26 -0500
From: Mark Sholund <msholund@bigfoot.com>
Subject: Re: HELP: #$ARGV is -1
Message-Id: <36EC623A.FD131574@bigfoot.com>
Okay, I was wrong, it's almost the length of @ARGV. That's the result of
responding while going out the door. $#ARGV is the index of the last
element in @ARGV so I was one off.
Tad McClellan wrote:
> Mark Sholund (msholund@bigfoot.com) wrote:
> : Perhaps it's just a typing error, but the length of @ARGV is found in
> : $#ARGV not #$ARGV.
>
> No it *isn't*.
>
> It is not.
>
> $#array is not the length of the array.
>
> It just isn't.
>
> Strange that this same wrong thing has been said about 4
> times in the last day or two...
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Mon, 15 Mar 1999 01:29:12 -0500
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: Paul Hadley <paulhadley@earthlink.net>
Subject: Re: HELP: $#ARGV is -1
Message-Id: <36ECA8B8.8DBB9E9@kawo2.rwth-aachen.de>
Paul Hadley wrote:
> Hi, I'm drinving NT and pulling my hair out. I can't get seem to get
> arguments from the command line into my perl scripts; @ARGV
> has a length of -1!
Hi,
I think you mean that @ARGV has length 0,
which means that there are no command line parameters
passed to your perl script. And my guess is that
your are running your perl script some wrong way
under Windows NT (something with perl.bat? I don't
have Windows...)
Regards
Alex
--
http://www.simplex.ru/pref.html
------------------------------
Date: Sun, 14 Mar 1999 17:24:10 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Here 's a good one !!!
Message-Id: <comdog-ya02408000R1403991724100001@news.panix.com>
In article <7chaap$7da$1@ionews.ionet.net>, "Travis" <Travis@wildboysnet.com> posted:
> when using the -w on code I often get a screen full of errors due to the
> fact that I forgot an
> quotation mark somewhere ( on a print statement ) . Anyone know how the
> errors can be saved to a file so
> you can read the first offending error ?
why save it to a file?
perl -cw script_name | more
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 15 Mar 1999 11:46:48 +1300
From: Kelvin Price <kprice@cardinal.co.nz>
Subject: Re: Here 's a good one !!!
Message-Id: <36EC3C58.9FF6BB93@cardinal.co.nz>
Travis wrote:
>
> when using the -w on code I often get a screen full of errors due to the
> fact that I forgot an
> quotation mark somewhere ( on a print statement ) . Anyone know how the
> errors can be saved to a file so
> you can read the first offending error ?
>
perl -w thingy.pl 2>errlog.txt will re-direct stderr to the file
errlog.txt
------------------------------
Date: Mon, 15 Mar 1999 00:02:24 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: Here 's a good one !!!
Message-Id: <36EC4E10.D496053C@cedarnet.org>
Travis wrote:
>
> when using the -w on code I often get a screen full of errors due to the
> fact that I forgot an
> quotation mark somewhere ( on a print statement ) . Anyone know how the
> errors can be saved to a file so
> you can read the first offending error ?
The errors are being sent to STDERR from the bash shell you can
simply "./FILE.pl 2>out"
page 564-565 in the "Perl Cookbook" goes into more detail...
> Question two
> Maybe more difficult
> This little known technique lets you transform you perl program as it is
> being interpretted.
> For instance
> you can use it this to encrypt your code and have Perl decrypt it on the fly
> Bonus question was in Perl Journal winter 98 They failed to mention the
> solution
> anyone have it? (I have a nosy sys administrator )
You got me here... I suspect something like an eval wrapper...
Hop that helps,
STEVE
--
-----------
Stephen D. Wells
http://www.iren.net/wellss/
------------------------------
Date: 14 Mar 1999 17:41:47 -0500
From: Nimesh Patel <nimesh@smanap.harvard.edu>
Subject: make depend error while building Perl5.004_04
Message-Id: <36ec3b2b.0@cfanews.harvard.edu>
------------------------------
Date: Sun, 14 Mar 1999 17:27:11 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Multiple Users Corrupting File
Message-Id: <comdog-ya02408000R1403991727110001@news.panix.com>
In article <7ch67s$r7q@world6.bellatlantic.net>, postmaster@uu.net (ICG) posted:
> Definately. flock. If you can't flock due to your environment, you may have
> to flock yourself. (build your own). When the fill you are trying to protect
> gets opened, build another small file. Before the routine accesses the main
> file, test for the presence of the small file (the lock file), if it exists,
> wait untill it goes away. After the main file access is over, kill the small
> file, that clears the lock.
of course, that won't work. you need something without a race condition.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 15 Mar 1999 00:44:31 +0100
From: Ja NE <janko@bellay.com>
Subject: Re: need cgi application
Message-Id: <36EC49DD.DB91DE85@bellay.com>
Ja NE wrote:
>
> 3th - here is my problem:
/cut/
> M I asking too much?
well, I'w read description of that news group too late... sorry on
posting wrong question to ur group, anyway - this is one off better
perl(cgi?) grpups - so I will ask u: where to ask for help? where to
look for?
tnx...
--
Ja NE
--
go to:
www.bellay.com
tnx ;-)
------------------------------
Date: Sun, 14 Mar 1999 22:49:50 GMT
From: Chen Li <erpeng@cs.auc.dk>
Subject: newbie question
Message-Id: <36EC3CE9.3A2B999E@cs.auc.dk>
I want to generate some data, the data has a certain distribution
according to time, if there is an existent statistic module can do this?
If not how to do that? Thanks a lot.
------------------------------
Date: Mon, 15 Mar 1999 00:42:09 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: searching a flat file database
Message-Id: <36ec559c.521309852@news.rmi.net>
On Sun, 14 Mar 1999 14:15:44 -0500, "Winfield Henry"
<winfieldh@mindspring.com> wrote:
>I have made a great perl/cgi script to search and ascii txt file '|'
>delimited. Works great using a single word/phrase search key. What I need to
>be able to do is break up the search key and search for the words
>individually. Heres an example using cars. the database would look like
>
>year|make|model|color
>
>The input search string would be
>
>'1990 ford explorer'
Ah, the custom database seach. Just wrote one two weeks ago.
You need to read the perlfaq6 FAQ on this under
/perl/html/lib/pod/perlfaq6.html#How_do_I_efficiently_match_many_
The AND is easy if you can keep the order the same, just link the
phrase in a regex that allows stuff between the words in the search.
If you find a really fast way (read: doesn't require any extra loops)
of doing the same when the words in the seach may be in _any_ order,
let me know. I have a way, but it is slow and looks too much like the
way the FAQ says is to be avoided :(.
---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.
------------------------------
Date: Sun, 14 Mar 1999 15:41:19 -0800
From: moseley@best.com (Bill Moseley)
Subject: Segmentation Fault
Message-Id: <MPG.1155e8fabac20a339896db@206.184.139.132>
I have a Perl CGI script that redirects STDERR to a log file.
I have 'Segmentation Fault' entered in my log file on a line by itself.
No other helpful info was provided. It doesn't show up very often.
Anyone know what I'm being told? Is that a perl problem, and anything I
can fix within my script?
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Sun, 14 Mar 1999 22:21:50 GMT
From: lathropj@elite.net
Subject: Setting LD_LIBRARY_PATH inside perl script
Message-Id: <7chcq4$p64$1@berry.elite.net>
How can I set LD_LIBRARY_PATH inside perl script?
------------------------------
Date: 15 Mar 1999 00:32:48 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Setting LD_LIBRARY_PATH inside perl script
Message-Id: <oee90czhfcf.fsf@alpha.hut.fi>
lathropj@elite.net writes:
> How can I set LD_LIBRARY_PATH inside perl script?
$ENV{LD_LIBRARY_PATH} = '/blah/blah';
system("/bin/something-that-needs-LD_LIBRARY_PATH");
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
------------------------------
Date: Sun, 14 Mar 1999 22:36:07 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: UNIQUE variable...
Message-Id: <36EC39D7.D314B9DD@cedarnet.org>
Many times I'm looking for a a situation where I need a unique variable.
Such as I want to send out a cookie that is unique or have a unique
filename for caching etc.
I've been using: my $unique = $$.time
When I need a unique filename I just use:
while (-e "/path/to/file/$unique") { $unique++ }
I wouldn't know where to begin when needing a unique cookie.
So I want to know... Are there problems with this?
When will it not work?
What is a better approach?
TIA,
STEVE
--
-----------
Stephen D. Wells
http://www.iren.net/wellss/
------------------------------
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 5134
**************************************