From cba at groundworkopensource.com Mon Jun 4 16:34:47 2007 From: cba at groundworkopensource.com (Chris Barton Anderson) Date: Mon, 04 Jun 2007 16:34:47 -0700 Subject: [sf-perl] BayLISA Monitoring SIG: Weds June 13, 7PM Message-ID: <1181000087.32028.5.camel@peterX20> (Hi: You're invited to the BayLISA Monitoring SIG, Weds June 13, 7PM. See the meeting announcement pasted below: feel free to post it and/ or forward it along to anyone else who might be interested. Hope to see you there!) ================================================= June 2007 BayLISA Monitoring SIG: Nagios Configuration Made Easy Taylor Dondich, project lead for the popular Nagios administration tool Fruity (http://fruity.sourceforge.net/) will present on using and taming Nagios. (Taylor's also the author of the O'Reilly .pdf "Network Monitoring with Nagios.": (http://www.oreilly.com/catalog/ networknagios/)) We'll use Taylor's presentation as a launching point for a free-flowing discussion on successful deployment of Nagios. What: BayLISA Monitoring SIG VIII: Nagios Configuration Made Easy Who: Anyone interested in IT monitoring issues and tools (newbies particularly welcome!) When: Wednesday, June 13 2007, 7PM Where: GroundWork Open Source, 139 Townsend St., San Francisco, http://www.groundworkopensource.com/community/ How: 139 Townsend St. is very near AT&T Park. It is two blocks from the CalTrain Depot. Take the MUNI T (or J) trolley to 2nd and King (ballpark stop) or take the 30 or 45 bus (among others) crosstown. Free evening street parking can probably be found because the Giants are playing an afternoon game that day (vs. Toronto, 12:35 start) and it should be over by the time the SIG starts. Cost: Free!! Hot from the oven pizza, cold from the fridge drinks, and artificially preserved from the factory snacks will be provided by GroundWork. We'll open up the doors at 6:30 or so and start the formal part of the meeting promptly at 7PM. RSVP (not necessary, but helpful): Peter Mui, pmui at groundworkopensource.com, 415 992 4573 ================================================= From quinn at fairpath.com Thu Jun 7 23:04:43 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 7 Jun 2007 23:04:43 -0700 Subject: [sf-perl] June 26 - 7:00 p.m. (NOT 8:00) - Fred Moyer on the Big Ball of Mud Message-ID: <20070608060443.GA11259@fu.funkspiel.org> *********************** N O T E *********************** This meeting starts at 7:00 p.m., NOT 8:00. *********************** N O T E *********************** Ahem. That said, I'm pleased to announce our next talk: June 26, 2007: Fred Moyer on the Big Ball of Mud Fred Moyer (http://www.redhotpenguin.com/) will discuss techniques for handling the Big Ball of Mud: that haphazardly grown, ill-documented, fragile, and messy codebase that we've all had to deal with. His talk focuses on how to test and clean up BBOMs, paying off technical debt so you can add features again without fear of the code breaking. I had a chance to see this talk last month, and I was very impressed. Fred does a great job of explaining not just the technical, uh, techniques for handling BBOMs, but also the trickier social engineering you have to do in order to make it happen. This is a shortish talk, so Fred will also cover the highlights of the Nordic Perl Workshop, where he recently spoke. BGI will sponsor Thai food from BKK. Thanks, guys! RSVP to Jeff.Thalhammer at barclaysglobal.com Location details at http://sf.pm.org/weblog/archives/00000045.html -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From extasia at extasia.org Thu Jun 7 11:09:30 2007 From: extasia at extasia.org (David Alban) Date: Thu, 7 Jun 2007 11:09:30 -0700 Subject: [sf-perl] This is what google street view wants to be when it grows up Message-ID: <4c714a9c0706071109o1d5e925aj8ec22ff018e1bbcc@mail.gmail.com> http://www.clipaday.com/videos/ridiculous-image-technology-coming (worksafe) -- Live in a world of your own, but always welcome visitors. From duane.obrien at gmail.com Fri Jun 8 07:57:41 2007 From: duane.obrien at gmail.com (Duane Obrien) Date: Fri, 8 Jun 2007 07:57:41 -0700 Subject: [sf-perl] This is what google street view wants to be when it grows up In-Reply-To: <4c714a9c0706071109o1d5e925aj8ec22ff018e1bbcc@mail.gmail.com> References: <4c714a9c0706071109o1d5e925aj8ec22ff018e1bbcc@mail.gmail.com> Message-ID: On 6/7/07, David Alban wrote: > http://www.clipaday.com/videos/ridiculous-image-technology-coming When I first saw this email, I couldn't figure out why it was list-worthy. So I watched it. Jesus H Christ in a chickenbasket that's awesome. -- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Don't ever tell anybody anything. If you do, you start missing everybody. From extasia at extasia.org Fri Jun 8 10:16:46 2007 From: extasia at extasia.org (David Alban) Date: Fri, 8 Jun 2007 10:16:46 -0700 Subject: [sf-perl] This is what google street view wants to be when it grows up In-Reply-To: References: <4c714a9c0706071109o1d5e925aj8ec22ff018e1bbcc@mail.gmail.com> Message-ID: <4c714a9c0706081016v1a5f38a9n4961573faaec0ea8@mail.gmail.com> Oops. I forgot to put [OT] the subject. My bad. On 6/8/07, Duane Obrien wrote: > When I first saw this email, I couldn't figure out why it was list-worthy. > > So I watched it. > > Jesus H Christ in a chickenbasket that's awesome. -- Live in a world of your own, but always welcome visitors. From quinn at fairpath.com Fri Jun 8 13:12:54 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Fri, 8 Jun 2007 13:12:54 -0700 Subject: [sf-perl] Calling OSCON attendees: The Perl Foundation booth need boothies Message-ID: <20070608201254.GA19208@fu.funkspiel.org> If you're going to OSCON this year, and you want to help out the Perl Foundation, they're looking for bodies. Not sure what this entails, but volunteer at perlfoundation.org is the place to find out more. I won't be at OSCON myself. :( ----- Forwarded message from "David H. Adler" ----- Date: Fri, 8 Jun 2007 13:55:52 -0400 From: "David H. Adler" To: PM Group list Subject: [pm_groups] TPF boot at OSCON The Perl Foundation is looking for volunteers to man (or woman) our booth at OSCON. If any of your members are attending OSCON and would like to volunteer, they can send an email to volunteer at perlfoundation.org. Thanks! dha -- David H. Adler - - http://www.panix.com/~dha/ -- Request pm.org Technical Support via support at pm.org pm_groups mailing list pm_groups at pm.org http://mail.pm.org/mailman/listinfo/pm_groups ----- End forwarded message ----- -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From quinn at fairpath.com Mon Jun 11 21:30:07 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Mon, 11 Jun 2007 21:30:07 -0700 Subject: [sf-perl] LinuxWorld plans Message-ID: <20070612043007.GA49350@fu.funkspiel.org> So... We're short at least two volunteers from the minimum of five that we need. Oakland.pm (who were originally going to apply for the the booth) have pulled out due to lack of volunteers. Also, their leader, George, recently suffered an injury. And LinuxWorld starts August 6. At this point our best bet is to pool our resources with the SF PostgreSQL Users' Group. Josh Berkus has already made the offer: they have the booth, they like Perl, and they could use some more volunteers. They even have a dinner planned for Tuesday. Who's in for this revised plan? I'll be there. Anyone else? -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From doom at kzsu.stanford.edu Mon Jun 11 22:12:48 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Mon, 11 Jun 2007 22:12:48 -0700 Subject: [sf-perl] LinuxWorld plans In-Reply-To: <20070612043007.GA49350@fu.funkspiel.org> References: <20070612043007.GA49350@fu.funkspiel.org> Message-ID: <200706120512.l5C5Cm6j064830@kzsu.stanford.edu> Quinn Weaver wrote: > At this point our best bet is to pool our resources with the SF > PostgreSQL Users' Group. Josh Berkus has already made the offer: they > have the booth, they like Perl, and they could use some more > volunteers. They even have a dinner planned for Tuesday. > > Who's in for this revised plan? I'll be there. Anyone else? Sounds good. From josh at agliodbs.com Tue Jun 12 13:30:04 2007 From: josh at agliodbs.com (Josh Berkus) Date: Tue, 12 Jun 2007 13:30:04 -0700 Subject: [sf-perl] LinuxWorld plans In-Reply-To: <200706120512.l5C5Cm6j064830@kzsu.stanford.edu> References: <20070612043007.GA49350@fu.funkspiel.org> <200706120512.l5C5Cm6j064830@kzsu.stanford.edu> Message-ID: <200706121330.04378.josh@agliodbs.com> Quinn, Joe, > > Who's in for this revised plan? I'll be there. Anyone else? > > Sounds good. Can I count this as a commitment? Fred and I can do double duty as well. I only have about 48 hours to revise our booth description in the show guide. Unfortunately it's too late to revise the official booth name and get Perl listed by indexed name :-(. Anyway, some of us will discuss this at SFPUG tonight. -- Josh Berkus PostgreSQL @ Sun San Francisco From quinn at fairpath.com Tue Jun 12 13:56:39 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Tue, 12 Jun 2007 13:56:39 -0700 Subject: [sf-perl] LinuxWorld plans In-Reply-To: <200706121330.04378.josh@agliodbs.com> References: <20070612043007.GA49350@fu.funkspiel.org> <200706120512.l5C5Cm6j064830@kzsu.stanford.edu> <200706121330.04378.josh@agliodbs.com> Message-ID: <20070612205639.GB58181@fu.funkspiel.org> On Tue, Jun 12, 2007 at 01:30:04PM -0700, Josh Berkus wrote: > Quinn, Joe, > > > > Who's in for this revised plan? I'll be there. Anyone else? > > > > Sounds good. > > Can I count this as a commitment? Fred and I can do double duty as well. Yes, I'll commit. Also, Matt Lanier has confirmed his interest (expressed earlier). > Anyway, some of us will discuss this at SFPUG tonight. I'll be there. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From matt at lanier.org Tue Jun 12 09:59:17 2007 From: matt at lanier.org (Matthew Lanier) Date: Tue, 12 Jun 2007 09:59:17 -0700 (PDT) Subject: [sf-perl] LinuxWorld plans In-Reply-To: <20070612043007.GA49350@fu.funkspiel.org> References: <20070612043007.GA49350@fu.funkspiel.org> Message-ID: i'm good for that plan. i am still volunteering to help cover the booth for a while. m@ On Mon, 11 Jun 2007, Quinn Weaver wrote: > So... > > We're short at least two volunteers from the minimum of five that we > need. Oakland.pm (who were originally going to apply for the the > booth) have pulled out due to lack of volunteers. Also, their leader, > George, recently suffered an injury. And LinuxWorld starts August 6. > > At this point our best bet is to pool our resources with the SF > PostgreSQL Users' Group. Josh Berkus has already made the offer: they > have the booth, they like Perl, and they could use some more > volunteers. They even have a dinner planned for Tuesday. > > Who's in for this revised plan? I'll be there. Anyone else? > > -- Matthew D. P. K. Strelchun-Lanier matt at lanier.org http://www.bearlywornpacifica.com From extasia at extasia.org Tue Jun 12 16:31:21 2007 From: extasia at extasia.org (David Alban) Date: Tue, 12 Jun 2007 16:31:21 -0700 Subject: [sf-perl] [JOB] Tools position in release engineering group Message-ID: <4c714a9c0706121631h4a1150bcrd4863315065ad8f2@mail.gmail.com> Interested candidates please respond to Chuck Lenhard . *** Greetings, The following is a job req in my group. It's essentially a tools position in a release engineering group. Emphasis on unix experience (we're a linux shop) and tools skills (esp. perl and bash). This is in San Francisco near Embarcadero BART. Please respond to Chuck Lenhard if interested. Thanks, David *** RELEASE ENGINEER The Company StubHub is an online ticket exchange where fans buy or sell sports, concert, theater, and exclusive event tickets. StubHub offers fans exclusive event packages and charity auctions that no other Website offers. All transactions on StubHub are 100% guaranteed and we offer FedEx tracking, managed logistics, and live customer service. Summary of Duties: StubHub is seeking a talented Release Engineer that has skills and experience in developing internal tools for automation and managing build/deploy process. The Release Engineer will have a proven track record developing automated tools and processes to build and deploy releases in a managed service environment. The role will exist within Release Management. Essential Duties and Responsibilities: ? Skilled in Perl and UNIX shell programming (or other appropriate tools languages) ? Able to design and implement a robust web support system for communicating build issues and status ? Able to administer, manage and maintain source control system (CVS, Perforce, etc.); experience in sizing, tuning, backup, rollouts, etc. ? Collaborate with Development to implement and develop nightly build process (Ant, CruiseControl) ? Familiar with late night/overnight deployments to production ? Experience generating deployment plans and managing releases ? Excellent communication skills; able to interface with multiple groups across the company ? Provide expertise to the rest of the engineering organization regarding build tools and source control ? Advocate new tools and processes to continuously improve build and source control efficiency ? Mentor and assist junior members of the team as necessary Skills and Abilities Needed: ? BSCS or other technical degree or equivalent experience ? Extensive experience in a UNIX / LINUX environment ? 5+ years hands-on experience as a build or release engineer ? Experience with Open-Source development tools and systems e.g. Ant, Java, CruiseControl ? Expert knowledge of build, release and configuration management practices ? Familiarity with Windows desktop environment ? Experience working in a startup environment ? Demonstrated problem solving and troubleshooting skills ? Self-Starter; ability to quickly learn new tools and products ? Cooperative attitude and style ? Excellent verbal and written communication skills -- Live in a world of your own, but always welcome visitors. From doom at kzsu.stanford.edu Wed Jun 13 10:46:31 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Wed, 13 Jun 2007 10:46:31 -0700 Subject: [sf-perl] LinuxWorld plans In-Reply-To: <200706121330.04378.josh@agliodbs.com> References: <20070612043007.GA49350@fu.funkspiel.org> <200706120512.l5C5Cm6j064830@kzsu.stanford.edu> <200706121330.04378.josh@agliodbs.com> Message-ID: <200706131746.l5DHkVUv013111@kzsu.stanford.edu> Josh Berkus wrote: > > > Who's in for this revised plan? I'll be there. Anyone else? > > > > Sounds good. > > Can I count this as a commitment? Fred and I can do double duty as well. Oh sure. And while I'm not sure I qualify as a postgresql expert, I'm definitely enthusiastic about it. From quinn at fairpath.com Fri Jun 15 12:22:36 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Fri, 15 Jun 2007 12:22:36 -0700 Subject: [sf-perl] [job] C++/Perl contract at Yahoo Message-ID: <20070615192236.GB87996@fu.funkspiel.org> A recruiter I work with has an opening for a Perl person who's also strong in C++. It's for Yahoo, for a long-term W2 contract. The work is on-site in Sunnyvale. If this is up your alley, please mail Srikant . Srikant got me my current gig at Yahoo, and I've found he's a good guy to work with--definitely a cut above your usual recruiters. If you're curious about what it's like to work at Yahoo, phone me, and I'll share my impressions. Full discloure: if you're hired, I get a small bonus. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From Peter.Loo at source.wolterskluwer.com Tue Jun 19 09:31:27 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Tue, 19 Jun 2007 09:31:27 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> Hello Everyone, I have a large program that loops through approximately 150 rows of data from an Oracle database using Perl DBI. Within each row of data the program performs further actions like logging on to a different database (Netezza using ODBC driver) to gather further information then writing to yet another database. I am making sure that $sth->finish() and $dbh->disconnect are being used appropriately where necessary. Everything seem to be checking out, but at this very same row of data, I always get a core dump while attempting to logon to the same database to which I was connecting and disconnecting in the previous steps. So I turned on the Perl debug to step through the each row. At the very same row, I get the following error from Perl. DB<19> c main::sub_exit(/usr/local/apps/common/devl/bin/GlobalRoutines.pm:551): 551: print STDERR "***** sub_exit() begins. *****\n\n"; 100 levels deep in subroutine calls! Is this strictly a Perl debug error message or is this a generic Perl error message? Is there a way around this limitation? I saw something while searching on the Internet about setting the $DB::deep to a higher number. I hope you can shed some light for me. Thanks. Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070619/e86c253e/attachment.html From merlyn at stonehenge.com Tue Jun 19 09:35:05 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Tue, 19 Jun 2007 09:35:05 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> (Peter Loo's message of "Tue, 19 Jun 2007 09:31:27 -0700") References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> Message-ID: <86ejk7nbra.fsf@blue.stonehenge.com> >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> Is this strictly a Perl debug error message or is this a generic Perl Loo,> error message? Is there a way around this limitation? I saw something Loo,> while searching on the Internet about setting the $DB::deep to a higher Loo,> number. Why are you recursing on every line? Can you flatten your call stack? Perhaps by gathering all the data first, then acting on it, rather than acting on it as you see each line. I've *never* hit the nested-100-deep limit except by accident (or deliberately). -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From merlyn at stonehenge.com Tue Jun 19 09:42:08 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Tue, 19 Jun 2007 09:42:08 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A0391C878@phxmail02.phx.ndchealth.com> (Peter Loo's message of "Tue, 19 Jun 2007 09:38:37 -0700") References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <86ejk7nbra.fsf@blue.stonehenge.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391C878@phxmail02.phx.ndchealth.com> Message-ID: <86abuvnbfj.fsf@blue.stonehenge.com> >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> Because I was getting a core dump right when the program attempted to Loo,> connect at this very STEP, I wanted to see all the values of the Loo,> variables so I was STEPPING through each row surrounding this Loo,> connection. This doesn't answer any of the questions I asked. Not sure why you responded to be with a non-responsive answer. {sigh} Half the battle of getting something solved is figuring out what you're doing in the first case. Repeating the most important question: WHY ARE YOU RECURSING INSTEAD OF ITERATING? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From Peter.Loo at source.wolterskluwer.com Tue Jun 19 09:51:29 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Tue, 19 Jun 2007 09:51:29 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <86abuvnbfj.fsf@blue.stonehenge.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com><86ejk7nbra.fsf@blue.stonehenge.com><8E3D502A002DA04FADBDED4CB4D94D3A0391C878@phxmail02.phx.ndchealth.com> <86abuvnbfj.fsf@blue.stonehenge.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A0391C8B6@phxmail02.phx.ndchealth.com> I am sorry. I guess I am not understanding your question. I am not seeing the difference. Peter -----Original Message----- From: Randal L. Schwartz [mailto:merlyn at stonehenge.com] Sent: Tuesday, June 19, 2007 9:42 AM To: Loo, Peter # PHX Cc: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] 100 levels deep in subroutine calls! >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> Because I was getting a core dump right when the program attempted to Loo,> connect at this very STEP, I wanted to see all the values of the Loo,> variables so I was STEPPING through each row surrounding this Loo,> connection. This doesn't answer any of the questions I asked. Not sure why you responded to be with a non-responsive answer. {sigh} Half the battle of getting something solved is figuring out what you're doing in the first case. Repeating the most important question: WHY ARE YOU RECURSING INSTEAD OF ITERATING? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From Peter.Loo at source.wolterskluwer.com Tue Jun 19 09:57:18 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Tue, 19 Jun 2007 09:57:18 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <86ejk7nbra.fsf@blue.stonehenge.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <86ejk7nbra.fsf@blue.stonehenge.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A0391C8D4@phxmail02.phx.ndchealth.com> Actually I did not break until a certain condition was met. Then I started to step through the code surrounding this failing database connection. For example: DB<1> b 325 $etl_tbl_gid == 170 Then I let the program go until I was prompted again. Peter -----Original Message----- From: Randal L. Schwartz [mailto:merlyn at stonehenge.com] Sent: Tuesday, June 19, 2007 9:35 AM To: Loo, Peter # PHX Cc: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] 100 levels deep in subroutine calls! >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> Is this strictly a Perl debug error message or is this a generic Perl Loo,> error message? Is there a way around this limitation? I saw something Loo,> while searching on the Internet about setting the $DB::deep to a higher Loo,> number. Why are you recursing on every line? Can you flatten your call stack? Perhaps by gathering all the data first, then acting on it, rather than acting on it as you see each line. I've *never* hit the nested-100-deep limit except by accident (or deliberately). -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From merlyn at stonehenge.com Tue Jun 19 09:56:22 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Tue, 19 Jun 2007 09:56:22 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A0391C8B6@phxmail02.phx.ndchealth.com> (Peter Loo's message of "Tue, 19 Jun 2007 09:51:29 -0700") References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <86ejk7nbra.fsf@blue.stonehenge.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391C878@phxmail02.phx.ndchealth.com> <86abuvnbfj.fsf@blue.stonehenge.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391C8B6@phxmail02.phx.ndchealth.com> Message-ID: <86wsxzlw7d.fsf@blue.stonehenge.com> >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> I am sorry. I guess I am not understanding your question. I am not Loo,> seeing the difference. Do you understand the difference between recursion and iteration? If not, that may be the source of your problem. :) I'm not about to teach CS101 here... maybe someone else will step up. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From Peter.Loo at source.wolterskluwer.com Tue Jun 19 09:38:37 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Tue, 19 Jun 2007 09:38:37 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <86ejk7nbra.fsf@blue.stonehenge.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <86ejk7nbra.fsf@blue.stonehenge.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A0391C878@phxmail02.phx.ndchealth.com> Hi Randal, Because I was getting a core dump right when the program attempted to connect at this very STEP, I wanted to see all the values of the variables so I was STEPPING through each row surrounding this connection. Peter -----Original Message----- From: Randal L. Schwartz [mailto:merlyn at stonehenge.com] Sent: Tuesday, June 19, 2007 9:35 AM To: Loo, Peter # PHX Cc: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] 100 levels deep in subroutine calls! >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> Is this strictly a Perl debug error message or is this a generic Perl Loo,> error message? Is there a way around this limitation? I saw something Loo,> while searching on the Internet about setting the $DB::deep to a higher Loo,> number. Why are you recursing on every line? Can you flatten your call stack? Perhaps by gathering all the data first, then acting on it, rather than acting on it as you see each line. I've *never* hit the nested-100-deep limit except by accident (or deliberately). -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From Peter.Loo at source.wolterskluwer.com Tue Jun 19 10:13:52 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Tue, 19 Jun 2007 10:13:52 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <86wsxzlw7d.fsf@blue.stonehenge.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com><86ejk7nbra.fsf@blue.stonehenge.com><8E3D502A002DA04FADBDED4CB4D94D3A0391C878@phxmail02.phx.ndchealth.com><86abuvnbfj.fsf@blue.stonehenge.com><8E3D502A002DA04FADBDED4CB4D94D3A0391C8B6@phxmail02.phx.ndchealth.com> <86wsxzlw7d.fsf@blue.stonehenge.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A0391C91C@phxmail02.phx.ndchealth.com> Randal, You must be a genius for spotting whether I am using recursion verses iteration from just a tiny amount of information that I shared. I bow to you, but you have mistaken. :D Peter -----Original Message----- From: Randal L. Schwartz [mailto:merlyn at stonehenge.com] Sent: Tuesday, June 19, 2007 9:56 AM To: Loo, Peter # PHX Cc: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] 100 levels deep in subroutine calls! >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> I am sorry. I guess I am not understanding your question. I am not Loo,> seeing the difference. Do you understand the difference between recursion and iteration? If not, that may be the source of your problem. :) I'm not about to teach CS101 here... maybe someone else will step up. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From merlyn at stonehenge.com Tue Jun 19 10:22:30 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Tue, 19 Jun 2007 10:22:30 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A0391C91C@phxmail02.phx.ndchealth.com> (Peter Loo's message of "Tue, 19 Jun 2007 10:13:52 -0700") References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <86ejk7nbra.fsf@blue.stonehenge.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391C878@phxmail02.phx.ndchealth.com> <86abuvnbfj.fsf@blue.stonehenge.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391C8B6@phxmail02.phx.ndchealth.com> <86wsxzlw7d.fsf@blue.stonehenge.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391C91C@phxmail02.phx.ndchealth.com> Message-ID: <86fy4nluzt.fsf@blue.stonehenge.com> >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> Randal, Loo,> You must be a genius for spotting whether I am using recursion verses Loo,> iteration from just a tiny amount of information that I shared. I bow Loo,> to you, but you have mistaken. :D So, show me a static "who calls who" graph of your application, and show me that you've written 101 subroutines that each in turn call the next. First, what's the name of your 101 subroutines? We can start there. Oh, you don't *have* 101 subroutines? Then some recursion is going on, I PROMISE YOU. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From david at fetter.org Tue Jun 19 10:26:18 2007 From: david at fetter.org (David Fetter) Date: Tue, 19 Jun 2007 10:26:18 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> Message-ID: <20070619172618.GA25155@fetter.org> On Tue, Jun 19, 2007 at 09:31:27AM -0700, Loo, Peter # PHX wrote: > Hello Everyone, > > I have a large program that loops through approximately 150 rows of data > from an Oracle database using Perl DBI. Peter, You seem to be having some trouble with asking questions. The URL below should help. Bookmark it, and pull it up before you send any question to this list. http://www.catb.org/~esr/faqs/smart-questions.html Given the questions you've asked over the years, you also appear to have some trouble with your meta-cognitive skills. http://www.apa.org/journals/features/psp7761121.pdf That is a much harder burden... for the rest of us to bear. Cheers, David. -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! Consider donating to PostgreSQL: http://www.postgresql.org/about/donate From josh at agliodbs.com Tue Jun 19 10:33:16 2007 From: josh at agliodbs.com (Josh Berkus) Date: Tue, 19 Jun 2007 10:33:16 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> Message-ID: <200706191033.16757.josh@agliodbs.com> Peter, > DB<19> c > main::sub_exit(/usr/local/apps/common/devl/bin/GlobalRoutines.pm:551): > 551: print STDERR "***** sub_exit() begins. *****\n\n"; > 100 levels deep in subroutine calls! > > Is this strictly a Perl debug error message or is this a generic Perl > error message? This is an error message. You've somehow entered the land of inifinite recursion. It's possible that this is due to a DBI driver bug, but more likely it's a bug in your own code. Look for subroutines which call themselves. -- Josh Berkus PostgreSQL @ Sun San Francisco From Peter.Loo at source.wolterskluwer.com Tue Jun 19 10:42:41 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Tue, 19 Jun 2007 10:42:41 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <200706191033.16757.josh@agliodbs.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <200706191033.16757.josh@agliodbs.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A0391C98D@phxmail02.phx.ndchealth.com> Thank you all for your inputs. I think from putting pieces together, I do see a light. If I offended anyone, I sincerely apologize. I am actually a very easy going person, however, my written communication might need refinement. Your comments and advises are well taken with great appreciation. Peter -----Original Message----- From: Josh Berkus [mailto:josh at agliodbs.com] Sent: Tuesday, June 19, 2007 10:33 AM To: sanfrancisco-pm at pm.org Cc: Loo, Peter # PHX Subject: Re: [sf-perl] 100 levels deep in subroutine calls! Peter, > DB<19> c > main::sub_exit(/usr/local/apps/common/devl/bin/GlobalRoutines.pm:551): > 551: print STDERR "***** sub_exit() begins. *****\n\n"; > 100 levels deep in subroutine calls! > > Is this strictly a Perl debug error message or is this a generic Perl > error message? This is an error message. You've somehow entered the land of inifinite recursion. It's possible that this is due to a DBI driver bug, but more likely it's a bug in your own code. Look for subroutines which call themselves. -- Josh Berkus PostgreSQL @ Sun San Francisco This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From merlyn at stonehenge.com Tue Jun 19 10:48:03 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Tue, 19 Jun 2007 10:48:03 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A0391C98D@phxmail02.phx.ndchealth.com> (Peter Loo's message of "Tue, 19 Jun 2007 10:42:41 -0700") References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <200706191033.16757.josh@agliodbs.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391C98D@phxmail02.phx.ndchealth.com> Message-ID: <867ipzltt8.fsf@blue.stonehenge.com> >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> Thank you all for your inputs. I think from putting pieces together, I Loo,> do see a light. If I offended anyone, I sincerely apologize. I am Loo,> actually a very easy going person, however, my written communication Loo,> might need refinement. Your comments and advises are well taken with Loo,> great appreciation. I'd be much less interested in an apology and much more interested in a disclosure of what you learned so that future readers of this thread will also be able to follow your enlightenment. How were you, in fact, recursing? That'd be a good thing to disclose. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From Peter.Loo at source.wolterskluwer.com Tue Jun 19 11:54:23 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Tue, 19 Jun 2007 11:54:23 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <867ipzltt8.fsf@blue.stonehenge.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com><200706191033.16757.josh@agliodbs.com><8E3D502A002DA04FADBDED4CB4D94D3A0391C98D@phxmail02.phx.ndchealth.com> <867ipzltt8.fsf@blue.stonehenge.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A0391CADE@phxmail02.phx.ndchealth.com> What I have learned today is that Perl has a default recursive setting of 100. It turns out that someone had removed the Oracle path definition file that the program needed and when it couldn't find the file, it went to perform the email notification sub-routine. The problem is that the email notification sub-routine also require the Oracle path to be set so it also calls this sub-routine that reads this file to set the Oracle paths. So the program quickly reached the limitation of 100. From this exercise I was able to identify a flaw in the design of the notification sub-routine. So back to my original problem of the core dump. Haven't identified this problem. Thanks. Peter -----Original Message----- From: Randal L. Schwartz [mailto:merlyn at stonehenge.com] Sent: Tuesday, June 19, 2007 10:48 AM To: Loo, Peter # PHX Cc: Josh Berkus; sanfrancisco-pm at pm.org Subject: Re: [sf-perl] 100 levels deep in subroutine calls! >>>>> "Loo," == Loo, Peter # PHX writes: Loo,> Thank you all for your inputs. I think from putting pieces together, I Loo,> do see a light. If I offended anyone, I sincerely apologize. I am Loo,> actually a very easy going person, however, my written communication Loo,> might need refinement. Your comments and advises are well taken with Loo,> great appreciation. I'd be much less interested in an apology and much more interested in a disclosure of what you learned so that future readers of this thread will also be able to follow your enlightenment. How were you, in fact, recursing? That'd be a good thing to disclose. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From rick at linuxmafia.com Tue Jun 19 12:55:46 2007 From: rick at linuxmafia.com (Rick Moen) Date: Tue, 19 Jun 2007 12:55:46 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <20070619172618.GA25155@fetter.org> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <20070619172618.GA25155@fetter.org> Message-ID: <20070619195546.GA21718@linuxmafia.com> Quoting David Fetter (david at fetter.org): > The URL below should help. Bookmark it, and pull it up before you > send any question to this list. > > http://www.catb.org/~esr/faqs/smart-questions.html Regrettably, I have to warn that one of that piece's co-authors is excessively loquacious, with sequipedalian tendencies. A sad case, really. -- Cheers, Founding member of the Hyphenation Society, a grassroots-based, Rick Moen not-for-profit, locally-owned-and-operated, cooperatively-managed, rick at linuxmafia.com modern-American-English-usage-improvement association. From andy at petdance.com Tue Jun 19 13:14:23 2007 From: andy at petdance.com (Andy Lester) Date: Tue, 19 Jun 2007 15:14:23 -0500 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <20070619195546.GA21718@linuxmafia.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <20070619172618.GA25155@fetter.org> <20070619195546.GA21718@linuxmafia.com> Message-ID: <100AE39F-AAC9-438D-A88E-1E8B25EDA8B1@petdance.com> On Jun 19, 2007, at 2:55 PM, Rick Moen wrote: >> http://www.catb.org/~esr/faqs/smart-questions.html > > Regrettably, I have to warn that one of that piece's co-authors is > excessively loquacious, with sequipedalian tendencies. A sad case, > really. Not to mention the tone of the document being unnecessarily anti- social, abrasive and aggressive. "Never, ever expect hackers to be able to read closed proprietary document formats like Microsoft Word or Excel. Most hackers react to these about as well as you would to having a pile of steaming pig manure dumped on your doorstep. Even when they can cope, they resent having to do so." "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through- the-bullshit communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy." "On Not Reacting Like A Loser" "[Where can I find X?] The same place I'd find it, fool ? at the other end of a web search. Ghod, doesn't everybody know how to use Google yet?" "[Re: Windows questions] Yes. Throw out that Microsoft trash and install an open-source operating system like Linux or BSD." and then, most ironically, "There is no need of public humiliation for someone who may have made an honest mistake. A real newbie may not know how to search archives or where the FAQ is stored or posted." I just added a note to my to-do list: "Adapt a less harsh, more welcoming version of Smart Questions". xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From rick at linuxmafia.com Tue Jun 19 13:19:25 2007 From: rick at linuxmafia.com (Rick Moen) Date: Tue, 19 Jun 2007 13:19:25 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <100AE39F-AAC9-438D-A88E-1E8B25EDA8B1@petdance.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A0391C85A@phxmail02.phx.ndchealth.com> <20070619172618.GA25155@fetter.org> <20070619195546.GA21718@linuxmafia.com> <100AE39F-AAC9-438D-A88E-1E8B25EDA8B1@petdance.com> Message-ID: <20070619201925.GC21718@linuxmafia.com> Quoting Andy Lester (andy at petdance.com): > I just added a note to my to-do list: "Adapt a less harsh, more > welcoming version of Smart Questions". That could be really useful, and I'll definitely look forward to seeing your variant. Also, the referenced essay is much too long for its target audiences' needs, and insufficiently well organised / indexed to find practical tips with the right amount of detail when one needs them. -- Cheers, "Reality is not optional." Rick Moen -- Thomas Sowell rick at linuxmafia.com From moseley at hank.org Tue Jun 19 13:56:18 2007 From: moseley at hank.org (Bill Moseley) Date: Tue, 19 Jun 2007 13:56:18 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A0391CADE@phxmail02.phx.ndchealth.com> References: <867ipzltt8.fsf@blue.stonehenge.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391CADE@phxmail02.phx.ndchealth.com> Message-ID: <20070619205617.GA32382@hank.org> On Tue, Jun 19, 2007 at 11:54:23AM -0700, Loo, Peter # PHX wrote: > > What I have learned today is that Perl has a default recursive setting > of 100. It turns out that someone had removed the Oracle path > definition file that the program needed and when it couldn't find the > file, it went to perform the email notification sub-routine. The > problem is that the email notification sub-routine also require the > Oracle path to be set so it also calls this sub-routine that reads this > file to set the Oracle paths. So the program quickly reached the > limitation of 100. From this exercise I was able to identify a flaw in > the design of the notification sub-routine. Programs emailing on error is a flooded inbox waiting to happen. -- Bill Moseley moseley at hank.org From merlyn at stonehenge.com Wed Jun 20 07:22:18 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Wed, 20 Jun 2007 07:22:18 -0700 Subject: [sf-perl] 100 levels deep in subroutine calls! In-Reply-To: <20070619205617.GA32382@hank.org> (Bill Moseley's message of "Tue, 19 Jun 2007 13:56:18 -0700") References: <867ipzltt8.fsf@blue.stonehenge.com> <8E3D502A002DA04FADBDED4CB4D94D3A0391CADE@phxmail02.phx.ndchealth.com> <20070619205617.GA32382@hank.org> Message-ID: <86vediiu3p.fsf@blue.stonehenge.com> >>>>> "Bill" == Bill Moseley writes: Bill> Programs emailing on error is a flooded inbox waiting to happen. "I have a column on that" he says... -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From extasia at extasia.org Wed Jun 20 09:42:32 2007 From: extasia at extasia.org (David Alban) Date: Wed, 20 Jun 2007 09:42:32 -0700 Subject: [sf-perl] Debugger goodies rendered worthless Message-ID: <4c714a9c0706200942v73d88661u591b71cc5497a813@mail.gmail.com> Greetings, As you may know, the ability to start a perl debugger command with a pipe symbol, so that it pages the output, can be a very handy thing. Both to actually page the output, and, in the case of using less(1) as your pager, to be able easily to save the output to a file while debugging. I'm debugging on a machine in which many things that have worked for me on other machines don't seem to work. Prepending the pipe symbol to debugger commands doesn't page the output. The terminal settings are messed up. For instance, the stty settings for erase, kill, werase, lnext aren't set. (I tried setting them in the target user's .bash_profile, to no avail.) In fact, in the debugger, this works: !! ls But I get: DB<10> !!stty stty: standard input: Invalid argument (Command exited 1) wtf? Because the stty erase, werase, and kill characters aren't set (or, at least, because I can't shell out to execute stty, I can't determine what they are), I have to type each debugger command perfectly, or I'm wasting a lot of time. Any suggestions? ------------------------------------------------------------------------------------------------- Since I wrote the above text, I figured, maybe it's because what I'm doing is running a perl program on host A which is ssh'ing to host B, sudo'ing another perl program as root. I think that somehow, going over the network and/or going through ssh is rendering the helpful features inoperative. Have others run into this? Is it a solvable problem? (I haven't tried it on a host different than host B, so I still don't know whether it's peculiar to going from host A to host B...) Thanks, David P.S. If you do perl / shell tools, please check out: http://jobs.perl.org/job/5953 -- Live in a world of your own, but always welcome visitors. From doom at kzsu.stanford.edu Wed Jun 20 10:25:40 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Wed, 20 Jun 2007 10:25:40 -0700 Subject: [sf-perl] Debugger goodies rendered worthless In-Reply-To: <4c714a9c0706200942v73d88661u591b71cc5497a813@mail.gmail.com> References: <4c714a9c0706200942v73d88661u591b71cc5497a813@mail.gmail.com> Message-ID: <200706201725.l5KHPeoQ052582@kzsu.stanford.edu> David Alban wrote: > As you may know, the ability to start a perl debugger command with a > pipe symbol, so that it pages the output, can be a very handy thing. > Both to actually page the output, and, in the case of using less(1) as > your pager, to be able easily to save the output to a file while > debugging. > > I'm debugging on a machine in which many things that have worked for > me on other machines don't seem to work. Prepending the pipe symbol > to debugger commands doesn't page the output. The terminal settings > are messed up. For instance, the stty settings for erase, kill, > werase, lnext aren't set. (I tried setting them in the target user's > .bash_profile, to no avail.) In fact, in the debugger, this works: > > !! ls > > But I get: > > DB<10> !!stty > stty: standard input: Invalid argument > (Command exited 1) > > wtf? > > Because the stty erase, werase, and kill characters aren't set (or, at > least, because I can't shell out to execute stty, I can't determine > what they are), I have to type each debugger command perfectly, or I'm > wasting a lot of time. > > Any suggestions? Probably not from me, I tend to run the debugger inside of emacs, and if I want to save some output, I can cut-and-paste using emacs commands. > Since I wrote the above text, I figured, maybe it's because what I'm > doing is running a perl program on host A which is ssh'ing to host B, > sudo'ing another perl program as root. I think that somehow, going > over the network and/or going through ssh is rendering the helpful > features inoperative. > > Have others run into this? Is it a solvable problem? Are you doing a plain "ssh" or "ssh -X"? I've seen a simple "-X" fix what I thought were baffling tty issues in the past (it let's you start up X applications over ssh). Running as root can give you X app problems as well, of course... but I'm not sure that's your difficulty. From quinn at fairpath.com Wed Jun 20 21:17:03 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Wed, 20 Jun 2007 21:17:03 -0700 Subject: [sf-perl] June 26 - 7:00 p.m. (NOT 8:00) - Fred Moyer on the Big Ball of Mud In-Reply-To: <20070608060443.GA11259@fu.funkspiel.org> References: <20070608060443.GA11259@fu.funkspiel.org> Message-ID: <20070621041703.GA41115@fu.funkspiel.org> Hi, everyone, This is a reminder that next Tuesday we're meeting ******************* * * * at 7:00 p.m. ! * * * ******************* for Fred's talk. RSVP to Jeff.Thalhammer at barclaysglobal.com, so he can order the right amount of Thai food. :) Further details at http://sf.pm.org/weblog/archives/00000045.html. On Thu, Jun 07, 2007 at 11:04:43PM -0700, Quinn Weaver wrote: > *********************** N O T E *********************** > > This meeting starts at 7:00 p.m., NOT 8:00. > > *********************** N O T E *********************** > > Ahem. That said, I'm pleased to announce our next talk: > > June 26, 2007: > Fred Moyer on the Big Ball of Mud > > Fred Moyer (http://www.redhotpenguin.com/) will discuss techniques > for handling the Big Ball of Mud: that haphazardly grown, ill-documented, > fragile, and messy codebase that we've all had to deal with. His talk > focuses on how to test and clean up BBOMs, paying off technical debt > so you can add features again without fear of the code breaking. > > I had a chance to see this talk last month, and I was very impressed. > Fred does a great job of explaining not just the technical, uh, > techniques for handling BBOMs, but also the trickier social > engineering you have to do in order to make it happen. > > This is a shortish talk, so Fred will also cover the highlights of the > Nordic Perl Workshop, where he recently spoke. > > BGI will sponsor Thai food from BKK. Thanks, guys! > > RSVP to Jeff.Thalhammer at barclaysglobal.com > > Location details at http://sf.pm.org/weblog/archives/00000045.html > > -- > Quinn Weaver, independent contractor | President, San Francisco Perl Mongers > http://fairpath.com/quinn/resume/ | http://sf.pm.org/ > 510-520-5217 -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From Peter.Loo at source.wolterskluwer.com Thu Jun 21 14:30:40 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Thu, 21 Jun 2007 14:30:40 -0700 Subject: [sf-perl] Bad file number Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> Hi, I am getting a "Too many open files" error when the program attempts to open a file. I have checked the logic and it appears that there is a corresponding close() for every open(). I don't know why Perl is warning me with this error. I am wondering if there is a way to check how many files are open while in debug mode. I would appreciate any comments. Thanks. Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070621/b1c9e634/attachment.html From sphink at gmail.com Thu Jun 21 14:42:35 2007 From: sphink at gmail.com (Steve Fink) Date: Thu, 21 Jun 2007 14:42:35 -0700 Subject: [sf-perl] Debugger goodies rendered worthless In-Reply-To: <200706201725.l5KHPeoQ052582@kzsu.stanford.edu> References: <4c714a9c0706200942v73d88661u591b71cc5497a813@mail.gmail.com> <200706201725.l5KHPeoQ052582@kzsu.stanford.edu> Message-ID: <7d7f2e8c0706211442k3d3821al97cdc420be39cfbf@mail.gmail.com> Perhaps you aren't running in a terminal at all? I didn't actually read your message in detail, but try running with ssh -t. It will force allocation of a terminal. From sphink at gmail.com Thu Jun 21 14:48:27 2007 From: sphink at gmail.com (Steve Fink) Date: Thu, 21 Jun 2007 14:48:27 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> Message-ID: <7d7f2e8c0706211448n76b607e2vf19e915f861ad7b4@mail.gmail.com> On 6/21/07, Loo, Peter # PHX wrote: > I am wondering if there is a way to check how many files are open while in > debug mode. What platform? On Linux, run lsof -p . No debug mode needed. Or ls -l /proc//fd, which will give much the same thing. On Windows, wave the chicken over your head three times and make the sound of a pregnant pig. It won't help, but it might make you feel like you're making progress. From Peter.Loo at source.wolterskluwer.com Thu Jun 21 15:01:46 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Thu, 21 Jun 2007 15:01:46 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <7d7f2e8c0706211448n76b607e2vf19e915f861ad7b4@mail.gmail.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> <7d7f2e8c0706211448n76b607e2vf19e915f861ad7b4@mail.gmail.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A039632A8@phxmail02.phx.ndchealth.com> Thanks Steve. I am on Solaris. I had forgotten about this Unix command. Greatly appreciate it. Peter -----Original Message----- From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org [mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or g] On Behalf Of Steve Fink Sent: Thursday, June 21, 2007 2:48 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Bad file number On 6/21/07, Loo, Peter # PHX wrote: > I am wondering if there is a way to check how many files are open > while in debug mode. What platform? On Linux, run lsof -p . No debug mode needed. Or ls -l /proc//fd, which will give much the same thing. On Windows, wave the chicken over your head three times and make the sound of a pregnant pig. It won't help, but it might make you feel like you're making progress. _______________________________________________ SanFrancisco-pm mailing list SanFrancisco-pm at pm.org http://mail.pm.org/mailman/listinfo/sanfrancisco-pm This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From quinn at fairpath.com Thu Jun 21 17:55:29 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 21 Jun 2007 17:55:29 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> Message-ID: <20070622005529.GA50228@fu.funkspiel.org> On Thu, Jun 21, 2007 at 02:30:40PM -0700, Loo, Peter # PHX wrote: > Hi, > > I am getting a "Too many open files" error when the program attempts to > open a file. It's possible that your calls to close() are failing silently. Close returns a true value on success and a false value on failure. So you can add code to check its return value, to see if it's really working. Try: close MY_FH or warn "Couldn't close file: $!"; > I have checked the logic and it appears that there is a > corresponding close() for every open(). I don't know why Perl is > warning me with this error. Just "checking the logic" by looking at your code doesn't cut it. You need to test empirically whether your code is doing what you think it is. Try putting warn "closed file MYFILE successfully" after your close statements... just to verify that what you think is happening is actually happening. Make a habit of testing your assumptions this way. It is the royal road to figuring out bugs. Debugging is a matter of practice, not theory-- because if the code were working the way that you think in theory it should be, you wouldn't have a bug! -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From sphink at gmail.com Thu Jun 21 21:45:45 2007 From: sphink at gmail.com (Steve Fink) Date: Thu, 21 Jun 2007 21:45:45 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <20070622005529.GA50228@fu.funkspiel.org> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> <20070622005529.GA50228@fu.funkspiel.org> Message-ID: <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> On 6/21/07, Quinn Weaver wrote: > On Thu, Jun 21, 2007 at 02:30:40PM -0700, Loo, Peter # PHX wrote: > > I have checked the logic and it appears that there is a > > corresponding close() for every open(). I don't know why Perl is > > warning me with this error. > > Just "checking the logic" by looking at your code doesn't cut it. > You need to test empirically whether your code is doing what you think it is. > > Try putting warn "closed file MYFILE successfully" after your close > statements... just to verify that what you think is happening is > actually happening. > > Make a habit of testing your assumptions this way. It is the royal > road to figuring out bugs. Debugging is a matter of practice, not theory-- > because if the code were working the way that you think in theory > it should be, you wouldn't have a bug! Good general advice, but I'm not sure how well it applies in this situation. How many ways can close() fail in such a way that the file descriptor is not closed? If it did, what would the user be able to do about it? (There are many ways for close() to fail, as many as there are ways that write() can fail, but close() should still close the fd.) There *is* actually one way, if close() returned EINTR, but I doubt that's what is happening here. I'm guessing the logic isn't quite right. Checking the result of close() may indeed point out valuable clues, though. (eg if it is returning EINVAL, perhaps you're not closing what you think.) From quinn at fairpath.com Fri Jun 22 07:46:16 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Fri, 22 Jun 2007 07:46:16 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> <20070622005529.GA50228@fu.funkspiel.org> <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> Message-ID: <20070622144616.GA58251@fu.funkspiel.org> On Thu, Jun 21, 2007 at 09:45:45PM -0700, Steve Fink wrote: > On 6/21/07, Quinn Weaver wrote: > > On Thu, Jun 21, 2007 at 02:30:40PM -0700, Loo, Peter # PHX wrote: > > > I have checked the logic and it appears that there is a > > > corresponding close() for every open(). I don't know why Perl is > > > warning me with this error. > > > > Just "checking the logic" by looking at your code doesn't cut it. > > You need to test empirically whether your code is doing what you think it is. > > > > Try putting warn "closed file MYFILE successfully" after your close > > statements... just to verify that what you think is happening is > > actually happening. > > > > Make a habit of testing your assumptions this way. It is the royal > > road to figuring out bugs. Debugging is a matter of practice, not theory-- > > because if the code were working the way that you think in theory > > it should be, you wouldn't have a bug! > > Good general advice, but I'm not sure how well it applies in this > situation. How many ways can close() fail Actually, I agree. I think that placing warn statements after close (warn "just closed file $MY_PATH") will be more useful than checking the return code--because, as you pointed out, the most likely problem is that the close code is just failing to get called, due to bad logic. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From Peter.Loo at source.wolterskluwer.com Fri Jun 22 09:18:33 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 22 Jun 2007 09:18:33 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com><20070622005529.GA50228@fu.funkspiel.org> <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A039A1233@phxmail02.phx.ndchealth.com> Thanks again Steve. I was going crazy looking for any clues that would lead to the reason why I would get this error message. I walked through the logic to make sure that there is one close() for every open() and also checked the result of both. It turns out that the ODBC driver that I am using for Netezza database is opening the odbc.ini file 7 times for every connect to the database and is not closing the file. I wrote a simple program to loop through and connect and disconnect from the database and watched my PID using lsof and learn that each connection added 7 file handles for odbc.ini file. It continued until it reached the threshold of 256 file handles. I wanted to look through the code to the ODBC driver, but because it is compiled and was given to us by the vendor, we have opened a ticket with them. Thanks for all your help. Have a nice weekend. Peter -----Original Message----- From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org [mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or g] On Behalf Of Steve Fink Sent: Thursday, June 21, 2007 9:46 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Bad file number On 6/21/07, Quinn Weaver wrote: > On Thu, Jun 21, 2007 at 02:30:40PM -0700, Loo, Peter # PHX wrote: > > I have checked the logic and it appears that there is a > > corresponding close() for every open(). I don't know why Perl is > > warning me with this error. > > Just "checking the logic" by looking at your code doesn't cut it. > You need to test empirically whether your code is doing what you think it is. > > Try putting warn "closed file MYFILE successfully" after your close > statements... just to verify that what you think is happening is > actually happening. > > Make a habit of testing your assumptions this way. It is the royal > road to figuring out bugs. Debugging is a matter of practice, not > theory-- because if the code were working the way that you think in > theory it should be, you wouldn't have a bug! Good general advice, but I'm not sure how well it applies in this situation. How many ways can close() fail in such a way that the file descriptor is not closed? If it did, what would the user be able to do about it? (There are many ways for close() to fail, as many as there are ways that write() can fail, but close() should still close the fd.) There *is* actually one way, if close() returned EINTR, but I doubt that's what is happening here. I'm guessing the logic isn't quite right. Checking the result of close() may indeed point out valuable clues, though. (eg if it is returning EINVAL, perhaps you're not closing what you think.) _______________________________________________ SanFrancisco-pm mailing list SanFrancisco-pm at pm.org http://mail.pm.org/mailman/listinfo/sanfrancisco-pm This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From friedman at highwire.stanford.edu Fri Jun 22 09:53:03 2007 From: friedman at highwire.stanford.edu (Michael Friedman) Date: Fri, 22 Jun 2007 09:53:03 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A039A1233@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com><20070622005529.GA50228@fu.funkspiel.org> <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> <8E3D502A002DA04FADBDED4CB4D94D3A039A1233@phxmail02.phx.ndchealth.com> Message-ID: I've had a similar problem with too-many-database-connections-causing- problems with Sybperl. Not due to filehandles in my case, but a similar solution might help you. In my case, the solution was to cache those connections and reuse them. I don't know what your code looks like, but perhaps you could open the DB connections in a larger scope and reuse them instead of creating and destroying them as you go along. So rather than having 35 DB connections open, you might only have 5 or 6 that you can share. In my system, we have a separate object (a Singleton) that holds the cache of DB connections and other objects check out a connection, use it, and check it back in when they're done. New connections are only created if you run out of existing ones. And since my code is pretty much single-threaded, we almost never use more than 2 connections at a time this way. YMMV, but it might be a way to get around the problem. -- Mike On Jun 22, 2007, at 9:18 AM, Loo, Peter # PHX wrote: > Thanks again Steve. I was going crazy looking for any clues that > would > lead to the reason why I would get this error message. I walked > through > the logic to make sure that there is one close() for every open() and > also checked the result of both. It turns out that the ODBC driver > that > I am using for Netezza database is opening the odbc.ini file 7 > times for > every connect to the database and is not closing the file. I wrote a > simple program to loop through and connect and disconnect from the > database and watched my PID using lsof and learn that each connection > added 7 file handles for odbc.ini file. It continued until it reached > the threshold of 256 file handles. I wanted to look through the > code to > the ODBC driver, but because it is compiled and was given to us by the > vendor, we have opened a ticket with them. > > Thanks for all your help. Have a nice weekend. > > Peter > > -----Original Message----- > From: sanfrancisco-pm-bounces > +peter.loo=source.wolterskluwer.com at pm.org > [mailto:sanfrancisco-pm-bounces > +peter.loo=source.wolterskluwer.com at pm.or > g] On Behalf Of Steve Fink > Sent: Thursday, June 21, 2007 9:46 PM > To: San Francisco Perl Mongers User Group > Subject: Re: [sf-perl] Bad file number > > On 6/21/07, Quinn Weaver wrote: >> On Thu, Jun 21, 2007 at 02:30:40PM -0700, Loo, Peter # PHX wrote: >>> I have checked the logic and it appears that there is a >>> corresponding close() for every open(). I don't know why Perl is >>> warning me with this error. >> >> Just "checking the logic" by looking at your code doesn't cut it. >> You need to test empirically whether your code is doing what you >> think > it is. >> >> Try putting warn "closed file MYFILE successfully" after your close >> statements... just to verify that what you think is happening is >> actually happening. >> >> Make a habit of testing your assumptions this way. It is the royal >> road to figuring out bugs. Debugging is a matter of practice, not >> theory-- because if the code were working the way that you think in >> theory it should be, you wouldn't have a bug! > > Good general advice, but I'm not sure how well it applies in this > situation. How many ways can close() fail in such a way that the file > descriptor is not closed? If it did, what would the user be able to do > about it? (There are many ways for close() to fail, as many as > there are > ways that write() can fail, but close() should still close the > fd.) > > There *is* actually one way, if close() returned EINTR, but I doubt > that's what is happening here. I'm guessing the logic isn't quite > right. > Checking the result of close() may indeed point out valuable clues, > though. (eg if it is returning EINVAL, perhaps you're not closing what > you think.) _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > > > This E-mail message is for the sole use of the intended recipient > (s) and > may contain confidential and privileged information. Any unauthorized > review, use, disclosure or distribution is prohibited. If you are not > the intended recipient, please contact the sender by reply E-mail, and > destroy all copies of the original message. > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm --------------------------------------------------------------------- Michael Friedman HighWire Press Phone: 650-725-1974 Stanford University FAX: 270-721-8034 --------------------------------------------------------------------- From doom at kzsu.stanford.edu Fri Jun 22 11:31:06 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Fri, 22 Jun 2007 11:31:06 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <20070622144616.GA58251@fu.funkspiel.org> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> <20070622005529.GA50228@fu.funkspiel.org> <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> <20070622144616.GA58251@fu.funkspiel.org> Message-ID: <200706221831.l5MIV6SE002993@kzsu.stanford.edu> Quinn Weaver wrote: > Steve Fink wrote: > > Quinn Weaver wrote: > > > Loo, Peter # PHX wrote: > > > > I have checked the logic and it appears that there is a > > > > corresponding close() for every open(). I don't know why Perl is > > > > warning me with this error. > > > > > > Just "checking the logic" by looking at your code doesn't cut it. > > > You need to test empirically whether your code is doing what you think it is. > > > > > > Try putting warn "closed file MYFILE successfully" after your close > > > statements... just to verify that what you think is happening is > > > actually happening. > > > > > > Make a habit of testing your assumptions this way. It is the royal > > > road to figuring out bugs. Debugging is a matter of practice, not theory-- > > > because if the code were working the way that you think in theory > > > it should be, you wouldn't have a bug! > > > > Good general advice, but I'm not sure how well it applies in this > > situation. How many ways can close() fail > > Actually, I agree. I think that placing warn statements after close > (warn "just closed file $MY_PATH") will be more useful than checking > the return code--because, as you pointed out, the most likely problem > is that the close code is just failing to get called, due to bad logic. Yes, most likely there's some hidden recursion in there again. And what I would do is trace it around in the debugger (if at all possible) or just put in tracer debugging statements. For example, you could try inserting lines like these at the beginning of each sub: my $sub_name = ( caller(0) )[3]; print STDERR "$sub_name called.\n"; # or "warn/carp", if you prefer. Another thing that might be useful is to use Carp qw( carp cluck croak confess); You can use "cluck" to get your code to spit out stack backtraces. And if you run your code like this: perl -MCarp=verbose script.pl you'll automatically get stack backtraces on your "carp"s and "croak"s. But as for the question "How many ways can close() fail"? That beats me, I've never looked into it. What happens if you close a file that's been deleted by another process? Or if it was a symlink that's been redefined in the meantime? Or if it's on a partition that got filled up since it was opened? Of if it's been flocked? Or if it's ownership/permissions has changed? Conway, in his "Perl Best Practices" says: "Never open, close, or print to a file without checking the outcome." And I presume he's included "close" in the list for a reason. He also (later, in "Builtin Failures", ch 13) recommends the trick: use Fatal qw( open close ); So that you don't have to remember to "or croak" all over the place. (I play around with this trick off and on and I would tentatively recommend it: I haven't noticed any problems with it, but Conway remarks that Fatal.pm works by "the use of dark and terrible magics", and coming from *him*, that's really scary.) From doom at kzsu.stanford.edu Fri Jun 22 11:36:37 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Fri, 22 Jun 2007 11:36:37 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <200706221831.l5MIV6SE002993@kzsu.stanford.edu> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> <20070622005529.GA50228@fu.funkspiel.org> <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> <20070622144616.GA58251@fu.funkspiel.org> <200706221831.l5MIV6SE002993@kzsu.stanford.edu> Message-ID: <200706221836.l5MIabgc003117@kzsu.stanford.edu> Joe Brenner wrote: > But as for the question "How many ways can close() fail"? > That beats me, I've never looked into it. What happens if you close > a file that's been deleted by another process? Or if it was a symlink > that's been redefined in the meantime? Or if it's on a partition that > got filled up since it was opened? Of if it's been flocked? > Or if it's ownership/permissions has changed? > > Conway, in his "Perl Best Practices" says: > > "Never open, close, or print to a file without checking the outcome." > > And I presume he's included "close" in the list for a reason. > > He also (later, in "Builtin Failures", ch 13) recommends the trick: > > use Fatal qw( open close ); > > So that you don't have to remember to "or croak" all over the place. Oh, and just to save Randal some trouble: http://www.stonehenge.com/merlyn/PerlJournal/col12.html From Melissa_Finder at symantec.com Fri Jun 22 11:35:46 2007 From: Melissa_Finder at symantec.com (Melissa Finder) Date: Fri, 22 Jun 2007 11:35:46 -0700 Subject: [sf-perl] Perl Developer Opportunities with Symantec in San Francisco Message-ID: <1D219FE5EE4047459C3C67DB823B749364A1DB@TUS1XCHCLUPIN12.enterprise.veritas.com> Hello! I am the internal Recruiter here at Symantec in San Francisco. Our Enterprise Messaging team in S.F. has new opportunities in several areas including Perl development. If you would like more information on what we are doing please send me an e-mail or give me a call. You can also send me a resume. Thanks and best regards, Melissa Finder Senior Technical Recruiter Global Talent Acquisition Office) 415-738-2665 Mobile) 415-710-2013 Melissa_Finder at Symantec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070622/6e70b800/attachment.html From merlyn at stonehenge.com Fri Jun 22 13:24:43 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Fri, 22 Jun 2007 13:24:43 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <200706221836.l5MIabgc003117@kzsu.stanford.edu> (Joe Brenner's message of "Fri, 22 Jun 2007 11:36:37 -0700") References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> <20070622005529.GA50228@fu.funkspiel.org> <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> <20070622144616.GA58251@fu.funkspiel.org> <200706221831.l5MIV6SE002993@kzsu.stanford.edu> <200706221836.l5MIabgc003117@kzsu.stanford.edu> Message-ID: <86ejk391pw.fsf@blue.stonehenge.com> >>>>> "Joe" == Joe Brenner writes: Joe> Oh, and just to save Randal some trouble: Joe> http://www.stonehenge.com/merlyn/PerlJournal/col12.html But "trouble" is my middle name! And it sure looked weird on the birth certificate! -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From matt at cloudfactory.org Fri Jun 22 13:49:23 2007 From: matt at cloudfactory.org (Matthew Lanier) Date: Fri, 22 Jun 2007 13:49:23 -0700 (PDT) Subject: [sf-perl] [job] Re: Perl Developer Opportunities with Symantec in San Francisco In-Reply-To: <1D219FE5EE4047459C3C67DB823B749364A1DB@TUS1XCHCLUPIN12.enterprise.veritas.com> References: <1D219FE5EE4047459C3C67DB823B749364A1DB@TUS1XCHCLUPIN12.enterprise.veritas.com> Message-ID: Hello Melissa- the sfpug generally permits job postings when the string [job] is contained within the subject line so that it may be filtered out by those that don'e care. thanks- m@ On Fri, 22 Jun 2007, Melissa Finder wrote: > Hello! > > I am the internal Recruiter here at Symantec in San Francisco. > Our Enterprise Messaging team in S.F. has new opportunities in several > areas > including Perl development. > If you would like more information on what we are doing please send me > an e-mail or give me a call. > You can also send me a resume. > > Thanks and best regards, > > > Melissa Finder > Senior Technical Recruiter > Global Talent Acquisition > Office) 415-738-2665 > Mobile) 415-710-2013 > Melissa_Finder at Symantec.com > > -- Matthew D. P. K. Strelchun-Lanier matt at cloudfactory.org http://www.bearlywornpacifica.com From sphink at gmail.com Fri Jun 22 14:50:58 2007 From: sphink at gmail.com (Steve Fink) Date: Fri, 22 Jun 2007 14:50:58 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <200706221831.l5MIV6SE002993@kzsu.stanford.edu> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> <20070622005529.GA50228@fu.funkspiel.org> <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> <20070622144616.GA58251@fu.funkspiel.org> <200706221831.l5MIV6SE002993@kzsu.stanford.edu> Message-ID: <7d7f2e8c0706221450x1f244a33hd4dc182238291017@mail.gmail.com> On 6/22/07, Joe Brenner wrote: > But as for the question "How many ways can close() fail"? > That beats me, I've never looked into it. What happens if you close > a file that's been deleted by another process? Or if it was a symlink > that's been redefined in the meantime? Or if it's on a partition that > got filled up since it was opened? Of if it's been flocked? > Or if it's ownership/permissions has changed? That wasn't the question. There are many ways for close() to fail. There are very few ways that close() can fail and leave the file descriptor still open. And for the specific problem at hand, that's all that matters. Again, I'm not going to argue with checking the return value of close. It just won't happen to fix the problem in question. Personally, I check the return value of close() most of the time, but that's probably because I usually don't bother to close things explicitly. :-) I believe in doing only the amount of error checking appropriate for the application at hand. And in never trusting an application not to disappear silently at any time without a chance to clean up. A lot of people overuse kill -9. So checking for every conceivable error is great, as long as you're not fooling yourself into thinking you can reliably do something about it. Your program could disappear before it reaches your error handling code anyway. That said, I have a lot of "or die" statements in my code, because I hate programs that just "don't work" without giving any hints as to why. As long as something vaguely nearby the true cause of the problem prints out a complaint, I'm happy. I still refuse to check for errors on every print() call, though. (And by the way, most of the reasons you list for close() failing wouldn't actually cause it to fail. Not on a Unix-like platform, at least. You're mixing up closing a file descriptor with "closing a file" or "closing a directory entry" or something.) From doom at kzsu.stanford.edu Sat Jun 23 16:01:00 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Sat, 23 Jun 2007 16:01:00 -0700 Subject: [sf-perl] Bad file number In-Reply-To: <7d7f2e8c0706221450x1f244a33hd4dc182238291017@mail.gmail.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03963237@phxmail02.phx.ndchealth.com> <20070622005529.GA50228@fu.funkspiel.org> <7d7f2e8c0706212145s7a311ac2s656d1faaffe15106@mail.gmail.com> <20070622144616.GA58251@fu.funkspiel.org> <200706221831.l5MIV6SE002993@kzsu.stanford.edu> <7d7f2e8c0706221450x1f244a33hd4dc182238291017@mail.gmail.com> Message-ID: <200706232301.l5NN10Og022835@kzsu.stanford.edu> Steve Fink wrote: > (And by the way, most of the reasons you list for close() failing > wouldn't actually cause it to fail. Not on a Unix-like platform, at > least. You're mixing up closing a file descriptor with "closing a > file" or "closing a directory entry" or something.) Yes, it does seem that in the following case (where the file is deleted in the middle of writing to it) there's no failure on close: my $file = "/mnt/floppy/testy.txt"; my ($fh, $count, $dot_count); open $fh, ">", $file or die "couldn't open $file: $!"; for my $count (0 .. 2000) { print {$fh} "$count\n"; if ($count == 1000) { system("rm $file"); } }; close( $fh ) or die "Couldn't CLOSE $file: $!"; Though on the other hand, this case (filling up the disk to the point where print fails, and then trying to do a close) definitely does fail: open $fh, ">", $file or die "couldn't open $file: $!"; $count = 0; STRAW: while( 1 ) { print {$fh} "$count\n" or last STRAW; $count++; }; close( $fh ) or die "Couldn't CLOSE $file: $!"; # Can't close(GLOB(0x504160)): No space left on device at (eval 4) line 3 main::__ANON__('GLOB(0x504160)') called at /home/doom/bin/testes-fill_er_up line 56 (Note: on a linux box, using a floppy disk formated with ext2.) From Jeff.Thalhammer at barclaysglobal.com Mon Jun 25 09:39:37 2007 From: Jeff.Thalhammer at barclaysglobal.com (Thalhammer, Jeffrey BGI SF) Date: Mon, 25 Jun 2007 09:39:37 -0700 Subject: [sf-perl] June 26 - 7:00 p.m. (NOT 8:00) - Fred Moyer on theBig Ball of Mud In-Reply-To: <20070621041703.GA41115@fu.funkspiel.org> References: <20070608060443.GA11259@fu.funkspiel.org> <20070621041703.GA41115@fu.funkspiel.org> Message-ID: <3A2096A63456DC469D46178CA9F8309F028D3807@calnte2k035.insidelive.net> Due to construction on the lobby at 45 Fremont, everyone must enter from the East (Beale Street) side of the building. Just follow the signs. Sorry for the inconvenience. -Jeff -----Original Message----- From: sanfrancisco-pm-bounces+jeff.thalhammer=barclaysglobal.com at pm.org [mailto:sanfrancisco-pm-bounces+jeff.thalhammer=barclaysglobal.com at pm.or g] On Behalf Of Quinn Weaver Sent: Wednesday, June 20, 2007 9:17 PM To: sanfrancisco-pm at pm.org Subject: Re: [sf-perl] June 26 - 7:00 p.m. (NOT 8:00) - Fred Moyer on theBig Ball of Mud Hi, everyone, This is a reminder that next Tuesday we're meeting ******************* * * * at 7:00 p.m. ! * * * ******************* for Fred's talk. RSVP to Jeff.Thalhammer at barclaysglobal.com, so he can order the right amount of Thai food. :) Further details at http://sf.pm.org/weblog/archives/00000045.html. On Thu, Jun 07, 2007 at 11:04:43PM -0700, Quinn Weaver wrote: > *********************** N O T E *********************** > > This meeting starts at 7:00 p.m., NOT 8:00. > > *********************** N O T E *********************** > > Ahem. That said, I'm pleased to announce our next talk: > > June 26, 2007: > Fred Moyer on the Big Ball of Mud > > Fred Moyer (http://www.redhotpenguin.com/) will discuss techniques for > handling the Big Ball of Mud: that haphazardly grown, ill-documented, > fragile, and messy codebase that we've all had to deal with. His talk > focuses on how to test and clean up BBOMs, paying off technical debt > so you can add features again without fear of the code breaking. > > I had a chance to see this talk last month, and I was very impressed. > Fred does a great job of explaining not just the technical, uh, > techniques for handling BBOMs, but also the trickier social > engineering you have to do in order to make it happen. > > This is a shortish talk, so Fred will also cover the highlights of the > Nordic Perl Workshop, where he recently spoke. > > BGI will sponsor Thai food from BKK. Thanks, guys! > > RSVP to Jeff.Thalhammer at barclaysglobal.com > > Location details at > http://sf.pm.org/weblog/archives/00000045.html > > -- > Quinn Weaver, independent contractor | President, San Francisco Perl Mongers > http://fairpath.com/quinn/resume/ | http://sf.pm.org/ > 510-520-5217 -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 _______________________________________________ SanFrancisco-pm mailing list SanFrancisco-pm at pm.org http://mail.pm.org/mailman/listinfo/sanfrancisco-pm -- This message and any attachments are confidential, proprietary, and may be privileged. If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BGI. Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed. From doom at kzsu.stanford.edu Mon Jun 25 23:22:46 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Mon, 25 Jun 2007 23:22:46 -0700 Subject: [sf-perl] Plat_Forms competition Message-ID: <200706260622.l5Q6MkmC066384@kzsu.stanford.edu> Everyone's heard about the results of the Plat_Forms competition, right? http://www.plat-forms.org/2007/results/ http://use.perl.org/articles/07/06/20/1621234.shtml I highly recommend the following exercise: can you pick out Jave, Php and Perl programmer's just by their appearence? http://alvar.a-blast.org/plat_forms/ From nheller at silcon.com Tue Jun 26 11:28:51 2007 From: nheller at silcon.com (nheller at silcon.com) Date: Tue, 26 Jun 2007 11:28:51 -0700 (PDT) Subject: [sf-perl] Plat_Forms competition In-Reply-To: <200706260622.l5Q6MkmC066384@kzsu.stanford.edu> References: <200706260622.l5Q6MkmC066384@kzsu.stanford.edu> Message-ID: <59436.208.253.246.249.1182882531.squirrel@webmail.silcon.com> None of the photos were of people from India. How can that be? > > Everyone's heard about the results of the Plat_Forms > competition, right? > > http://www.plat-forms.org/2007/results/ > http://use.perl.org/articles/07/06/20/1621234.shtml > > I highly recommend the following exercise: can you pick out Jave, > Php and Perl programmer's just by their appearence? > > http://alvar.a-blast.org/plat_forms/ > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From quinn at fairpath.com Tue Jun 26 14:05:27 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Tue, 26 Jun 2007 14:05:27 -0700 Subject: [sf-perl] June 26 - 7:00 p.m. (NOT 8:00) - Fred Moyer on the Big Ball of Mud In-Reply-To: <20070621041703.GA41115@fu.funkspiel.org> References: <20070608060443.GA11259@fu.funkspiel.org> <20070621041703.GA41115@fu.funkspiel.org> Message-ID: <20070626210527.GA99923@fu.funkspiel.org> It's not too late to RSVP if you're coming to tonight's meeting. Please mail Jeff.Thalhammer at barclaysglobal.com. Our Thai chefs thank you. :) Also, remember the meeting is at 777777777777777777 7777 7777 7777 7777 7777 7777 7777 7777 7777 pm--NOT 8:00 p.m.) After all the shouting I've done, anyone who comes in late is going to look seriously silly. ;) Full meeting details at http://sf.pm.org/weblog/archives/00000045.html . -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From duane.obrien at gmail.com Tue Jun 26 14:09:10 2007 From: duane.obrien at gmail.com (Duane Obrien) Date: Tue, 26 Jun 2007 14:09:10 -0700 Subject: [sf-perl] June 26 - 7:00 p.m. (NOT 8:00) - Fred Moyer on the Big Ball of Mud In-Reply-To: <20070626210527.GA99923@fu.funkspiel.org> References: <20070608060443.GA11259@fu.funkspiel.org> <20070621041703.GA41115@fu.funkspiel.org> <20070626210527.GA99923@fu.funkspiel.org> Message-ID: The meetins is at T:00 pm? MY WATCH DOESN'T GO TO T! On 6/26/07, Quinn Weaver wrote: > It's not too late to RSVP if you're coming to tonight's meeting. Please > mail Jeff.Thalhammer at barclaysglobal.com. Our Thai chefs thank you. :) > > Also, remember the meeting is at > > 777777777777777777 > 7777 > 7777 > 7777 > 7777 > 7777 > 7777 > 7777 > 7777 > 7777 > > pm--NOT 8:00 p.m.) > > After all the shouting I've done, anyone who comes in late is going to > look seriously silly. ;) > > Full meeting details at http://sf.pm.org/weblog/archives/00000045.html . > > -- > Quinn Weaver, independent contractor | President, San Francisco Perl Mongers > http://fairpath.com/quinn/resume/ | http://sf.pm.org/ > 510-520-5217 > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > -- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Don't ever tell anybody anything. If you do, you start missing everybody. From quinn at fairpath.com Tue Jun 26 14:11:02 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Tue, 26 Jun 2007 14:11:02 -0700 Subject: [sf-perl] Plat_Forms competition In-Reply-To: <59436.208.253.246.249.1182882531.squirrel@webmail.silcon.com> References: <200706260622.l5Q6MkmC066384@kzsu.stanford.edu> <59436.208.253.246.249.1182882531.squirrel@webmail.silcon.com> Message-ID: <20070626211102.GA763@fu.funkspiel.org> On Tue, Jun 26, 2007 at 11:28:51AM -0700, nheller at silcon.com wrote: > > None of the photos were of people from India. How about the fact that none of the photos were of women?! Sad, but representative. > How can that be? Well, the contest took place in Berlin. Dunno if this makes a difference. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From bh1 at light42.com Tue Jun 26 23:39:56 2007 From: bh1 at light42.com (Brian Hamlin) Date: Tue, 26 Jun 2007 23:39:56 -0700 Subject: [sf-perl] ISDE5 Wiki - Digital Earth Message-ID: <37D26700-2479-11DC-AB7D-000A277A733C@light42.com> Hi All- as mentioned in the meeting tonight, here is the link to the 5th International Symposium on Digital Earth, follow-up Wiki http://isde5.pbwiki.com with a little hunting around, you may soon get the gist of the event. Over 100 technical presenters! Session audio will be posted in the coming weeks. all for now -Brian From rdm at cfcl.com Wed Jun 27 08:35:45 2007 From: rdm at cfcl.com (Rich Morin) Date: Wed, 27 Jun 2007 08:35:45 -0700 Subject: [sf-perl] BASS Meeting (SF), Wed. June 27 (tonight!) Message-ID: The Beer and Scripting SIG rides again! If you'd like to eat good Italian food, chat with other local scripters, and possibly take a look at laptop-demoed scripting hacks, this is the place to do it! For your convenience, here are the critical details: Date: Wednesday, June 27, 2007 (4th. Wed.) Time: 8:00 pm Place: Pasquales Pizzeria 701 Irving St. (At 8th. Ave.) San Francisco, California, USA 415/661-2140 See the BASS web page for more information: http://cfcl.com/rdm/bass/ -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From josh at agliodbs.com Wed Jun 27 09:36:57 2007 From: josh at agliodbs.com (Josh Berkus) Date: Wed, 27 Jun 2007 09:36:57 -0700 Subject: [sf-perl] BASS Meeting (SF), Wed. June 27 (tonight!) In-Reply-To: References: Message-ID: <200706270936.57819.josh@agliodbs.com> Rich, > Date: Wednesday, June 27, 2007 (4th. Wed.) > Time: 8:00 pm For the last couple of times BASS has been the day after SFPerl. I don't know about others, but it's pretty hard for me to attend geek meetings two nights in a row (my wife gets annoyed). Has this just been a coincidence this spring, or should we adjust the schedule? -- Josh Berkus PostgreSQL @ Sun San Francisco From rdm at cfcl.com Wed Jun 27 10:06:37 2007 From: rdm at cfcl.com (Rich Morin) Date: Wed, 27 Jun 2007 10:06:37 -0700 Subject: [sf-perl] BASS Meeting (SF), Wed. June 27 (tonight!) In-Reply-To: <200706270936.57819.josh@agliodbs.com> References: <200706270936.57819.josh@agliodbs.com> Message-ID: At 9:36 AM -0700 6/27/07, Josh Berkus wrote: > For the last couple of times BASS has been the day after > SFPerl. I don't know about others, but it's pretty hard > for me to attend geek meetings two nights in a row (my > wife gets annoyed). Has this just been a coincidence this > spring, or should we adjust the schedule? Not exactly a coincidence. BASS is on the 4th Wednesday; SFPUG is on the 4th Tuesday. So, they will line up rather frequently. Problem is, there aren't a lot of evenings that DON'T follow, precede, or sit on top of another event. Suggestions are welcome, however. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From bh1 at light42.com Wed Jun 27 16:02:45 2007 From: bh1 at light42.com (Brian Hamlin) Date: Wed, 27 Jun 2007 16:02:45 -0700 Subject: [sf-perl] Freebase Alpha Message-ID: <8447680C-2502-11DC-AB7D-000A277A733C@light42.com> I am on the developer list for Freebase.com. If you are seriously interested in their "deep" creative commons data project, please let me know and I have a limited number of invitations for a developer account there. -Brian From bh1 at light42.com Wed Jun 27 16:04:08 2007 From: bh1 at light42.com (Brian Hamlin) Date: Wed, 27 Jun 2007 16:04:08 -0700 Subject: [sf-perl] Code Question Message-ID: Hello Perl Veterans I have a question about DBI, Files and some XML. Useful References appreciated. I wrote a functional DBI program that just reads data on request, invoked as a cgi, for light weight use. That works fine. The data is returned as an XML structure that I write out manually using print. Now, I want to do something more elaborate- * read data from an external source (thats working, its a Salesforce SOAP query) comes back as XML, I use Soap::Lite * Geocode the addresses in the table, add the results to the XML structure thats working already in an individual script, LWP get * take a list of numbers in one field and make a separate "many to many" table out of them * take the rest of the data and make a table out of it meaning, write SQL statements manually I suppose. I have that working in individual scripts a lot of things I have looked at look like more work to get started that it is to do this by hand I have an idiom someone showed me, which works, using a local array with Field Names as a template to write the SQL statements * EXPORT the previous data via DBI and write it to a time-stamped text file eg MerchTBl_26Jun07.sql/xml/whatever * REPLACE the contents of the table completely with the fresh data the client is not going to pay for a custom system, I am only so good at this so far Each step is doable, especially since I have already solved many of the unusual cases manually once. It is really the rote, ordinary things that are new to me, and of course, general good practices, etc. I dont have the DBI cookbook Code samples etc apropos to this are appreciated. I do read newsgroups and books etc, but since Perl has been around for a while, the volume of such things is very large, and for someone getting their footing its hard to wade through. Hence the question to the list. thanks in advance -Brian From david at fetter.org Wed Jun 27 16:52:14 2007 From: david at fetter.org (David Fetter) Date: Wed, 27 Jun 2007 16:52:14 -0700 Subject: [sf-perl] Code Question In-Reply-To: References: Message-ID: <20070627235213.GA30240@fetter.org> On Wed, Jun 27, 2007 at 04:04:08PM -0700, Brian Hamlin wrote: > Hello Perl Veterans > > I have a question about DBI, Files and some XML. Useful References > appreciated. Brian, I don't mean offense here, but it appears from your description that you are trying to use an SQL database as a dumb data store, reinventing many wheels along the way. DBMSs are subtle and quick to anger, and when they get upset, they take their vengeance, both sooner and later. Rather than picking a fight with your software, consider rethinking this approach and instead using the features of one or other DBMS so it does a lot of the work for you. You can probably figure out which DBMS I'll suggest ;) A few URLs to ponder on tree structures in databases: http://www.sai.msu.su/~megera/postgres/gist/ltree/ http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/tablefunc/ http://threebit.net/tutorials/nestedset/tutorial1.html http://www.sitepoint.com/print/hierarchical-data-database http://www.fuzzy.cz/databaze/index-en.php http://www.grzm.com/fornow/archives/2004/07/10/static_hierarchies http://mrnaz.com/static/articles/trees_in_sql_tutorial/index.php http://www.mrnaz.com/static/articles/trees_in_sql_tutorial/ On XML in particular: http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/xml2/ http://developer.postgresql.org/index.php/XML_Support http://gborg.postgresql.org/project/xpsql/projdisplay.php History and features which will be in the upcoming PostgreSQL 8.3: http://www.pgcon.org/2007/schedule/events/14.en.html Cheers, David. > I wrote a functional DBI program that just reads data on request, > invoked as a cgi, for light weight use. That works fine. The data is > returned as an XML structure that I write out manually using print. > > Now, I want to do something more elaborate- > > * read data from an external source (thats working, its a Salesforce > SOAP query) > comes back as XML, I use Soap::Lite > * Geocode the addresses in the table, add the results to the XML > structure > thats working already in an individual script, LWP get > * take a list of numbers in one field and make a separate "many to > many" table out of them > * take the rest of the data and make a table out of it > meaning, write SQL statements manually I suppose. I have that > working in individual scripts > a lot of things I have looked at look like more work to get started > that it is to do this by hand > I have an idiom someone showed me, which works, using a local array > with Field Names as a template > to write the SQL statements > * EXPORT the previous data via DBI and write it to a time-stamped text > file > eg MerchTBl_26Jun07.sql/xml/whatever > * REPLACE the contents of the table completely with the fresh data > the client is not going to pay for a custom system, I am only so > good at this so far > > Each step is doable, especially since I have already solved many of the > unusual cases > manually once. It is really the rote, ordinary things that are new to > me, and of course, general > good practices, etc. I dont have the DBI cookbook > > Code samples etc apropos to this are appreciated. I do read newsgroups > and books etc, but since > Perl has been around for a while, the volume of such things is very > large, and for someone getting > their footing its hard to wade through. Hence the question to the list. > > thanks in advance > -Brian > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! Consider donating to PostgreSQL: http://www.postgresql.org/about/donate From bh1 at light42.com Wed Jun 27 16:55:51 2007 From: bh1 at light42.com (Brian Hamlin) Date: Wed, 27 Jun 2007 16:55:51 -0700 Subject: [sf-perl] Code Question In-Reply-To: <20070627235213.GA30240@fetter.org> References: <20070627235213.GA30240@fetter.org> Message-ID: On Jun 27, 2007, at 4:52 PM, David Fetter wrote: > On Wed, Jun 27, 2007 at 04:04:08PM -0700, Brian Hamlin wrote: >> Hello Perl Veterans >> >> I have a question about DBI, Files and some XML. Useful References >> appreciated. > > Brian, > > I don't mean offense here, but it appears from your description that > you are trying to use an SQL database as a dumb data store, > reinventing many wheels along the way. !!! > > DBMSs are subtle and quick to anger, and when they get upset, they > take their vengeance, both sooner and later. Rather than picking a > fight with your software, consider rethinking this approach and > instead using the features of one or other DBMS so it does a lot of > the work for you. > > You can probably figure out which DBMS I'll suggest ;) > I see where this is going! but while reading, I though you were going to tell me that I didn't actually need a DBMS for this level of problem at all. So, yes, I am almost completely unburdened with experience here ;-) will check these out.. > A few URLs to ponder on tree structures in databases: > > http://www.sai.msu.su/~megera/postgres/gist/ltree/ > http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/tablefunc/ > http://threebit.net/tutorials/nestedset/tutorial1.html > http://www.sitepoint.com/print/hierarchical-data-database > http://www.fuzzy.cz/databaze/index-en.php > http://www.grzm.com/fornow/archives/2004/07/10/static_hierarchies > http://mrnaz.com/static/articles/trees_in_sql_tutorial/index.php > http://www.mrnaz.com/static/articles/trees_in_sql_tutorial/ > > On XML in particular: > > http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/xml2/ > http://developer.postgresql.org/index.php/XML_Support > http://gborg.postgresql.org/project/xpsql/projdisplay.php > > History and features which will be in the upcoming PostgreSQL 8.3: > > http://www.pgcon.org/2007/schedule/events/14.en.html > > Cheers, > David. > >> I wrote a functional DBI program that just reads data on request, >> invoked as a cgi, for light weight use. That works fine. The data is >> returned as an XML structure that I write out manually using print. >> >> Now, I want to do something more elaborate- >> >> * read data from an external source (thats working, its a Salesforce >> SOAP query) >> comes back as XML, I use Soap::Lite >> * Geocode the addresses in the table, add the results to the XML >> structure >> thats working already in an individual script, LWP get >> * take a list of numbers in one field and make a separate "many to >> many" table out of them >> * take the rest of the data and make a table out of it >> meaning, write SQL statements manually I suppose. I have that >> working in individual scripts >> a lot of things I have looked at look like more work to get >> started >> that it is to do this by hand >> I have an idiom someone showed me, which works, using a local >> array >> with Field Names as a template >> to write the SQL statements >> * EXPORT the previous data via DBI and write it to a time-stamped text >> file >> eg MerchTBl_26Jun07.sql/xml/whatever >> * REPLACE the contents of the table completely with the fresh data >> the client is not going to pay for a custom system, I am only so >> good at this so far >> >> Each step is doable, especially since I have already solved many of >> the >> unusual cases >> manually once. It is really the rote, ordinary things that are new to >> me, and of course, general >> good practices, etc. I dont have the DBI cookbook >> >> Code samples etc apropos to this are appreciated. I do read newsgroups >> and books etc, but since >> Perl has been around for a while, the volume of such things is very >> large, and for someone getting >> their footing its hard to wade through. Hence the question to the >> list. >> >> thanks in advance >> -Brian >> >> _______________________________________________ >> SanFrancisco-pm mailing list >> SanFrancisco-pm at pm.org >> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > > -- > David Fetter http://fetter.org/ > phone: +1 415 235 3778 AIM: dfetter666 > Skype: davidfetter > > Remember to vote! > Consider donating to PostgreSQL: http://www.postgresql.org/about/donate > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm From quinn at fairpath.com Thu Jun 28 11:40:29 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 28 Jun 2007 11:40:29 -0700 Subject: [sf-perl] BASS Meeting (SF), Wed. June 27 (tonight!) In-Reply-To: <200706270936.57819.josh@agliodbs.com> References: <200706270936.57819.josh@agliodbs.com> Message-ID: <20070628184029.GA20243@fu.funkspiel.org> On Wed, Jun 27, 2007 at 09:36:57AM -0700, Josh Berkus wrote: > Rich, > > > Date: Wednesday, June 27, 2007 (4th. Wed.) > > Time: 8:00 pm > > For the last couple of times BASS has been the day after SFPerl. I don't know > about others, but it's pretty hard for me to attend geek meetings two nights > in a row (my wife gets annoyed). Has this just been a coincidence this > spring, or should we adjust the schedule? Hi, Josh, Our new policy is to hold all SF.pm social meetings at BASS. It just makes sense to pool our brains (mmmmmm, pooled brains). So there will be a Perl Mongers meeting the day after BASS only on months when we have a speaker. I know this isn't ideal, but I hope it helps you make it some of the time. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 From fred at redhotpenguin.com Thu Jun 28 11:54:31 2007 From: fred at redhotpenguin.com (fred at redhotpenguin.com) Date: Thu, 28 Jun 2007 11:54:31 -0700 (PDT) Subject: [sf-perl] Ball of mud talk link Message-ID: <51446.69.236.69.79.1183056871.squirrel@www.redhotpenguin.com> Greetings, Thanks to everyone who made it out to BGI for the talk on Tuesday. Here's the link to the talk slides: http://www.redhotpenguin.com/talks/npw2007/ball_of_mud.html From pm.org at daveola.com Sat Jun 30 20:03:33 2007 From: pm.org at daveola.com (David Ljung Madison) Date: Sat, 30 Jun 2007 20:03:33 -0700 Subject: [sf-perl] Calling perl from C and back again. Message-ID: I'm writing C code that calls perl (using perl_construct and it's ilk), and I'd like to call functions back in the C code. For example, in pseudo-code: ================================================== ------ C Code ------ static int some_C_global; void some_C_routine() { some_C_global++; } int main() { some_C_global = 41; PerlInterpreter *my_perl = perl_alloc(); .. // Setup perl and call_pv: call_pv("some_perl_function", G_DISCARD); .. printf("some_C_global = %d\n",some_C_global); // Is hopefully 42! } --------- Perl Code --------- sub some_perl_function { ... # Does some perl stuff some_C_routine() # Call back into the C code. } ================================================== I tried making a .xs for some_C_routine (using Package main) and including that into the C code, but I still get: Undefined subroutine &main::some_C_routine called at script.pl line 11. Any ideas? Or perhaps a simple example?? Thanks! Dave --------------------------------------------------------------------------- Dave Ljung Madison http://GetDave.com/ 415.341.5555 --- I am totally into Perl now. I love it. It rules with an iron fist. --