From broadway at city-net.com Wed Apr 7 11:29:06 2004 From: broadway at city-net.com (Peter Williams) Date: Mon Aug 2 21:34:59 2004 Subject: [pgh-pm] Question on fork Message-ID: <4073F412.5440.B0E1E44@localhost> Greetings... I have just joined this list, and wanted first to introduce myself. My name is Peter, and I do freelance web design and perl programming. I've been part of the WPLUG group for a while, and am not really sure why I haven't joined this one sooner. I consider myself comfortable with Perl, but there is of course plenty that I don't know. I hate to dive straight in with a question, but this has been bugging me, and I'd love any help in putting it to rest. As the subject states, it's about forking processes. I haven't had a lot of experience using fork, and just last year had a situation where I needed to use it in a script. I checked around for howtos and code samples, and got the script running, no problem. It's been running in live use since then, still with no problems. However... when I set it up, the howtos mentioned that it would only work if I used an http method of GET. The script in question runs off of a sizeable form. I would prefer to have this run with a method of POST. I've tested it with this method, and things do still appear to work. I'd like to be sure though, that it won't create issues with fork. I've done plenty of Googling on it, and can't find other discussions on this topic. I can't even find the site I looked at previously, which said the script should use GET. I do remember that instruction distinctly, but don't know the reasoning behind it, or if it is in fact necessary. So... does anyone know if a script that forks needs to be called with GET? And why is this the case? Any assistance is appreciated. All the best, Peter From casey at geeknest.com Wed Apr 7 11:38:38 2004 From: casey at geeknest.com (casey@geeknest.com) Date: Mon Aug 2 21:34:59 2004 Subject: [pgh-pm] Pittsburgh Perl Mongers | Meeting | 04.14.2004 Message-ID: <20040407163838.CE0CEFDA2@caseywest.com> *Technical Gathering* One excellent talk, then food and beer! *Location* Agnew Moyer Smith, Inc. 3700 South Water Street Suite 300 http://amsite.com 04.14.2004 19:00 Directions: Directions and other: http://amsite.com/exchange/exchange.html *Talk* *AnyData - A case study* Daniel J. Wright Projects always start out small and then end up growing bigger. Sooner or later you will find yourself trying to migrate your data store from one file format to another. AnyData is a wonderful tool that will help you manage your data store regardless of what format it is in and allow you to change your storage format without changing much code. This talk will cover the basics of the AnyData module and show some useful applications that can be applied very quickly. The talk will also touch on some of the more powerful techniques that can be achieved with the AnyData module and show how they are being used in real enterprise-class projects right now. -- Casey West (via automation) From tom at moertel.com Wed Apr 7 16:53:15 2004 From: tom at moertel.com (Tom Moertel) Date: Mon Aug 2 21:34:59 2004 Subject: [pgh-pm] Question on fork In-Reply-To: <4073F412.5440.B0E1E44@localhost> References: <4073F412.5440.B0E1E44@localhost> Message-ID: <4074784B.7020304@moertel.com> Peter Williams wrote: > Greetings... > I have just joined this list, and wanted first to introduce myself. Hi, Peter! Welcome to PghPm. > I hate to dive straight in with a question [...] That's what the list is for, so feel free to dive in. > So... does anyone know if a script that forks needs to be called > with GET? And why is this the case? Short answer: You can use the POST method to submit forms to CGI programs that fork, but you must be careful to avoid buffering and timing issues. Long answer: There is no restriction against using the POST method if your CGI program forks (and I'm assuming we're talking CGIs here). However, fork splits a process into two more-or-less identical processes (the parent and the child). In general, that means each copy will share file descriptors (handles to open files, pipes, and so on) and have duplicate copies of buffers, such as those that Perl creates to handle I/O more efficiently. Now, here's where the GET vs. POST stuff comes in. When you submit a form via GET, the form's values are communicated to the CGI program via the environment variable QUERY_STRING. This doesn't cause any difficulties when forking because both parent and child have a complete copy of the QUERY_STRING. But the POST method is different. When you submit a form via POST, the form's values are communicated to the CGI program via the program's standard input file descriptor. Your web server pipes the form's data into this descriptor and your CGI program reads it out. Thus, when you fork, both parent and child will *share* this descriptor. If one reads a line from it, that line will be forever gone; the other will not be able to read it later. Similarly, if the parent process reads from the descriptor before forking, some of the data that the parent read may be buffered, and the child will inherit a copy of this buffer. So some data might be double-buffered and get read twice -- once in the parent and once in the child. When mixing the POST method with forking, therefore, you must be careful to know who is going to read what, and when. One simple policy that eliminates most of the concern is this: The parent always reads the full input into variables *before* forking. Because Perl's CGI module reads and parses the complete input when you create a new CGI object, you can enforce this policy simply by creating your CGI object before forking. There is a similar concern with output -- knowing who will write what, and when -- but switching from GET to POST won't change that. Cheers, Tom From schwern at pobox.com Thu Apr 8 18:20:21 2004 From: schwern at pobox.com (schwern@pobox.com) Date: Mon Aug 2 21:34:59 2004 Subject: [pgh-pm] WTB Monitor Message-ID: <20040408192020.A28981@magnonel.guild.net> Hi, folks. I just got back into town last week and boy are my arms tired. I'm here for a six month contract working downtown at Grant Street Group on Forbes and Grant. I moved my desktop computer with me, but not the big, heavy, expensive to ship 19" CRT monitor. So I'm looking to buy a monitor out here. Either a cheap 19" CRT that I can use while I'm here and then resell later, or a good price on an LCD monitor that I can bring back with me. Any leads? PS If this is off topic for the list, slappings a plenty. -- Michael G Schwern http://www.pobox.com/~schwern/ Perl Quality Assurance Kwalitee Is Job One From broadway at city-net.com Fri Apr 9 11:45:06 2004 From: broadway at city-net.com (Peter Williams) Date: Mon Aug 2 21:34:59 2004 Subject: [pgh-pm] Question on fork In-Reply-To: <4074351F.2070308@hybridized.org> References: <4073F412.5440.B0E1E44@localhost> Message-ID: <40769AD2.19438.60193A0@localhost> Thanks for the welcome, and the responses to my question. It looks like I'll be able to switch the script to POST, after some more testing. I was hoping that would end up being the case. :) All the best, Peter From casey at geeknest.com Tue Apr 13 14:22:57 2004 From: casey at geeknest.com (Casey West) Date: Mon Aug 2 21:34:59 2004 Subject: [pgh-pm] Pittsburgh Perl Mongers | Meeting | 04.14.2004 In-Reply-To: <20040407163838.CE0CEFDA2@caseywest.com> References: <20040407163838.CE0CEFDA2@caseywest.com> Message-ID: <20040413192257.GD77986@geeknest.com> Evil top posted reminder! Hey, I got it out earlier than The Day Before! :-) It was Wednesday, April 07, 2004 when casey@geeknest.com took the soap box, saying: : : *Technical Gathering* : : One excellent talk, then food and beer! : : *Location* : : Agnew Moyer Smith, Inc. : 3700 South Water Street : Suite 300 : http://amsite.com : 04.14.2004 : 19:00 : : Directions: Directions and other: http://amsite.com/exchange/exchange.html : : *Talk* : : *AnyData - A case study* : Daniel J. Wright : : Projects always start out small and then end up growing bigger. Sooner : or later you will find yourself trying to migrate your data store from : one file format to another. AnyData is a wonderful tool that will help : you manage your data store regardless of what format it is in and allow : you to change your storage format without changing much code. This talk : will cover the basics of the AnyData module and show some useful : applications that can be applied very quickly. The talk will also touch : on some of the more powerful techniques that can be achieved with the : AnyData module and show how they are being used in real enterprise-class : projects right now. : : : -- : Casey West : (via automation) : _______________________________________________ : pgh-pm mailing list : pgh-pm@mail.pm.org : http://mail.pm.org/mailman/listinfo/pgh-pm Casey West -- "Information Superhighway is really an acronym for 'Interactive Network For Organizing, Retrieving, Manipulating, Accessing And Transferring Information On National Systems, Unleashing Practically Every Rebellious Human Intelligence, Gratifying Hackers, Wiseacres, And Yahoos'." --Keven Kwaku From casey at geeknest.com Wed Apr 14 11:48:26 2004 From: casey at geeknest.com (Casey West) Date: Mon Aug 2 21:34:59 2004 Subject: [pgh-pm] [EMERGENCY] No Shelter Tonight Message-ID: <20040414164826.GJ77986@geeknest.com> Something came up and AMS is unable to host our meeting! Dan's talk tonight is about a half hour, and we'd need 45 minutes. Anybody have a space in reach of downtown/oakland? If not, we'll meet in the AMS parking lot and drive over to the bar for beer. The talk will have to wait. Please chime in with any ideas. Casey West -- Shooting yourself in the foot with 68000 You can't decide which gun and which bullet to use, so you hang yourself. From casey at geeknest.com Wed Apr 14 12:12:50 2004 From: casey at geeknest.com (Casey West) Date: Mon Aug 2 21:34:59 2004 Subject: [NEAR SOLUTION] Re: [pgh-pm] No Shelter Tonight In-Reply-To: <20040414164826.GJ77986@geeknest.com> References: <20040414164826.GJ77986@geeknest.com> Message-ID: <20040414171250.GK77986@geeknest.com> It was Wednesday, April 14, 2004 when Casey West took the soap box, saying: : Something came up and AMS is unable to host our meeting! : : Dan's talk tonight is about a half hour, and we'd need 45 : minutes. Anybody have a space in reach of downtown/oakland? Dan tells me that he'd be just fine with waiting. I'll update the website and send out a new announcement. We'll be having a social gathering. Important question that needs some input: Kiva Han in Oakland or Shootz on the South Side? We last went to Kiva Han over a year ago. http://pgh.pm.org/m/200303.html I vote for Kiva Han. Casey West -- Shooting yourself in the foot with Mach The bullets work pretty well, but they don't make guns for it any more. From robertblackwell at yahoo.com Wed Apr 14 13:54:58 2004 From: robertblackwell at yahoo.com (robertblackwell) Date: Mon Aug 2 21:34:59 2004 Subject: [NEAR SOLUTION] Re: [pgh-pm] No Shelter Tonight In-Reply-To: <20040414171250.GK77986@geeknest.com> References: <20040414164826.GJ77986@geeknest.com> <20040414171250.GK77986@geeknest.com> Message-ID: <407D8902.4000301@yahoo.com> Casey West wrote: >It was Wednesday, April 14, 2004 when Casey West took the soap box, saying: >: Something came up and AMS is unable to host our meeting! >: >: Dan's talk tonight is about a half hour, and we'd need 45 >: minutes. Anybody have a space in reach of downtown/oakland? > >Dan tells me that he'd be just fine with waiting. I'll update the >website and send out a new announcement. We'll be having a social >gathering. > >Important question that needs some input: Kiva Han in Oakland or >Shootz on the South Side? > >We last went to Kiva Han over a year ago. > > http://pgh.pm.org/m/200303.html > >I vote for Kiva Han. > > Casey West > > > Kiva Han works great for me. Robert Blackwell From casey at geeknest.com Wed Apr 14 14:00:28 2004 From: casey at geeknest.com (Casey West) Date: Mon Aug 2 21:34:59 2004 Subject: [NEAR SOLUTION] Re: [pgh-pm] No Shelter Tonight In-Reply-To: <20040414171250.GK77986@geeknest.com> References: <20040414164826.GJ77986@geeknest.com> <20040414171250.GK77986@geeknest.com> Message-ID: <20040414190028.GM77986@geeknest.com> It was Wednesday, April 14, 2004 when Casey West took the soap box, saying: : Important question that needs some input: Kiva Han in Oakland or : Shootz on the South Side? : : We last went to Kiva Han over a year ago. : : http://pgh.pm.org/m/200303.html : : I vote for Kiva Han. I'm not going to the coffee shop to sit alone with my laptop. Is anybody out there? :-) Casey West -- Shooting yourself in the foot with CP/M I remember when shooting yourself in the foot with a BB gun was a big deal. From robertblackwell at yahoo.com Wed Apr 14 14:14:55 2004 From: robertblackwell at yahoo.com (robertblackwell) Date: Mon Aug 2 21:34:59 2004 Subject: [NEAR SOLUTION] Re: [pgh-pm] No Shelter Tonight In-Reply-To: <20040414190028.GM77986@geeknest.com> References: <20040414164826.GJ77986@geeknest.com> <20040414171250.GK77986@geeknest.com> <20040414190028.GM77986@geeknest.com> Message-ID: <407D8DAF.8040605@yahoo.com> Casey West wrote: >It was Wednesday, April 14, 2004 when Casey West took the soap box, saying: >: Important question that needs some input: Kiva Han in Oakland or >: Shootz on the South Side? >: >: We last went to Kiva Han over a year ago. >: >: http://pgh.pm.org/m/200303.html >: >: I vote for Kiva Han. > >I'm not going to the coffee shop to sit alone with my laptop. Is >anybody out there? :-) > > Casey West > > > I will be there. We can sit alone with your laptop :) From casey at geeknest.com Wed Apr 14 14:28:39 2004 From: casey at geeknest.com (Casey West) Date: Mon Aug 2 21:34:59 2004 Subject: [pgh-pm] I'm out for tonight Message-ID: <20040414192839.GN77986@geeknest.com> Since I can't take a hint of when to cancel, I got one just a minute ago. My tax man needs me tonight, so I'm not going to be able to make it to any meeting. I'm going to update the website with a meeting canceled notice. Sorry folks, maybe in May. Casey West -- Shooting yourself in the foot with DBase IV, V1.0 You pull the trigger, but it turns out that the gun was a poorly designed hand grenade and the whole building blows up.