From grant at mclean.net.nz Mon Jul 5 15:06:34 2010 From: grant at mclean.net.nz (Grant McLean) Date: Tue, 06 Jul 2010 10:06:34 +1200 Subject: [Wellington-pm] Meeting Next Tuesday Message-ID: <1278367594.5264.10.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers The July meeting of Wellington Perl Mongers is *next* Tuesday (i.e.: not tonight). We have three speakers lined up: * Lars Wirzenius - Wellington.pm library in Koha * Dan Horne - Something about his exciting new ETL system * Olly Betts - userv There will be a minor change to the venue - the new home for our meetings will be one floor up on level 4: 6:00pm Tuesday 13 July 2010 Level 4, Catalyst House 150 Willis Street Wellington http://wellington.pm.org/ Cheers Grant From grant at mclean.net.nz Mon Jul 12 14:04:36 2010 From: grant at mclean.net.nz (Grant McLean) Date: Tue, 13 Jul 2010 09:04:36 +1200 Subject: [Wellington-pm] Meeting Tonight Message-ID: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers The July meeting of Wellington Perl Mongers is this evening. We have three speakers lined up: * Lars Wirzenius - Wellington.pm library in Koha * Dan Horne - Something about his exciting new ETL system * Olly Betts - userv There will be a minor change to the venue - the new home for our meetings will be one floor up on level 4: 6:00pm Tuesday 13 July 2010 Level 4, Catalyst House 150 Willis Street Wellington http://wellington.pm.org/ Cheers Grant _______________________________________________ Wellington-pm mailing list Wellington-pm at pm.org http://mail.pm.org/mailman/listinfo/wellington-pm From dan.horne at redbone.co.nz Mon Jul 12 14:42:36 2010 From: dan.horne at redbone.co.nz (Dan Horne) Date: Tue, 13 Jul 2010 09:42:36 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: Is there a number we can call if we get locked out? On 13 July 2010 09:04, Grant McLean wrote: > Hi Mongers > > The July meeting of Wellington Perl Mongers is this evening. We have > three speakers lined up: > > * Lars Wirzenius - Wellington.pm library in Koha > * Dan Horne - Something about his exciting new ETL system > * Olly Betts - userv > > There will be a minor change to the venue - the new home for our > meetings will be one floor up on level 4: > > 6:00pm Tuesday 13 July 2010 > Level 4, Catalyst House > 150 Willis Street > Wellington > http://wellington.pm.org/ > > Cheers > Grant > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.horne at redbone.co.nz Mon Jul 12 14:42:36 2010 From: dan.horne at redbone.co.nz (Dan Horne) Date: Tue, 13 Jul 2010 09:42:36 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: Is there a number we can call if we get locked out? On 13 July 2010 09:04, Grant McLean wrote: > Hi Mongers > > The July meeting of Wellington Perl Mongers is this evening. We have > three speakers lined up: > > * Lars Wirzenius - Wellington.pm library in Koha > * Dan Horne - Something about his exciting new ETL system > * Olly Betts - userv > > There will be a minor change to the venue - the new home for our > meetings will be one floor up on level 4: > > 6:00pm Tuesday 13 July 2010 > Level 4, Catalyst House > 150 Willis Street > Wellington > http://wellington.pm.org/ > > Cheers > Grant > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grant at mclean.net.nz Mon Jul 12 14:55:12 2010 From: grant at mclean.net.nz (Grant McLean) Date: Tue, 13 Jul 2010 09:55:12 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1278971712.18754.3.camel@putnam.wgtn.cat-it.co.nz> On Tue, 2010-07-13 at 09:42 +1200, Dan Horne wrote: > Is there a number we can call if we get locked out? Yes. If you arrive after the front doors lock, there will be a notice taped to the door with my mobile number on it - just send me a text. Cheers Grant From don at gamma.net.nz Tue Jul 13 15:05:37 2010 From: don at gamma.net.nz (Don Jones) Date: Wed, 14 Jul 2010 10:05:37 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: On Tue, Jul 13, 2010 at 9:04 AM, Grant McLean wrote: > Hi Mongers > > The July meeting of Wellington Perl Mongers is this evening. We have > three speakers lined up: > > ?* Lars Wirzenius - Wellington.pm library in Koha > ?* Dan Horne - Something about his exciting new ETL system > ?* Olly Betts - userv Just wanted to thank last nights speakers, I found all three talks quite interesting. All three pieces of software seem like something I might actually use at some point (note that I didn't say, as opposed to the software usually covered :) Thanks Donovan From dan.horne at redbone.co.nz Tue Jul 13 17:13:22 2010 From: dan.horne at redbone.co.nz (Dan Horne) Date: Wed, 14 Jul 2010 12:13:22 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: Well, if you do want to find more about ETLp or take it for a spin, you can find the source and the doco at http://firefly.activestate.com/dhorne/etlp Dan On 14 July 2010 10:05, Don Jones wrote: > > > Just wanted to thank last nights speakers, I found all three talks > quite interesting. All three pieces of software seem like something I > might actually use at some point (note that I didn't say, as opposed > to the software usually covered :) > > Thanks > > Donovan > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grant at mclean.net.nz Tue Jul 13 18:04:27 2010 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 14 Jul 2010 13:04:27 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1279069467.18754.60.camel@putnam.wgtn.cat-it.co.nz> Thanks for that Dan. Did you want to send me your slides too? Also, you were talking about your strategy for watching an incoming directory and checking when a file stabilises (no writes for 'n' seconds). I recently implemented a directory watching daemon using the Linux::Inotify module. The cool thing about that module is it allows fine-grained control over the events you're interested in. So in my case I subscribed to 'IN_CLOSE' and 'IN_MOVED_TO' events which means I only get notified when a file is closed (ie: the client has finished writing) or renamed. You'd need to try it out to see how it interacts with SAMBA but it might be a useful solution. Cheers Grant On Wed, 2010-07-14 at 12:13 +1200, Dan Horne wrote: > Well, if you do want to find more about ETLp or take it for a spin, > you can find the source and the doco at > > http://firefly.activestate.com/dhorne/etlp > > Dan > > On 14 July 2010 10:05, Don Jones wrote: > > > > Just wanted to thank last nights speakers, I found all three > talks > quite interesting. All three pieces of software seem like > something I > might actually use at some point (note that I didn't say, as > opposed > to the software usually covered :) > > Thanks > > Donovan > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm From andrew.boag at catalyst.net.nz Tue Jul 13 18:32:03 2010 From: andrew.boag at catalyst.net.nz (Andrew Boag) Date: Wed, 14 Jul 2010 11:32:03 +1000 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: <1279069467.18754.60.camel@putnam.wgtn.cat-it.co.nz> References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> <1279069467.18754.60.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <4C3D1393.4010308@catalyst.net.nz> Just a note on inotify and samba (we tried a trick recently with this). When we mounted a windows drive via samba and tried to watch for events on the samba mount (generated from exterior systems), the events were not "seen" by inotify. Had to revert to the cron-ish "check every X minutes and notice new stuff" not sure about NFS. Grant McLean wrote: > Thanks for that Dan. Did you want to send me your slides too? > > Also, you were talking about your strategy for watching an incoming > directory and checking when a file stabilises (no writes for 'n' > seconds). I recently implemented a directory watching daemon using the > Linux::Inotify module. The cool thing about that module is it allows > fine-grained control over the events you're interested in. > > So in my case I subscribed to 'IN_CLOSE' and 'IN_MOVED_TO' events which > means I only get notified when a file is closed (ie: the client has > finished writing) or renamed. You'd need to try it out to see how it > interacts with SAMBA but it might be a useful solution. > > Cheers > Grant > > On Wed, 2010-07-14 at 12:13 +1200, Dan Horne wrote: > >> Well, if you do want to find more about ETLp or take it for a spin, >> you can find the source and the doco at >> >> http://firefly.activestate.com/dhorne/etlp >> >> Dan >> >> On 14 July 2010 10:05, Don Jones wrote: >> >> >> >> Just wanted to thank last nights speakers, I found all three >> talks >> quite interesting. All three pieces of software seem like >> something I >> might actually use at some point (note that I didn't say, as >> opposed >> to the software usually covered :) >> >> Thanks >> >> Donovan >> >> _______________________________________________ >> Wellington-pm mailing list >> Wellington-pm at pm.org >> http://mail.pm.org/mailman/listinfo/wellington-pm >> >> >> _______________________________________________ >> Wellington-pm mailing list >> Wellington-pm at pm.org >> http://mail.pm.org/mailman/listinfo/wellington-pm >> > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > -- ======= Andrew Boag Director Catalyst IT Australia Suite 401, 89 York St Sydney 2000 http://www.catalyst-au.net andrew.boag at catalyst-au.net +61 421 528 125 From andychilton at gmail.com Tue Jul 13 18:46:21 2010 From: andychilton at gmail.com (Andrew Chilton) Date: Wed, 14 Jul 2010 13:46:21 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: Hi Dan, 2010/7/14 Dan Horne : > http://firefly.activestate.com/dhorne/etlp Thanks for the link, I was just about to ask for it seeing as I missed the presentation. I have already been told about it by a couple of people and it sounds pretty interesting. Just one note I thought I'd ask about is that in the LICENSE file it's under the GPLv1 or later or the Artistic license. Ignoring the arguments about whether to dual license, wouldn't it be worth upgrading to at least GPLv2 if not GPLv3. Appreciating the fact that we can do that ourselves is already allowed, I would have still thought putting it out under a newer than GPLv1 license would make more sense for you :) Cheers, Andy -- contact: Andrew Chilton website: http://www.chilts.org/blog/ From dan.horne at redbone.co.nz Tue Jul 13 19:05:43 2010 From: dan.horne at redbone.co.nz (Dan Horne) Date: Wed, 14 Jul 2010 14:05:43 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: <1279069467.18754.60.camel@putnam.wgtn.cat-it.co.nz> References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> <1279069467.18754.60.camel@putnam.wgtn.cat-it.co.nz> Message-ID: To be honest, I just pinched the logic from CA Autosys, the scheduling tool that the old warehouse uses. Linux::Inotify looks much more elegant, but we need to work across SAMBA and NFS, and as Andrew points out it may not work for us. On 14 July 2010 13:04, Grant McLean wrote: > > Also, you were talking about your strategy for watching an incoming > directory and checking when a file stabilises (no writes for 'n' > seconds). I recently implemented a directory watching daemon using the > Linux::Inotify module. The cool thing about that module is it allows > fine-grained control over the events you're interested in. > > So in my case I subscribed to 'IN_CLOSE' and 'IN_MOVED_TO' events which > means I only get notified when a file is closed (ie: the client has > finished writing) or renamed. You'd need to try it out to see how it > interacts with SAMBA but it might be a useful solution. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.horne at redbone.co.nz Tue Jul 13 19:12:22 2010 From: dan.horne at redbone.co.nz (Dan Horne) Date: Wed, 14 Jul 2010 14:12:22 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: On 14 July 2010 13:46, Andrew Chilton wrote: > > Just one note I thought I'd ask about is that in the LICENSE file it's > under the GPLv1 or later or the Artistic license. Ignoring the > arguments about whether to dual license, wouldn't it be worth > upgrading to at least GPLv2 if not GPLv3. Appreciating the fact that > we can do that ourselves is already allowed, I would have still > thought putting it out under a newer than GPLv1 license would make > more sense for you :) > > Hi Alex I know it sounds bad, but I don't really know the difference between the various Open Source licenses, and I glaze over when people try to explain them to me, so I'm happy to use whatever people think best. So do I still want the Dual License or just one of the GPL ones? Is 2 or 3 better? Alas, I'll need to change the copyright in each package. I know Dist::Zilla is supposed to be able to help out with automatically adding licenses to files, but I haven't had time to look into it. So if someone needs a topic to present at the next mongers.... -------------- next part -------------- An HTML attachment was scrubbed... URL: From olly at survex.com Tue Jul 13 21:13:58 2010 From: olly at survex.com (Olly Betts) Date: Wed, 14 Jul 2010 05:13:58 +0100 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <20100714041358.GT11552@survex.com> On Wed, Jul 14, 2010 at 02:12:22PM +1200, Dan Horne wrote: > On 14 July 2010 13:46, Andrew Chilton wrote: > > > Just one note I thought I'd ask about is that in the LICENSE file it's > > under the GPLv1 or later or the Artistic license. Ignoring the > > arguments about whether to dual license, wouldn't it be worth > > upgrading to at least GPLv2 if not GPLv3. Appreciating the fact that > > we can do that ourselves is already allowed, I would have still > > thought putting it out under a newer than GPLv1 license would make > > more sense for you :) > > I know it sounds bad, but I don't really know the difference between the > various Open Source licenses, and I glaze over when people try to explain > them to me, so I'm happy to use whatever people think best. So do I still > want the Dual License or just one of the GPL ones? Is 2 or 3 better? "GPLv1+ or Artistic" is the licence which Perl itself is under: http://dev.perl.org/licenses/ It's also pretty popular for stuff written in Perl (I guess partly because it makes it easier for your module to become part of the standard distribution in the future). GPLv1 is pretty old and v2 probably fixes some flaws, but it is what Perl itself has stuck with. > Alas, I'll need to change the copyright in each package. I know Dist::Zilla > is supposed to be able to help out with automatically adding licenses to > files, but I haven't had time to look into it. So if someone needs a topic > to present at the next mongers.... I'd say the most important things when choosing a licence are that it's (a) something well known (tick, since this exact combination is used by Perl and a lot of related modules) and (b) compatible with the GPL (tick, since users can use it under any version of the GPL they like). The latter matters because there's an awful lot of code using it that it would be a shame to prevent potential users of your code from combining it with. Most other factors in licence choice are down to more subjective factors like personal philosophy or strategic aims. I would say if you just want it to be "Open Source" then your current choice is fine. Cheers, Olly P.S. If anyone is itching to find out more about userv, Ian's site for it (with his 1998 paper) is here: http://www.chiark.greenend.org.uk/~ian/userv/ I'll stick my slides up later (I want to correct the factual error about setuid which Sam pointed out first). Thanks for all the interesting comments and discussion. If anyone noticed any goofs but didn't think them worth pointing out at the time, do let me know. From liw at liw.fi Tue Jul 13 21:20:33 2010 From: liw at liw.fi (Lars Wirzenius) Date: Wed, 14 Jul 2010 16:20:33 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1279081233.2913.26.camel@havelock> On ke, 2010-07-14 at 10:05 +1200, Don Jones wrote: > On Tue, Jul 13, 2010 at 9:04 AM, Grant McLean wrote: > > Hi Mongers > > > > The July meeting of Wellington Perl Mongers is this evening. We have > > three speakers lined up: > > > > * Lars Wirzenius - Wellington.pm library in Koha > > * Dan Horne - Something about his exciting new ETL system > > * Olly Betts - userv > > Just wanted to thank last nights speakers, I found all three talks > quite interesting. All three pieces of software seem like something I > might actually use at some point (note that I didn't say, as opposed > to the software usually covered :) Thanks. For my part, just in case the URL was unclear: http://wpm.mykoha.co.nz/ I hope that becomes a useful tool for Wellington.pm. From andychilton at gmail.com Tue Jul 13 21:32:19 2010 From: andychilton at gmail.com (Andrew Chilton) Date: Wed, 14 Jul 2010 16:32:19 +1200 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: <20100714041358.GT11552@survex.com> References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> <20100714041358.GT11552@survex.com> Message-ID: On 14 July 2010 16:13, Olly Betts wrote: > "GPLv1+ or Artistic" is the licence which Perl itself is under: > > http://dev.perl.org/licenses/ I must admit, I think I've been recently convinced to just license my stuff under Artistic v2 only since doing it that way just seems simpler. No dual license but you have permission to re-license under most other open source licenses. For a nice short article on the matter, see: * http://perlbuzz.com/2010/06/artistic-license-20-makes-dual-license-boilerplate-unnecessary.html Cheers, Andy -- contact: Andrew Chilton website: http://www.chilts.org/blog/ From daniel at rimspace.net Wed Jul 14 00:21:43 2010 From: daniel at rimspace.net (Daniel Pittman) Date: Wed, 14 Jul 2010 17:21:43 +1000 Subject: [Wellington-pm] Meeting Tonight In-Reply-To: (Dan Horne's message of "Wed, 14 Jul 2010 14:12:22 +1200") References: <1278968676.18754.0.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <877hkya5q0.fsf@rimspace.net> Dan Horne writes: > On 14 July 2010 13:46, Andrew Chilton? wrote: > >> Just one note I thought I'd ask about is that in the LICENSE file it's under >> the GPLv1 or later or the Artistic license. Ignoring the arguments about >> whether to dual license, wouldn't it be worth upgrading to at least GPLv2 if >> not GPLv3. Appreciating the fact that we can do that ourselves is already >> allowed, I would have still thought putting it out under a newer than GPLv1 >> license would make more sense for you :) > > I know it sounds bad, but I don't really know the difference between the > various Open Source licenses, and I glaze over when people try to explain > them to me, so I'm happy to use whatever people think best. So do I still > want the Dual License or just one of the GPL ones? Is 2 or 3 better? For my opinion on this: Answer one question for yourself: What do I want other people to be able to do with this code? If the answer is "free stuff, but only if they give back their changes" then use the GPL for the code. It requires that, strongly, and prevents people locking up the code in their application without the application also being free. (...or the Artistic/GPL1 combination, which is more or less the same.) If the answer is "cool stuff, and it would be nice to get back changes" then use the two clause BSD license. It allows commercial use without giving anything back, by giving their lawyers a license they well understand, but encourages returning source by being an open license. Finally, if the answer is "I don't even wanna care" then use the WTFPL or something similar, which is as close to "free" in every sense as you can get around the world.[1] > Alas, I'll need to change the copyright in each package. I know Dist::Zilla > is supposed to be able to help out with automatically adding licenses to > files, but I haven't had time to look into it. You will probably find it pleasantly quick and easy to get started with, and I find that it does make it easy to include boilerplate like the license text in a well documented way. Regards, Daniel Footnotes: [1] This may not protect you from legal liability for the failure of your software, while the more restrictive earlier license choices do. -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From richard at walnut.gen.nz Sat Jul 17 21:30:41 2010 From: richard at walnut.gen.nz (Richard Hector) Date: Sun, 18 Jul 2010 16:30:41 +1200 Subject: [Wellington-pm] pass-through pipe? Message-ID: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> Hi all, My question may well be unclear, because I may not understand the problem. I want to pipe the output of one command to the input of another - stuff that's commonly done in the shell. I could for example, use system 'ls | sort'; but that, as I understand it, involves starting a shell. It seems that it is cleaner, more efficient, and perhaps more secure, though, to do such things as piped opens entirely within perl. Is it possible to create an (unnamed) pipe to which I can connect both processes, leaving perl out of the loop until the end? It would probably be useful to be able to collect standard error and exit status from each. Thanks, Richard From lenz at gschwendtner.eu Sat Jul 17 22:06:38 2010 From: lenz at gschwendtner.eu (Lenz Gschwendtner) Date: Sun, 18 Jul 2010 17:06:38 +1200 Subject: [Wellington-pm] pass-through pipe? In-Reply-To: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> References: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> Message-ID: <1140A84A-60A6-4427-82FD-2F1927DA2831@gschwendtner.eu> you mean something other than one process prints to STDOUT and the other one reading from STDIN ... not sure i get your question right but if you need something other than the normal stuff then you might be after a FIFO buffer? shared memory? what is the use case? probably that helps :-) cheers lenz On 18/07/2010, at 4:30 PM, Richard Hector wrote: > Hi all, > > My question may well be unclear, because I may not understand the > problem. > > I want to pipe the output of one command to the input of another - stuff > that's commonly done in the shell. > > I could for example, use > system 'ls | sort'; > > but that, as I understand it, involves starting a shell. > > It seems that it is cleaner, more efficient, and perhaps more secure, > though, to do such things as piped opens entirely within perl. > > Is it possible to create an (unnamed) pipe to which I can connect both > processes, leaving perl out of the loop until the end? It would probably > be useful to be able to collect standard error and exit status from > each. > > Thanks, > Richard > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm From daniel at rimspace.net Sat Jul 17 23:05:14 2010 From: daniel at rimspace.net (Daniel Pittman) Date: Sun, 18 Jul 2010 16:05:14 +1000 Subject: [Wellington-pm] pass-through pipe? In-Reply-To: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> (Richard Hector's message of "Sun, 18 Jul 2010 16:30:41 +1200") References: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> Message-ID: <87tynxe351.fsf@rimspace.net> Richard Hector writes: > My question may well be unclear, because I may not understand the problem. > I want to pipe the output of one command to the input of another - stuff > that's commonly done in the shell. [...] > It seems that it is cleaner, more efficient, and perhaps more secure, > though, to do such things as piped opens entirely within perl. More or less. It is a bit trickier than it sounds, because you risk a deadlock using the naive approach. > Is it possible to create an (unnamed) pipe to which I can connect both > processes, leaving perl out of the loop until the end? Yes. > It would probably be useful to be able to collect standard error and exit > status from each. I suggest you investigate IPC::Run to make your life more pleasant, but it is not the only module implementing this facility, simply one of the many. Regards, Daniel -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From richard at walnut.gen.nz Sat Jul 17 23:13:13 2010 From: richard at walnut.gen.nz (Richard Hector) Date: Sun, 18 Jul 2010 18:13:13 +1200 Subject: [Wellington-pm] pass-through pipe? In-Reply-To: <1140A84A-60A6-4427-82FD-2F1927DA2831@gschwendtner.eu> References: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> <1140A84A-60A6-4427-82FD-2F1927DA2831@gschwendtner.eu> Message-ID: <1279433593.4130.26.camel@topaz.wgtn.cat-it.co.nz> On Sun, 2010-07-18 at 17:06 +1200, Lenz Gschwendtner wrote: > you mean something other than one process prints to STDOUT and the other one reading from STDIN ... > > not sure i get your question right but if you need something other than the normal stuff then you might be after a FIFO buffer? shared memory? what is the use case? probably that helps :-) The use case is encrypting postgresql backups: system "pg_dump --cluster $cluster --dbname $dbname ... | gpg --options ... --encrypt"; Currently I'm doing that in one 'system' line as described, but that fires up a shell, which shouldn't be necessary? I think if I was doing it in C, I'd call pipe(2), which would return 2 file handles (one reader and one writer). I'd then fork once for pg_dump, and substitute the writer filehandle for stdout, then exec pg_dump. I'd then fork again for gpg, and substitute the reader filehandle for stdin, then exec gpg. I haven't tried any of that, though - I'm guessing as to what might happen when a shell executes a pipeline like that. I could go read the bash source, I guess ... Does that make sense? Thanks, Richard From daniel at rimspace.net Sun Jul 18 00:20:27 2010 From: daniel at rimspace.net (Daniel Pittman) Date: Sun, 18 Jul 2010 17:20:27 +1000 Subject: [Wellington-pm] pass-through pipe? In-Reply-To: <1279433593.4130.26.camel@topaz.wgtn.cat-it.co.nz> (Richard Hector's message of "Sun, 18 Jul 2010 18:13:13 +1200") References: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> <1140A84A-60A6-4427-82FD-2F1927DA2831@gschwendtner.eu> <1279433593.4130.26.camel@topaz.wgtn.cat-it.co.nz> Message-ID: <87pqyldzno.fsf@rimspace.net> Richard Hector writes: > On Sun, 2010-07-18 at 17:06 +1200, Lenz Gschwendtner wrote: >> you mean something other than one process prints to STDOUT and the other >> one reading from STDIN ... >> >> not sure i get your question right but if you need something other than the >> normal stuff then you might be after a FIFO buffer? shared memory? what is >> the use case? probably that helps :-) > > The use case is encrypting postgresql backups: > system "pg_dump --cluster $cluster --dbname $dbname ... | gpg > --options ... --encrypt"; > > Currently I'm doing that in one 'system' line as described, but that > fires up a shell, which shouldn't be necessary? > > I think if I was doing it in C, I'd call pipe(2), which would return 2 > file handles (one reader and one writer). Er, just for reference, despite my thinking that IPC::Run is a better solution, you could just write this exactly like you would in C. No, seriously, it would pretty much just work. See the perldoc for pipe, fork, exec, and open to see how to do it. > I'd then fork once for pg_dump, and substitute the writer filehandle for > stdout, then exec pg_dump. I'd then fork again for gpg, and substitute the > reader filehandle for stdin, then exec gpg. > > I haven't tried any of that, though - I'm guessing as to what might > happen when a shell executes a pipeline like that. I could go read the > bash source, I guess ... No, that is it. You got it right ? this is how Unix does this stuff. Daniel -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From grant at mclean.net.nz Sun Jul 18 15:13:23 2010 From: grant at mclean.net.nz (Grant McLean) Date: Mon, 19 Jul 2010 10:13:23 +1200 Subject: [Wellington-pm] pass-through pipe? In-Reply-To: <1279433593.4130.26.camel@topaz.wgtn.cat-it.co.nz> References: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> <1140A84A-60A6-4427-82FD-2F1927DA2831@gschwendtner.eu> <1279433593.4130.26.camel@topaz.wgtn.cat-it.co.nz> Message-ID: <1279491204.5573.6.camel@putnam.wgtn.cat-it.co.nz> On Sun, 2010-07-18 at 18:13 +1200, Richard Hector wrote: > On Sun, 2010-07-18 at 17:06 +1200, Lenz Gschwendtner wrote: > > you mean something other than one process prints to STDOUT and the other one reading from STDIN ... > > > > not sure i get your question right but if you need something other than the normal stuff then you might be after a FIFO buffer? shared memory? what is the use case? probably that helps :-) > > The use case is encrypting postgresql backups: > > system "pg_dump --cluster $cluster --dbname $dbname ... | gpg > --options ... --encrypt"; > > Currently I'm doing that in one 'system' line as described, but that > fires up a shell, which shouldn't be necessary? I guess strictly speaking, the shell is not necessary and yes you could implement it using Perl's builtin pipe, fork, exec and wait. But frankly why bother? It's going to be a lot of work. It's not going to be faster and it's only more secure if you don't trust the variables $cluster and $dbname. As long as you sanitise the values for those variables using a regex of sensible allowable characters then you'll be safe and moving on to the next job. Of course the security of invoking the shell could also be influenced by the contents of the invoking user's .bashrc et al but if you can't trust those you're screwed anyway :-) Cheers Grant From daniel at rimspace.net Sun Jul 18 18:00:54 2010 From: daniel at rimspace.net (Daniel Pittman) Date: Mon, 19 Jul 2010 11:00:54 +1000 Subject: [Wellington-pm] pass-through pipe? In-Reply-To: <1279491204.5573.6.camel@putnam.wgtn.cat-it.co.nz> (Grant McLean's message of "Mon, 19 Jul 2010 10:13:23 +1200") References: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> <1140A84A-60A6-4427-82FD-2F1927DA2831@gschwendtner.eu> <1279433593.4130.26.camel@topaz.wgtn.cat-it.co.nz> <1279491204.5573.6.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <87y6d8cmk9.fsf@rimspace.net> Grant McLean writes: > On Sun, 2010-07-18 at 18:13 +1200, Richard Hector wrote: >> On Sun, 2010-07-18 at 17:06 +1200, Lenz Gschwendtner wrote: >> > you mean something other than one process prints to STDOUT and the other >> > one reading from STDIN ... >> > >> > not sure i get your question right but if you need something other than >> > the normal stuff then you might be after a FIFO buffer? shared memory? >> > what is the use case? probably that helps :-) >> >> The use case is encrypting postgresql backups: >> >> system "pg_dump --cluster $cluster --dbname $dbname ... | gpg >> --options ... --encrypt"; >> >> Currently I'm doing that in one 'system' line as described, but that >> fires up a shell, which shouldn't be necessary? > > I guess strictly speaking, the shell is not necessary and yes you could > implement it using Perl's builtin pipe, fork, exec and wait. But frankly > why bother? ...because you don't want to suddenly discover problems tomorrow, when Debian change /bin/sh from bash to dash, cutting out a whole lot of bash-specific features, and your key client refuses to change it back to suit you? I know, if you get it right the first time that isn't a problem, and in this trivial case that is pretty standard, but it does mean that your script now includes the behaviour of /bin/bash in the spec. (Plus, you lose the ability to test return codes from anything but the last process, which the OP mentioned as desirable-but-not-mandatory.) Anyway, all that said, just use IPC::Run. Someone already did the work of making this as easy as doing it with system and /bin/sh, so you can avoid reinventing that particular wheel. Daniel ...or use one of the other modules that does the same thing. This isn't rocket science, and has been solved on CPAN for ages. -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From grant at mclean.net.nz Mon Jul 19 02:45:09 2010 From: grant at mclean.net.nz (Grant McLean) Date: Mon, 19 Jul 2010 21:45:09 +1200 Subject: [Wellington-pm] Roundup of Last Week's Meeting Message-ID: <1279532709.6410.22.camel@localhost> Hi Mongers First I must apologise for being so slow at saying thank you - that's just rude. So, thank you to our three speakers - Lars, Dan and Olly for three interesting talks. Lars talked about the Wellington Perl Mongers instance of the Koha library management system, which you can access here: http://wpm.mykoha.co.nz/ Much of the functionality for browsing the collection is available without logging in, but if you want a login (for example to add comments/reviews) then just send me an email with your preferred username. Dan talked about ETLp, for which the project page is here: http://firefly.activestate.com/dhorne/etlp Olly talked about 'userv', for which the project page is here: http://www.chiark.greenend.org.uk/~ian/userv/ Dan's slides are up on the Wellington.pm archive page and I'll put Olly's up when he sends them to me (hint hint). http://wellington.pm.org/archive/ Thanks also to the sizeable crowd who turned up in spite of freezing conditions outside (and stayed despite freezing conditions inside). And thanks in particular to Chris who managed to contribute some insights during the Koha talk and even managed to talk Lars through a live config change to add some handy features :-) Next Meeting ============ The next meeting is three weeks away on August 10th. I haven't had any volunteers to speak yet, so *please* let me know if you want to book a slot or suggest a topic. I may be able to talk about my recent experiences building a web app with Plack/PSGI. The Rakudo 'Star' release of Perl 6 will be out at the end of this month, so maybe someone would like to take that for a spin and tell us about their experiences. Cheers Grant From dan.horne at redbone.co.nz Mon Jul 19 15:16:03 2010 From: dan.horne at redbone.co.nz (Dan Horne) Date: Tue, 20 Jul 2010 10:16:03 +1200 Subject: [Wellington-pm] Roundup of Last Week's Meeting In-Reply-To: <1279532709.6410.22.camel@localhost> References: <1279532709.6410.22.camel@localhost> Message-ID: On 19 July 2010 21:45, Grant McLean wrote: > > The next meeting is three weeks away on August 10th. I haven't had any > volunteers to speak yet, so *please* let me know if you want to book a > slot or suggest a topic. > > May I suggest Dist::Zilla as a topic? It's something that I've been keen to learn about, but have been too busy to investigate... -------------- next part -------------- An HTML attachment was scrubbed... URL: From jethro.carr at jethrocarr.com Tue Jul 20 20:13:34 2010 From: jethro.carr at jethrocarr.com (Jethro Carr) Date: Wed, 21 Jul 2010 15:13:34 +1200 Subject: [Wellington-pm] perl -f check failed Message-ID: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> hi Perl Mongers, Long time lurker, probably first time posting here. :-) PROBLEM I'm come across an interesting problem with a perl script running a -f file check. Essentially the script creates a number of text files whilst running and checks if any exist using -f - if they do, it knows to use a different name for the new file. This has been working nicely for hundreds of files a week for almost a year, however the other day we experienced an issue where -f returned false despite a file existing, which lead to some interesting overwrites... Annoyingly I've been unable to reproduce the issue when re-running the script with the same inputs. >:-( I'm putting it down to some obscure bug that we managed to trigger *somewhere* at that particular instance of the script running, but would be grateful for any ideas that might help. IDEAS? I'm wondering if anyone here has ever experienced problems like this, or if there are situations where perl can return false even when a file exists. The files are created whilst the script is running, however I wasn't aware of any situations where perl might still have cached the old environment. Other possibility is that there was an error on the OS level, telling perl that the file didn't exist even if it did - maybe under heavy I/O or some other issue? ENVIRONMENT Running perl 5.8.0 (as shipped with RHEL 3) so it is a little old, probably a few bugs fixes there that Red Hat may not have back-ported... Filesystem is a standard ext3 filesystem. I'm pretty stumped about this one, a $beverage to anyone able to point me towards the solution :-( regards, jethro -- Jethro Carr www.jethrocarr.com/index.php?cms=blog www.amberdms.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From grant at mclean.net.nz Tue Jul 20 20:23:05 2010 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 21 Jul 2010 15:23:05 +1200 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> Message-ID: <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> On Wed, 2010-07-21 at 15:13 +1200, Jethro Carr wrote: > Essentially the script creates a number of text files whilst running and > checks if any exist using -f - if they do, it knows to use a different > name for the new file. That sounds like a classic race condition. If you check whether the file exists before you create it then it's possible that another process might create it between the time your check returns false and when you create the file. See "perldoc perlopentut" for a description of using O_EXCL to have the open fail if the file already exists. Then check for that specific error in $! if the open fails. Cheers Grant From grant at mclean.net.nz Tue Jul 20 20:24:39 2010 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 21 Jul 2010 15:24:39 +1200 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1279682679.3750.14.camel@putnam.wgtn.cat-it.co.nz> On Wed, 2010-07-21 at 15:23 +1200, Grant McLean wrote: > On Wed, 2010-07-21 at 15:13 +1200, Jethro Carr wrote: > > Essentially the script creates a number of text files whilst running and > > checks if any exist using -f - if they do, it knows to use a different > > name for the new file. > > That sounds like a classic race condition. If you check whether the > file exists before you create it then it's possible that another process > might create it between the time your check returns false and when you > create the file. > > See "perldoc perlopentut" for a description of using O_EXCL to have the > open fail if the file already exists. Then check for that specific > error in $! if the open fails. Or use the core File::Temp module which can do all this for you. Cheers Grant From jethro.carr at jethrocarr.com Tue Jul 20 20:33:30 2010 From: jethro.carr at jethrocarr.com (Jethro Carr) Date: Wed, 21 Jul 2010 15:33:30 +1200 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1279683210.2593.502.camel@laptop-jethro.local.amberdms.com> On Wed, 2010-07-21 at 15:23 +1200, Grant McLean wrote: > > Essentially the script creates a number of text files whilst running and > > checks if any exist using -f - if they do, it knows to use a different > > name for the new file. > > That sounds like a classic race condition. If you check whether the > file exists before you create it then it's possible that another process > might create it between the time your check returns false and when you > create the file. thanks Grant, Good thinking, but one I've already checked - no other script was running at that stage. :-( (The script uses a lock file to enforce a single instance which I've confirmed by checking the logs for any evidence of a second process) regards, jethro -- Jethro Carr www.jethrocarr.com/index.php?cms=blog www.amberdms.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From grant at mclean.net.nz Tue Jul 20 21:01:15 2010 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 21 Jul 2010 16:01:15 +1200 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <1279683210.2593.502.camel@laptop-jethro.local.amberdms.com> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> <1279683210.2593.502.camel@laptop-jethro.local.amberdms.com> Message-ID: <1279684875.3750.26.camel@putnam.wgtn.cat-it.co.nz> On Wed, 2010-07-21 at 15:33 +1200, Jethro Carr wrote: > On Wed, 2010-07-21 at 15:23 +1200, Grant McLean wrote: > > > Essentially the script creates a number of text files whilst running and > > > checks if any exist using -f - if they do, it knows to use a different > > > name for the new file. > > > > That sounds like a classic race condition. If you check whether the > > file exists before you create it then it's possible that another process > > might create it between the time your check returns false and when you > > create the file. > > thanks Grant, > > Good thinking, but one I've already checked - no other script was > running at that stage. :-( > > (The script uses a lock file to enforce a single instance which I've > confirmed by checking the logs for any evidence of a second process) Then I'm afraid the next thing I'd suspect is a bug in your code somewhere. I've never run into a situation where -f failed to see a file. I have run into all sorts of weird problems with file status when the file being accessed is shared from a Windows server but since it's just a local filesystem in your case, OS-level problems seem unlikely. Cheers Grant From olly at survex.com Tue Jul 20 21:06:14 2010 From: olly at survex.com (Olly Betts) Date: Wed, 21 Jul 2010 05:06:14 +0100 Subject: [Wellington-pm] Roundup of Last Week's Meeting In-Reply-To: <1279532709.6410.22.camel@localhost> References: <1279532709.6410.22.camel@localhost> Message-ID: <20100721040614.GQ11552@survex.com> On Mon, Jul 19, 2010 at 09:45:09PM +1200, Grant McLean wrote: > Olly talked about 'userv', for which the project page is here: > > http://www.chiark.greenend.org.uk/~ian/userv/ > > Dan's slides are up on the Wellington.pm archive page and I'll put > Olly's up when he sends them to me (hint hint). http://survex.com/~olly/userv/ http://survex.com/~olly/userv.zip Cheers, Olly From samc at catalyst.net.nz Tue Jul 20 21:15:08 2010 From: samc at catalyst.net.nz (Sam Crawley) Date: Wed, 21 Jul 2010 16:15:08 +1200 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <1279684875.3750.26.camel@putnam.wgtn.cat-it.co.nz> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> <1279683210.2593.502.camel@laptop-jethro.local.amberdms.com> <1279684875.3750.26.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1279685708.2073.13.camel@samc-pc> On Wed, 2010-07-21 at 16:01 +1200, Grant McLean wrote: > On Wed, 2010-07-21 at 15:33 +1200, Jethro Carr wrote: > > (The script uses a lock file to enforce a single instance which I've > > confirmed by checking the logs for any evidence of a second process) > > Then I'm afraid the next thing I'd suspect is a bug in your code > somewhere. I've never run into a situation where -f failed to see a > file. > > I have run into all sorts of weird problems with file status when the > file being accessed is shared from a Windows server but since it's just > a local filesystem in your case, OS-level problems seem unlikely. > I'd also suspect bugs in your code before bugs in perl (which do happen, but are very rare, especially in something pretty core like file operators). Are you absolutely sure there are no other processes running something on the filesystem that could somehow affect these files? As you've already done a fair bit of investigation, it's likely to be something quite strange, so don't rule anything out. Sam. From jarich at perltraining.com.au Wed Jul 21 01:07:47 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Wed, 21 Jul 2010 18:07:47 +1000 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> Message-ID: <4C46AAD3.10902@perltraining.com.au> Jethro Carr wrote: > Essentially the script creates a number of text files whilst running and > checks if any exist using -f - if they do, it knows to use a different > name for the new file. > > This has been working nicely for hundreds of files a week for almost a > year, however the other day we experienced an issue where -f returned > false despite a file existing, which lead to some interesting > overwrites... Technically, -f does not test whether a file exists, it tests whether a given file is a "plain file" as opposed to a directory, a device etc. To test for existence you need -e Thus: * An empty file will return true for -e, and true for -f % touch foo % perl -e 'print "exists\n" if -e "foo"; print "plain\n" if -f "foo"'; exists plain * Directories will return true for -e and false for -f % perl -e 'print "exists\n" if -e "/tmp"; print "plain\n" if -f "/tmp"'; exists * Symlinks will return true for -e and true for -f (which surprised me) % ln -s foo bar % perl -e 'print "exists\n" if -e "bar"; print "plain\n" if -f "bar"'; exists plain * Devices will return true for -e and false for -f %perl -e 'print "exists\n" if -e "/dev/tty0"; print "plain\n" if -f "/dev/tty0"'; exists There are probably other situations where -e and -f disagree, and I suspect you struck one, although I can't say for sure. The point I'm making is that your test is wrong. If you want to test that a file both exists and is a plain file, then you need to use both tests: if(-e $file && -f _) All the best, Jacinta From richard at walnut.gen.nz Wed Jul 21 04:58:10 2010 From: richard at walnut.gen.nz (Richard Hector) Date: Wed, 21 Jul 2010 23:58:10 +1200 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <4C46AAD3.10902@perltraining.com.au> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> <4C46AAD3.10902@perltraining.com.au> Message-ID: <1279713490.10331.8.camel@diamond.lan.walnut.gen.nz> On Wed, 2010-07-21 at 18:07 +1000, Jacinta Richardson wrote: > * Symlinks will return true for -e and true for -f (which surprised me) > > % ln -s foo bar > % perl -e 'print "exists\n" if -e "bar"; print "plain\n" if -f "bar"'; > exists > plain Depends on what the target is - a symlink to a device, for example, is not a plain file: $ ln -s /dev/tty0 bar $ perl -e 'print "exists\n" if -e "bar"; print "plain\n" if -f "bar"' exists > If you want to test that a file both exists and is a plain file, > then you need to use both tests: > > if(-e $file && -f _) Hmm - are there any cases where a file _doesn't_ exist, but is a plain file nonetheless? I'd have thought -f alone was fine for that. Richard From richard at walnut.gen.nz Wed Jul 21 05:03:33 2010 From: richard at walnut.gen.nz (Richard Hector) Date: Thu, 22 Jul 2010 00:03:33 +1200 Subject: [Wellington-pm] pass-through pipe? In-Reply-To: <1279491204.5573.6.camel@putnam.wgtn.cat-it.co.nz> References: <1279427441.4130.6.camel@topaz.wgtn.cat-it.co.nz> <1140A84A-60A6-4427-82FD-2F1927DA2831@gschwendtner.eu> <1279433593.4130.26.camel@topaz.wgtn.cat-it.co.nz> <1279491204.5573.6.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1279713813.10331.14.camel@diamond.lan.walnut.gen.nz> Thanks all. On Mon, 2010-07-19 at 10:13 +1200, Grant McLean wrote: > I guess strictly speaking, the shell is not necessary and yes you could > implement it using Perl's builtin pipe, fork, exec and wait. But > frankly why bother? I guess that I assumed that this being Perl, someone would have created a nice solution for this, so I wouldn't have to use all the low level stuff :-) And I usually look for what feels like a 'proper' solution - admittedly often beyond the practical and expedient requirments of the project :-) I've also met similar situations before, and expect to see them again, so was hoping for something to add to my mental toolkit. I should certainly look into IPC::Run - though I'm not putting any more effort into that particular script at the moment; it works :-) Thanks, Richard From jethro.carr at jethrocarr.com Wed Jul 21 15:07:14 2010 From: jethro.carr at jethrocarr.com (Jethro Carr) Date: Thu, 22 Jul 2010 10:07:14 +1200 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <1279685708.2073.13.camel@samc-pc> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> <1279683210.2593.502.camel@laptop-jethro.local.amberdms.com> <1279684875.3750.26.camel@putnam.wgtn.cat-it.co.nz> <1279685708.2073.13.camel@samc-pc> Message-ID: <1279750034.2593.1135.camel@laptop-jethro.local.amberdms.com> On Wed, 2010-07-21 at 16:15 +1200, Sam Crawley wrote: > Are you absolutely sure there are no other processes running something > on the filesystem that could somehow affect these files? As you've > already done a fair bit of investigation, it's likely to be something > quite strange, so don't rule anything out. Thanks Sam, Grant, Jacinta, Richard, You're right - it *was* a race condition... :-/ I had discounted that from being a possibility on the basis of the script having locking to prevent multiple instances as well the logging showing only one script. However I took another look at the server and discovered that there was infact another variation of the script on server with separate logs and lock files but sharing the same file directory enabling the situation to happen. Thanks for the help guys, I'll try to get along to the next meeting to say hi. :-) regards, jethro -- Jethro Carr www.jethrocarr.com/index.php?cms=blog www.amberdms.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From grant at mclean.net.nz Wed Jul 21 15:40:37 2010 From: grant at mclean.net.nz (Grant McLean) Date: Thu, 22 Jul 2010 10:40:37 +1200 Subject: [Wellington-pm] perl -f check failed In-Reply-To: <1279750034.2593.1135.camel@laptop-jethro.local.amberdms.com> References: <1279682014.2593.484.camel@laptop-jethro.local.amberdms.com> <1279682585.3750.13.camel@putnam.wgtn.cat-it.co.nz> <1279683210.2593.502.camel@laptop-jethro.local.amberdms.com> <1279684875.3750.26.camel@putnam.wgtn.cat-it.co.nz> <1279685708.2073.13.camel@samc-pc> <1279750034.2593.1135.camel@laptop-jethro.local.amberdms.com> Message-ID: <1279752037.3750.27.camel@putnam.wgtn.cat-it.co.nz> On Thu, 2010-07-22 at 10:07 +1200, Jethro Carr wrote: > Thanks for the help guys, I'll try to get along to the next meeting to > say hi. :-) So are you doing anything interesting with Perl that you'd like to tell us about? I'm always looking for speakers :-) Cheers Grant From grant at mclean.net.nz Wed Jul 21 16:08:42 2010 From: grant at mclean.net.nz (Grant McLean) Date: Thu, 22 Jul 2010 11:08:42 +1200 Subject: [Wellington-pm] [Fwd: O'Reilly UG News: Ebook Special: Buy 1, Get 1 Free - Buy 2, Get 2 Free...] Message-ID: <1279753722.3750.29.camel@putnam.wgtn.cat-it.co.nz> -------- Forwarded Message -------- > From: Marsee Henon & Jon Johns > Subject: O'Reilly UG News: Ebook Special: Buy 1, Get 1 Free - Buy 2, > Get 2 Free... > Date: Wed, 21 Jul 2010 15:59:58 -0700 > > View this information as HTML in your browser, click here: > http://post.oreilly.com/rd/9z1zemp1v38v96qdvppmjsdlr5icp94p92e9re80iso > > > *** In Celebration of Open Source *** > DRM-Free ebooks. Lifetime access to multiple formats. Free updates. > > Hi. Our Open Source Convention is happening now, and we wanted to pass along this ebook offer to everyone. > > Download in 4 DRM-free formats: > PDF, .epub, Kindle-compatible .mobi, and Android .apk. Learn more: > http://post.oreilly.com/rd/9z1zt83i683jc9vjltmf2qambnebarhoe2n92bcjc4o > > Buy 1 Ebook, Get 1 Free > Buy 2 Ebooks, Get 2 Free > Buy 3 Ebooks, Get 3 Free... > > Enter code "BXGXF" in the O'Reilly cart. > Offer good through 7/30/2010 > > Buy Now and Save: http://post.oreilly.com/rd/9z1zfa6qqhdo9q0jkep947t5ppem3rtf0n0j9sfbrcg > > -------------------------------------------------------------- > > O'Reilly - Spreading the knowledge of innovators | oreilly.com > > -------------------------------------------------------------- From jarich at perltraining.com.au Mon Jul 26 22:59:41 2010 From: jarich at perltraining.com.au (jarich at perltraining.com.au) Date: Tue, 27 Jul 2010 15:59:41 +1000 (EST) Subject: [Wellington-pm] OSDC 2010 Call for Presentations! Message-ID: <20100727055943.51DF1A9EA4@teddybear.perltraining.com.au> In 2010, the Open Source Developers' Conference (OSDC) is back in Melbourne! Running Wednesday 24th - Friday 26th November 2010, OSDC is a great way to meet your peers, share your knowledge, and improve your skills. Be part of our 7th year of this fantastic conference, run by open source developers for open source developers. Submit a proposal on open source languages, technologies, tools and projects. http://2010.osdc.com.au/call-for-proposals Key dates: Call for Proposals Closes 23 August 2010 Proposal Acceptance 6 September 2010 OSDC 2010 Conference 24th to 26th November 2010 Please feel free to pass this on to any other people or groups you think might be interested in submitting a paper! Hope to see you there! OSDC 2010 committee