From cba at groundworkopensource.com Wed May 2 15:13:49 2007 From: cba at groundworkopensource.com (Chris Barton Anderson) Date: Wed, 02 May 2007 15:13:49 -0700 Subject: [sf-perl] You're Invited: Monitoring SIG, Weds May 9 7PM Message-ID: <1178136800.7510.3.camel@peterX20> (Hi: You're invited to the BayLISA Monitoring SIG, Weds May 9, 7PM. See the meeting announcement below: feel free to post it and/or forward it along to anyone else who might be interested. See you there!) ================================================= May BayLISA Monitoring SIG: Mini- to Mega-Monitoring Between the two presenters at the next Monitoring SIG we'll span the breadth and complexity of monitoring sites: 1) Bob will outline the modest needs of his "two servers at the colo" configuration: he doesn't have any monitoring in place yet, so we'll brainstorm about what he should deploy and how. 2) Charity from Linden Labs will discuss the current challenges and future plans for the three-and-a-half sys admins managing and monitoring the 4000+ servers(!) that sustain Second Life. We'll use these two examples to frame how to approach setting up and maintaining a monitoring setup. Newbies: bring your thorniest (or most basic) monitoring questions and issues. Not-So-Newbies: come prepared to share your experiences re. successful deployment, knowledge of specific tools and techniques, etc. What: BayLISA Monitoring SIG VII: Mini- to Mega-Monitoring Who: Anyone interested in IT monitoring issues and tools (newbies particularly welcome!) When: Wednesday, May 9 2007, 7PM Where: GroundWork Open Source, 139 Townsend St., San Francisco 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 (vs. Mets, 12:35 start) and it should be over by the time the SIG starts. Cost: Free!! Pizza pizza pizza, drinks drinks drinks, and snacks snacks 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 Wed May 2 22:36:08 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Wed, 2 May 2007 22:36:08 -0700 Subject: [sf-perl] LinuxWorld booth Message-ID: <20070503053608.GB39448@fu.funkspiel.org> LinuxWorld is August 6 through 9 (Monday through Thursday) in Moscone Center. It's super-close to BART. George Wooley, the founder of Oakland.pm, is looking into getting a "local Perl Mongers" booth at LinuxWorld. He wants to know if SF.pm could cover booth duties for one day. I think this is a great idea. I can be there all day. To make this work, though, I would need one to two people with me at any given time. I'm amenable to doing shifts if we get enough people. If you're interested, please send me your availability--days and times. Respond to me; don't just hit reply, or your mail will go to the list. As I said, I'm all-in. So... any other booth babes out there? ;) -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From josh at agliodbs.com Thu May 3 09:38:26 2007 From: josh at agliodbs.com (Josh Berkus) Date: Thu, 3 May 2007 09:38:26 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <20070503053608.GB39448@fu.funkspiel.org> References: <20070503053608.GB39448@fu.funkspiel.org> Message-ID: <200705030938.26601.josh@agliodbs.com> Quinn, All: > LinuxWorld is August 6 through 9 (Monday through Thursday) in Moscone > Center. It's super-close to BART. > > George Wooley, the founder of Oakland.pm, is looking into getting a "local > Perl Mongers" booth at LinuxWorld. He wants to know if SF.pm could cover > booth duties for one day. Based on experience, you need at least 5 volunteers committed to the show. I believe that booth space at LWE-SF is undersold this year and that you can expect to get a booth if you can find the people. PostgreSQL has applied for a booth, and is 90% likely to get it since we've done booths for the last 3 shows. If for some reason Perlmongers does not get a booth, I'd be happy to propose sharing to the other SFPUG. If we have lots of volunteers, I know some of us will be doing double duty! Should we plan a joint SFPUGx2 party of some sort? -- Josh Berkus PostgreSQL @ Sun San Francisco From quinn at fairpath.com Thu May 3 09:52:48 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 3 May 2007 09:52:48 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <200705030938.26601.josh@agliodbs.com> References: <20070503053608.GB39448@fu.funkspiel.org> <200705030938.26601.josh@agliodbs.com> Message-ID: <20070503165247.GC46898@fu.funkspiel.org> On Thu, May 03, 2007 at 09:38:26AM -0700, Josh Berkus wrote: > Quinn, All: > > > LinuxWorld is August 6 through 9 (Monday through Thursday) in Moscone > > Center. It's super-close to BART. > > > > George Wooley, the founder of Oakland.pm, is looking into getting a "local > > Perl Mongers" booth at LinuxWorld. He wants to know if SF.pm could cover > > booth duties for one day. > > Based on experience, you need at least 5 volunteers committed to the show. I > believe that booth space at LWE-SF is undersold this year and that you can > expect to get a booth if you can find the people. Hmmn, good to know. I will try to get five. > PostgreSQL has applied for a booth, and is 90% likely to get it since we've > done booths for the last 3 shows. If for some reason Perlmongers does not > get a booth, I'd be happy to propose sharing to the other SFPUG. If we have > lots of volunteers, I know some of us will be doing double duty! > > Should we plan a joint SFPUGx2 party of some sort? Yes, that would be awesome. What's a good place near Moscone? -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From quinn at fairpath.com Thu May 3 10:07:29 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 3 May 2007 10:07:29 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <20070503053608.GB39448@fu.funkspiel.org> References: <20070503053608.GB39448@fu.funkspiel.org> Message-ID: <20070503170729.GA47031@fu.funkspiel.org> On Wed, May 02, 2007 at 10:36:08PM -0700, Quinn Weaver wrote: > LinuxWorld is August 6 through 9 (Monday through Thursday) in Moscone > Center. It's super-close to BART. > > George Wooley, the founder of Oakland.pm, is looking into getting a "local > Perl Mongers" booth at LinuxWorld. He wants to know if SF.pm could cover > booth duties for one day. > > I think this is a great idea. I can be there all day. To make this > work, though, I would need one to two people with me at any given time. I'm > amenable to doing shifts if we get enough people. Update: Josh Berkus says we need at least five people committed to make it work. He's done this a million times for PostgreSQL, so I'm inclined to trust him. So far we've got two, plus me. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From doom at kzsu.stanford.edu Thu May 3 13:03:00 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Thu, 03 May 2007 13:03:00 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <20070503165247.GC46898@fu.funkspiel.org> References: <20070503053608.GB39448@fu.funkspiel.org> <200705030938.26601.josh@agliodbs.com> <20070503165247.GC46898@fu.funkspiel.org> Message-ID: <200705032003.l43K30FS094082@kzsu.stanford.edu> Quinn Weaver wrote: > Josh Berkus wrote: > > Should we plan a joint SFPUGx2 party of some sort? > Yes, that would be awesome. What's a good place near Moscone? If you want a *good* place, there's the spin-off of the Samovar Tea House that's upstairs over Moscone, facing the fountains in Yerba Beuna Park. In practice, however, we're going to end up at the Burrito joint in the basement of the Merdeon, and I suppose we could do worse. From josh at agliodbs.com Thu May 3 13:14:05 2007 From: josh at agliodbs.com (Josh Berkus) Date: Thu, 3 May 2007 13:14:05 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <200705032003.l43K30FS094082@kzsu.stanford.edu> References: <20070503053608.GB39448@fu.funkspiel.org> <20070503165247.GC46898@fu.funkspiel.org> <200705032003.l43K30FS094082@kzsu.stanford.edu> Message-ID: <200705031314.06457.josh@agliodbs.com> Joe, > If you want a *good* place, there's the spin-off of the Samovar Tea > House that's upstairs over Moscone, facing the fountains in Yerba Beuna > Park. I was thinking at night. Samovar is lunch only, I think, and they don't serve booze. Bucca di Beppo is the obvious large-crowd standby. Or we can always get in cabs and head out to somewhere away from Moscone. -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco From quinn at fairpath.com Thu May 3 13:55:38 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 3 May 2007 13:55:38 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <200705031314.06457.josh@agliodbs.com> References: <20070503053608.GB39448@fu.funkspiel.org> <20070503165247.GC46898@fu.funkspiel.org> <200705032003.l43K30FS094082@kzsu.stanford.edu> <200705031314.06457.josh@agliodbs.com> Message-ID: <20070503205538.GB47654@fu.funkspiel.org> On Thu, May 03, 2007 at 01:14:05PM -0700, Josh Berkus wrote: > Joe, > > > If you want a *good* place, there's the spin-off of the Samovar Tea > > House that's upstairs over Moscone, facing the fountains in Yerba Beuna > > Park. > > I was thinking at night. Samovar is lunch only, I think, and they don't > serve booze. > > Bucca di Beppo is the obvious large-crowd standby. Or we can always get in > cabs and head out to somewhere away from Moscone. Yeah, we need both booze and food. And we'll lose people if we cab it. Given those constraints, I think we should stick with Bucca. Unless someone knows a better place that's still within walking distance? -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From rdm at cfcl.com Thu May 3 14:03:52 2007 From: rdm at cfcl.com (Rich Morin) Date: Thu, 3 May 2007 14:03:52 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <20070503205538.GB47654@fu.funkspiel.org> References: <20070503053608.GB39448@fu.funkspiel.org> <20070503165247.GC46898@fu.funkspiel.org> <200705032003.l43K30FS094082@kzsu.stanford.edu> <200705031314.06457.josh@agliodbs.com> <20070503205538.GB47654@fu.funkspiel.org> Message-ID: > Unless someone knows a better place that's still within > walking distance? Dunno if it's better, but Chevys is nearby and handles crowds well. -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 quinn at fairpath.com Thu May 3 14:23:12 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 3 May 2007 14:23:12 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: References: <20070503053608.GB39448@fu.funkspiel.org> <20070503165247.GC46898@fu.funkspiel.org> <200705032003.l43K30FS094082@kzsu.stanford.edu> <200705031314.06457.josh@agliodbs.com> <20070503205538.GB47654@fu.funkspiel.org> Message-ID: <20070503212312.GA47846@fu.funkspiel.org> On Thu, May 03, 2007 at 02:03:52PM -0700, Rich Morin wrote: > > Unless someone knows a better place that's still within > > walking distance? > > Dunno if it's better, but Chevys is nearby and handles > crowds well. Well, margaritas could be fun... How is it for noise? I've noticed some of these restaurants get so loud you have to shout to talk to the person next to you (which, of course, just exacerbates the problem...) -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From gj262 at yahoo.com Thu May 3 14:40:37 2007 From: gj262 at yahoo.com (Gavin Jefferies) Date: Thu, 3 May 2007 14:40:37 -0700 (PDT) Subject: [sf-perl] LinuxWorld booth Message-ID: <169244.44868.qm@web37106.mail.mud.yahoo.com> The Thirsty Bear is a good spot for that neighborhood. http://www.thirstybear.com/ Gavin ----- Original Message ---- From: Quinn Weaver To: San Francisco Perl Mongers User Group Sent: Thursday, May 3, 2007 2:23:12 PM Subject: Re: [sf-perl] LinuxWorld booth On Thu, May 03, 2007 at 02:03:52PM -0700, Rich Morin wrote: > > Unless someone knows a better place that's still within > > walking distance? > > Dunno if it's better, but Chevys is nearby and handles > crowds well. Well, margaritas could be fun... How is it for noise? I've noticed some of these restaurants get so loud you have to shout to talk to the person next to you (which, of course, just exacerbates the problem...) -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ _______________________________________________ SanFrancisco-pm mailing list SanFrancisco-pm at pm.org http://mail.pm.org/mailman/listinfo/sanfrancisco-pm From quinn at fairpath.com Thu May 3 15:26:28 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 3 May 2007 15:26:28 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <169244.44868.qm@web37106.mail.mud.yahoo.com> References: <169244.44868.qm@web37106.mail.mud.yahoo.com> Message-ID: <20070503222628.GA48002@fu.funkspiel.org> On Thu, May 03, 2007 at 02:40:37PM -0700, Gavin Jefferies wrote: > The Thirsty Bear is a good spot for that neighborhood. > http://www.thirstybear.com/ > Gavin Sorry, Thirsty Bear won't work for us. They have a pretty small food selection, especially for vegetarians. But thanks for the suggestion! :) I have little clue about that area, so suggestions are great. So far Chevy's looks best, as long as it can handle the noise. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From doom at kzsu.stanford.edu Thu May 3 15:36:27 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Thu, 03 May 2007 15:36:27 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <200705031314.06457.josh@agliodbs.com> References: <20070503053608.GB39448@fu.funkspiel.org> <20070503165247.GC46898@fu.funkspiel.org> <200705032003.l43K30FS094082@kzsu.stanford.edu> <200705031314.06457.josh@agliodbs.com> Message-ID: <200705032236.l43MaR6p096351@kzsu.stanford.edu> Josh Berkus wrote: > > If you want a *good* place, there's the spin-off of the Samovar Tea > > House that's upstairs over Moscone, facing the fountains in Yerba Beuna > > Park. > > I was thinking at night. Samovar is lunch only, I think, Not quite: Monday-Thursday: 11am-6pm Friday-Sunday: 11am-8pm > and they don't serve booze. But they serve tea! > Bucca di Beppo is the obvious large-crowd standby. And I would vote for it over Chevy's. Probably a little better on noise, for one thing. From david at fetter.org Thu May 3 16:31:48 2007 From: david at fetter.org (David Fetter) Date: Thu, 3 May 2007 16:31:48 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <20070503212312.GA47846@fu.funkspiel.org> References: <20070503053608.GB39448@fu.funkspiel.org> <20070503165247.GC46898@fu.funkspiel.org> <200705032003.l43K30FS094082@kzsu.stanford.edu> <200705031314.06457.josh@agliodbs.com> <20070503205538.GB47654@fu.funkspiel.org> <20070503212312.GA47846@fu.funkspiel.org> Message-ID: <20070503233148.GA30414@fetter.org> On Thu, May 03, 2007 at 02:23:12PM -0700, Quinn Weaver wrote: > On Thu, May 03, 2007 at 02:03:52PM -0700, Rich Morin wrote: > > > Unless someone knows a better place that's still within walking > > > distance? > > > > Dunno if it's better, but Chevys is nearby and handles crowds > > well. > > Well, margaritas could be fun... > > How is it for noise? I've noticed some of these restaurants get so > loud you have to shout to talk to the person next to you (which, of > course, just exacerbates the problem...) I'd go for Bucca over Chevys unless the objective is to get blitzed in a noisy environment. I'd also be happy to sponsor some of this, as collecting money for the check is a lot less than enjoyable at the end of the evening. Should we see about other sponsors? About an in-advance check policy? I hate to bring this up, but any gathering with over about six people will encourage what the game theory people call a "cheater strategy." Cheers, D -- 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 quinn at fairpath.com Thu May 3 20:24:15 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 3 May 2007 20:24:15 -0700 Subject: [sf-perl] LinuxWorld booth In-Reply-To: <20070503233148.GA30414@fetter.org> References: <20070503053608.GB39448@fu.funkspiel.org> <20070503165247.GC46898@fu.funkspiel.org> <200705032003.l43K30FS094082@kzsu.stanford.edu> <200705031314.06457.josh@agliodbs.com> <20070503205538.GB47654@fu.funkspiel.org> <20070503212312.GA47846@fu.funkspiel.org> <20070503233148.GA30414@fetter.org> Message-ID: <20070504032415.GA48824@fu.funkspiel.org> On Thu, May 03, 2007 at 04:31:48PM -0700, David Fetter wrote: > On Thu, May 03, 2007 at 02:23:12PM -0700, Quinn Weaver wrote: > > On Thu, May 03, 2007 at 02:03:52PM -0700, Rich Morin wrote: > > > > Unless someone knows a better place that's still within walking > > > > distance? > > > > > > Dunno if it's better, but Chevys is nearby and handles crowds > > > well. > > > > Well, margaritas could be fun... > > > > How is it for noise? I've noticed some of these restaurants get so > > loud you have to shout to talk to the person next to you (which, of > > course, just exacerbates the problem...) > > I'd go for Bucca over Chevys unless the objective is to get blitzed in > a noisy environment. Yeah, noise is deal-breaker. This is supposed to be a social gathering. ;) I appreciate, enormously, your offer to kick in money. I think it's better if we just have everyone pay their own way. That way we don't have to worry about scaling issues (as in "oops, we just got twice the people we expected.") Buca says they're OK with giving everyone a separate check, so that should prevent this class of problems: http://en.wikipedia.org/wiki/Bistromathics . -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From extasia at extasia.org Fri May 4 07:50:37 2007 From: extasia at extasia.org (David Alban) Date: Fri, 4 May 2007 07:50:37 -0700 Subject: [sf-perl] CGI, TT, Mason Message-ID: <4c714a9c0705040750i4c889f60i58ded4257c8a4706@mail.gmail.com> [hijacking an oakperl thread...] On 2 May 2007 at 22:44:43 -0700 Quinn Weaver wrote: > Hmmn, I personally wouldn't teach that to newbies. In my opinion, > CGI.pm is one of those technologies whose time has come and gone. New > people should be learning a templating language instead, like TT or Mason. > > It's just so much nicer to have HTML with a few funky tags, rather > than a bunch of calls insider a Perl program... particularly if you're > working with a graphic designer who's supposed to code the XHTML/CSS. Quinn, Would you consider giving an sfperl talk for perl-web newbies on doing web stuff using perl? I've been doing sysadmin and general unix stuff with perl for years, but have almost no experience using perl in web contexts. I was told on this list not too long ago that cgi might be the way to go for me because I want to put web front ends on sysadmin / general unix perl tools (as opposed to developing web applications). Even if that's so, I'd love to hear such a talk. Thanks, David -- Live in a world of your own, but always welcome visitors. From nheller at silcon.com Fri May 4 08:44:45 2007 From: nheller at silcon.com (nheller at silcon.com) Date: Fri, 4 May 2007 08:44:45 -0700 (PDT) Subject: [sf-perl] CGI, TT, Mason In-Reply-To: <4c714a9c0705040750i4c889f60i58ded4257c8a4706@mail.gmail.com> References: <4c714a9c0705040750i4c889f60i58ded4257c8a4706@mail.gmail.com> Message-ID: <49394.208.253.246.249.1178293485.squirrel@webmail.silcon.com> I would be very interested in that, too! Neil Heller > [hijacking an oakperl thread...] > > On 2 May 2007 at 22:44:43 -0700 Quinn Weaver wrote: >> Hmmn, I personally wouldn't teach that to newbies. In my opinion, >> CGI.pm is one of those technologies whose time has come and gone. New >> people should be learning a templating language instead, like TT or >> Mason. >> >> It's just so much nicer to have HTML with a few funky tags, rather >> than a bunch of calls insider a Perl program... particularly if you're >> working with a graphic designer who's supposed to code the XHTML/CSS. > > Quinn, > > Would you consider giving an sfperl talk for perl-web newbies on doing > web stuff using perl? I've been doing sysadmin and general unix stuff > with perl for years, but have almost no experience using perl in web > contexts. I was told on this list not too long ago that cgi might be > the way to go for me because I want to put web front ends on sysadmin > / general unix perl tools (as opposed to developing web applications). > Even if that's so, I'd love to hear such a talk. > > Thanks, > David > -- > Live in a world of your own, but always welcome visitors. > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From quinn at fairpath.com Fri May 4 14:32:20 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Fri, 4 May 2007 14:32:20 -0700 Subject: [sf-perl] CGI, TT, Mason In-Reply-To: <4c714a9c0705040750i4c889f60i58ded4257c8a4706@mail.gmail.com> References: <4c714a9c0705040750i4c889f60i58ded4257c8a4706@mail.gmail.com> Message-ID: <20070504213220.GA58072@fu.funkspiel.org> On Fri, May 04, 2007 at 07:50:37AM -0700, David Alban wrote: > [hijacking an oakperl thread...] > > On 2 May 2007 at 22:44:43 -0700 Quinn Weaver wrote: > > Hmmn, I personally wouldn't teach that to newbies. In my opinion, > > CGI.pm is one of those technologies whose time has come and gone. New > > people should be learning a templating language instead, like TT or Mason. > > > > It's just so much nicer to have HTML with a few funky tags, rather > > than a bunch of calls insider a Perl program... particularly if you're > > working with a graphic designer who's supposed to code the XHTML/CSS. > > Quinn, > > Would you consider giving an sfperl talk for perl-web newbies on doing > web stuff using perl? I've been doing sysadmin and general unix stuff > with perl for years, but have almost no experience using perl in web > contexts. I was told on this list not too long ago that cgi might be > the way to go for me because I want to put web front ends on sysadmin > / general unix perl tools (as opposed to developing web applications). > Even if that's so, I'd love to hear such a talk. I remember that thread. Well, maybe they were right. CGI.pm is OK for small apps that will never have an HTML coder; it's when the apps get big and division of labor comes up that CGI.pm is really a bad idea. I guess my point was that someone looking to do web programming in the large should not start with CGI.pm. It's one of those things that's dangerous for newbies to know. ;) Regarding other systems... I'm planning a talk on Catalyst. That's the Perl answer to Ruby on Rails. I even have a Ruby guy interested in speaking with me and showing the RoR angle. That talk will probably not happen before July. However, for your needs, Catalyst is a pretty heavy framework. I would look into HTML::Mason or Template Toolkit if you think you need a templating system. I might do (or book) a talk on using Mason or TT alone, but I need to put my energy into doing a Catalyst talk first. But I'll put it on my list. :) -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From nheller at silcon.com Mon May 7 13:48:51 2007 From: nheller at silcon.com (nheller at silcon.com) Date: Mon, 7 May 2007 13:48:51 -0700 (PDT) Subject: [sf-perl] A beginners' Question Message-ID: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> I'm trying to write a Perl script in Winderz. At one point in my script, I want to launch another Perl script. system "Perl secondScript.pl"; The problem I'm having is that secondScript.pl is a link to the real secondScript.pl (which is at a location with a very long URN) and Perl balks at executing the link. Does anybody have an idea about how I can get around this? From extasia at extasia.org Mon May 7 14:27:23 2007 From: extasia at extasia.org (David Alban) Date: Mon, 7 May 2007 14:27:23 -0700 Subject: [sf-perl] A beginners' Question In-Reply-To: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> References: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> Message-ID: <4c714a9c0705071427r70eee13dq40c764ec0cc5f39c@mail.gmail.com> readlink() ? Then execute the target? perldoc -f readlink don't know if works in waanderz. On 5/7/07, nheller at silcon.com wrote: > I'm trying to write a Perl script in Winderz. At one point in my script, > I want to launch another Perl script. > > system "Perl secondScript.pl"; > > The problem I'm having is that secondScript.pl is a link to the real > secondScript.pl (which is at a location with a very long URN) and Perl > balks at executing the link. > > Does anybody have an idea about how I can get around this? -- Live in a world of your own, but always welcome visitors. From nheller at silcon.com Mon May 7 17:09:10 2007 From: nheller at silcon.com (nheller at silcon.com) Date: Mon, 7 May 2007 17:09:10 -0700 (PDT) Subject: [sf-perl] A beginners' Question In-Reply-To: <4c714a9c0705071427r70eee13dq40c764ec0cc5f39c@mail.gmail.com> References: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> <4c714a9c0705071427r70eee13dq40c764ec0cc5f39c@mail.gmail.com> Message-ID: <40222.208.253.246.249.1178582950.squirrel@webmail.silcon.com> I read PerlDocs and this is what I tried: 1. chdir "c:\\sqlscr"; 2. my $target = readlnk("Multi_SQL.pl"); 3. system "Perl $target"; I received a fatal error that line 2 (above) contained a call to an "Undefined Subroutine". I couldn't tell from Perl Docs what I should have included (require...?). Can you give me some insight. Neil Heller > readlink() ? Then execute the target? > > perldoc -f readlink > > don't know if works in waanderz. > > On 5/7/07, nheller at silcon.com wrote: >> I'm trying to write a Perl script in Winderz. At one point in my >> script, >> I want to launch another Perl script. >> >> system "Perl secondScript.pl"; >> >> The problem I'm having is that secondScript.pl is a link to the real >> secondScript.pl (which is at a location with a very long URN) and Perl >> balks at executing the link. >> >> Does anybody have an idea about how I can get around this? > > -- > Live in a world of your own, but always welcome visitors. > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From vlb at cfcl.com Mon May 7 18:55:31 2007 From: vlb at cfcl.com (Vicki Brown) Date: Mon, 7 May 2007 18:55:31 -0700 Subject: [sf-perl] Bug management / time management Message-ID: Do you feel that you do a good job at bug management? (presuming you have a regular bug queue). If so, do you care to share any tips, tricks, hints, or methods that you find work well? The people in my work team are drowning. They're an Operations Support team so they don't tend to get crashing program error bugs; they get please do this task bugs and usually, the reporter set the priority. When you're staring at a dozen, 50, 100 or more bugs, how do you tackle them? How do _you_ prioritize what to work on when the bug already has a Priority field that may not relate to your personal workflow or task list? (e.g. there has to be some way to prioritize the work on 15 P2 bugs :-( I'm looking for suggested _successful_ time & bug management tips to help them cope. I've never, personally, had a bug queue with 50-200 bugs in it so this is outside my realm of personal experience. We use Bugzilla if that makes things easier... or more difficult. -- - Vicki ZZZ zzZ San Francisco Bay Area, CA z |\ _,,,---,,_ Books, Cats, Tech zz /,`.-'`' -. ;-;;,_ http://cfcl.com/vlb |,4- ) )-,_. ,\ ( `'-' http://cfcl.com/vlb/weblog '---''(_/--' `-'\_) http://vlb.typepad.com/commentary/ From andy at petdance.com Mon May 7 19:34:13 2007 From: andy at petdance.com (Andy Lester) Date: Mon, 7 May 2007 21:34:13 -0500 Subject: [sf-perl] Bug management / time management In-Reply-To: References: Message-ID: <11B9B4E9-2186-4FEA-9525-84A09BD462BF@petdance.com> > If so, do you care to share any tips, tricks, hints, or methods > that you > find work well? Bugs are technical debt. Here are slides from my talk on technical debt: http://petdance.com/perl/technical-debt/ The solution is simple, but not easy: * Identify your debts * Determine the costs of each * Pay the most profitable * Repeat as necessary In your case, "identify" is already done. It's figuring out the costs that's tough. > The people in my work team are drowning. They're an Operations Support > team so they don't tend to get crashing program error bugs; they get > please do this task bugs and usually, the reporter set the priority. Please also read Tom Limoncelli's excellent "Time Management For System Administrators". It discusses exactly this sort of prioritization. > When you're staring at a dozen, 50, 100 or more bugs, how do you > tackle > them? How do _you_ prioritize what to work on when the bug already > has a > Priority field that may not relate to your personal workflow or > task list? > (e.g. there has to be some way to prioritize the work on 15 P2 > bugs :-( Even more important than which bugs (plural) to fix is which bug (singular) to start on. Work on one bug. Fix it. Move to the next. It's better to get one bug completely fixed than ten bugs half fixed. Do not get all caught up in the size and massiveness of the pile. Eat the elephant one bite at a time. > I'm looking for suggested _successful_ time & bug management tips > to help > them cope. I've never, personally, had a bug queue with 50-200 bugs > in it > so this is outside my realm of personal experience. My big concern is that you want to not get caught up in long-term planning. Get going short-term, and worry about long-term in a few days/weeks. I'd work off of paper at first. Print out the bug list, gather a group around the table, and talk about what's most profitable. Mark up the pages of paper with highlighters. Keep it low-tech. Figure out what can give you the best bang for the buck at first. Most profitable means that the bug that is the most expensive in impact may not be not be the one you start on because it's brutally large to do. Everyone take something and go. And then re-check at the end of the week and see how everyone is doing. xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From james at actionmessage.com Mon May 7 19:35:46 2007 From: james at actionmessage.com (James Briggs) Date: Mon, 7 May 2007 19:35:46 -0700 Subject: [sf-perl] Bug management / time management In-Reply-To: References: Message-ID: <20070508023358.M29945@actionmessage.com> On Mon, 7 May 2007 18:55:31 -0700, Vicki Brown wrote > Do you feel that you do a good job at bug management? > (presuming you have a regular bug queue). > > If so, do you care to share any tips, tricks, hints, or methods that > you find work well? > > The people in my work team are drowning. They're an Operations > Support team so they don't tend to get crashing program error bugs; > they get please do this task bugs and usually, the reporter set the priority. > > When you're staring at a dozen, 50, 100 or more bugs, how do you tackle > them? How do _you_ prioritize what to work on when the bug already > has a Priority field that may not relate to your personal workflow > or task list? > (e.g. there has to be some way to prioritize the work on 15 P2 bugs > :-( > > I'm looking for suggested _successful_ time & bug management tips > to help them cope. I've never, personally, had a bug queue with 50- > 200 bugs in it so this is outside my realm of personal experience. > > We use Bugzilla if that makes things easier... or more difficult. > -- > - Vicki If you want a magic bullet, I doubt if there is one. Most companies/departments use a project manager (or somebody acting in that capacity) to schedule work based on client and developer input. PMs with some software experience are usually more successful than those without. Thanks, James Briggs From xantus at teknikill.net Mon May 7 17:49:51 2007 From: xantus at teknikill.net (David Davis) Date: Mon, 7 May 2007 17:49:51 -0700 Subject: [sf-perl] A beginners' Question In-Reply-To: <40222.208.253.246.249.1178582950.squirrel@webmail.silcon.com> References: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> <4c714a9c0705071427r70eee13dq40c764ec0cc5f39c@mail.gmail.com> <40222.208.253.246.249.1178582950.squirrel@webmail.silcon.com> Message-ID: <89f5393a0705071749w31e8d50dwc801de7c92c79c2c@mail.gmail.com> Did you check the value of $target first? You can use $^X to get the full path of the perl you are running. system("$^X somescript.pl"); Although if the script is executable, and has a #! line, then you don't need it at all. system("somescript.pl"); Are you using cygwin? David On 5/7/07, nheller at silcon.com wrote: > > > I read PerlDocs and this is what I tried: > > 1. chdir "c:\\sqlscr"; > 2. my $target = readlnk("Multi_SQL.pl"); > 3. system "Perl $target"; > > I received a fatal error that line 2 (above) contained a call to an > "Undefined Subroutine". I couldn't tell from Perl Docs what I should have > included (require...?). > > Can you give me some insight. > > Neil Heller > > > > > > > readlink() ? Then execute the target? > > > > perldoc -f readlink > > > > don't know if works in waanderz. > > > > On 5/7/07, nheller at silcon.com wrote: > >> I'm trying to write a Perl script in Winderz. At one point in my > >> script, > >> I want to launch another Perl script. > >> > >> system "Perl secondScript.pl"; > >> > >> The problem I'm having is that secondScript.pl is a link to the real > >> secondScript.pl (which is at a location with a very long URN) and Perl > >> balks at executing the link. > >> > >> Does anybody have an idea about how I can get around this? > > > > -- > > Live in a world of your own, but always welcome visitors. > > _______________________________________________ > > SanFrancisco-pm mailing list > > SanFrancisco-pm at pm.org > > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > > > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070507/c132acb5/attachment.html From tal at whatexit.org Tue May 8 09:13:40 2007 From: tal at whatexit.org (Tom Limoncelli) Date: Tue, 8 May 2007 12:13:40 -0400 Subject: [sf-perl] Bug management / time management Message-ID: I'm not on the mailing list, so this post may get rejected. Therefore I'm CCing Vicki and Andy directly. What you need is a way to say "no" and "not now". One way to do that is to set priorities. Let users set the priority of their requests but once a day a manager should review all new items and change any priorities they disagree with. Sometimes this is done by a committee with representatives from all areas. They are called a MRRB (MR review board, or Bug Review Board). They meet once a week. Requests are left at the default or user-set priority until the meeting happens, at which time the priorities might be reset. Another thing you can do is make sure you have 3 policies in writing: 1. what constitutes an emergency? (definitions of what is a priority 1, 2, 3, 4, etc.) 2. how do people report problems? (submit a bug request.... don't bother my damn employees) 3. what is the scope of what the team works on? (i.e. we do fix bugs in these 3 areas... we don't fix bugs with other people's systems, etc.) #3 is most likely not a problem. When I say "in writing" I mean that they are documented and management above you goes to bat to enforce those policies. If a priority 1 bug is "only emergencies... and an emergency is defined as something that will DIRECTLY prevent tomorrows newspaper from getting out on time" (if you work at a newspaper) then management has to be willing to support you when you change a pri-1 to a pri-2. As Andy alluded to, I make these points in Time Management for System Administrators. (www.everythingsysadmin.com). It's also in a chapter called "Crawl Out of the Hole" in the next edition of my other book, due out in June. Good luck! Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070508/88a3337a/attachment-0001.html From roman.brenes at gmail.com Tue May 8 10:16:17 2007 From: roman.brenes at gmail.com (Roman Brenes) Date: Tue, 8 May 2007 10:16:17 -0700 Subject: [sf-perl] A beginners' Question In-Reply-To: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> References: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> Message-ID: <7beebc690705081016u330e7c51ycd71800e51b9e1f@mail.gmail.com> This might help: Read and write Windows "shortcut" links http://www.perlmonks.org/?node_id=263858 On 5/7/07, nheller at silcon.com wrote: > > > I'm trying to write a Perl script in Winderz. At one point in my script, > I want to launch another Perl script. > > system "Perl secondScript.pl"; > > The problem I'm having is that secondScript.pl is a link to the real > secondScript.pl (which is at a location with a very long URN) and Perl > balks at executing the link. > > Does anybody have an idea about how I can get around this? > > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070508/91478ab8/attachment.html From nheller at silcon.com Tue May 8 10:50:23 2007 From: nheller at silcon.com (nheller at silcon.com) Date: Tue, 8 May 2007 10:50:23 -0700 (PDT) Subject: [sf-perl] A beginners' Question In-Reply-To: <7beebc690705081016u330e7c51ycd71800e51b9e1f@mail.gmail.com> References: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> <7beebc690705081016u330e7c51ycd71800e51b9e1f@mail.gmail.com> Message-ID: <36970.208.253.246.249.1178646623.squirrel@webmail.silcon.com> Thank you very much. I think that this is just what I'm looking for. > This might help: > Read and write Windows "shortcut" links > http://www.perlmonks.org/?node_id=263858 > > > On 5/7/07, nheller at silcon.com wrote: >> >> >> I'm trying to write a Perl script in Winderz. At one point in my >> script, >> I want to launch another Perl script. >> >> system "Perl secondScript.pl"; >> >> The problem I'm having is that secondScript.pl is a link to the real >> secondScript.pl (which is at a location with a very long URN) and Perl >> balks at executing the link. >> >> Does anybody have an idea about how I can get around this? >> >> >> _______________________________________________ >> SanFrancisco-pm mailing list >> SanFrancisco-pm at pm.org >> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm >> > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From nheller at silcon.com Tue May 8 11:16:37 2007 From: nheller at silcon.com (nheller at silcon.com) Date: Tue, 8 May 2007 11:16:37 -0700 (PDT) Subject: [sf-perl] A beginners' Question In-Reply-To: <36970.208.253.246.249.1178646623.squirrel@webmail.silcon.com> References: <52528.208.253.246.249.1178570931.squirrel@webmail.silcon.com> <7beebc690705081016u330e7c51ycd71800e51b9e1f@mail.gmail.com> <36970.208.253.246.249.1178646623.squirrel@webmail.silcon.com> Message-ID: <42699.208.253.246.249.1178648197.squirrel@webmail.silcon.com> That was the idea. When I tried to work with it, it died. Oh well, so much for that. > > Thank you very much. I think that this is just what I'm looking for. > > >> This might help: >> Read and write Windows "shortcut" links >> http://www.perlmonks.org/?node_id=263858 >> >> >> On 5/7/07, nheller at silcon.com wrote: >>> >>> >>> I'm trying to write a Perl script in Winderz. At one point in my >>> script, >>> I want to launch another Perl script. >>> >>> system "Perl secondScript.pl"; >>> >>> The problem I'm having is that secondScript.pl is a link to the real >>> secondScript.pl (which is at a location with a very long URN) and Perl >>> balks at executing the link. >>> >>> Does anybody have an idea about how I can get around this? >>> >>> >>> _______________________________________________ >>> SanFrancisco-pm mailing list >>> SanFrancisco-pm at pm.org >>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm >>> >> _______________________________________________ >> SanFrancisco-pm mailing list >> SanFrancisco-pm at pm.org >> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm >> > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From doom at kzsu.stanford.edu Tue May 8 12:03:07 2007 From: doom at kzsu.stanford.edu (Joe Brenner) Date: Tue, 08 May 2007 12:03:07 -0700 Subject: [sf-perl] Bug management / time management In-Reply-To: <20070508023358.M29945@actionmessage.com> References: <20070508023358.M29945@actionmessage.com> Message-ID: <200705081903.l48J376D079695@kzsu.stanford.edu> James Briggs wrote: > Most companies/departments use a project manager (or somebody > acting in that capacity) to schedule work based on client and > developer input. I was thinking that what might be needed is someone a little lower-down the chain, to read through the list of bugs and and re-prioritize them... make sure that the Priority 1 bugs are real crashers, etc. (You could hire someone from the Mozilla team to close them at random... that reduces the size of the queue pretty quickly.) From sphink at gmail.com Wed May 9 14:27:42 2007 From: sphink at gmail.com (Steve Fink) Date: Wed, 9 May 2007 14:27:42 -0700 Subject: [sf-perl] Bug management / time management In-Reply-To: References: Message-ID: <7d7f2e8c0705091427w656056cbg85efc36a60bce2b6@mail.gmail.com> One thing I'm surprised nobody has brought up is the distinction between severity and priority. (Those are the bugzilla terms, but the exact words aren't important. What is important is that they are two independent concepts.) Severity is how big of a problem the issue is. With a bug, that means whether the submitter is prevented from accomplishing the task, or whether it's just a small annoyance. In your case, it's similar -- the requester needs something in order to accomplish *anything* vs they're totally blocked on one task vs "wouldn't it be nice if..." Priority is when the team is going to have it fixed/done. If you are somebody at the receiving end of the task queue, then you will only work on P1s until they are all gone, then you'll work on P2s. (Ok, maybe there's only one P1 and somebody else is working on it, but that's the idea.) Or, in other words, severity is the priority of the task *to the requester*, and priority is the priority of the task to the developer (sysadmin, ...). Many people do not make the distinction, and wonder why bugzilla bothers to have two redundant fields. Admittedly, bugzilla messes up by allowing the requester to set the priority, not just the severity. If you stick to the intended meanings of the two fields, this makes no sense. The requester can at most request a desired priority, but obviously they're not going to take into account everyone else's requests (and probably not their own past requests, either.) Similarly, the developers/sysadmins/peons should normally not adjust the severity. The severity is part of the description of what the problem or task is from the point of view of the requester, so adjusting the severity is destroying information even if you disagree with it. The only time it makes sense to modify is if the requester misunderstood what was going on and agrees with the change (in which case, it would be better for the requester to change it himself, but they'll probably never bother to so someone else may as well.) If you're leaving severity alone and setting priority, then it *is* useful to periodically do a scan for high-severity issues with low priority. Those generally are (1) forgotten problems that should have their priority raised, (2) disagreements over the nature or best resolution of the issue, or (3) outdated or invalid requests. Don't think you have to "fix" all of these, though; you'll see them often enough in the next scan, until you're annoyed enough to go talk the requester out of their unrealistic ideas. :-) So you'll need to do regular triage meetings to establish the priority of all of the tasks. Some people prefer for the resulting priorities to give exactly the order of tasks in importance, but personally I think that if you do that you'll needlessly create a discrepancy between the issue database and reality. You're better off making the priorities accurately reflect what order people are actually going to work on things in. Sometimes that means boosting the priority of a seemingly tiny issue just because it's easier for the developer to do it in connection with another high-priority issue, or because it lays the groundwork for other high-priority items. Also, I'd recommend making a new bugzilla priority and severity named "unassigned". Allowing them to have default values is dumb and loses important information. As for being swamped with work, think of it this way: you're going to do X amount of work in a day. It's not going to go up if you have a bigger backlog. So you're not actually swamped, you just feel that way. (Ok, you can work nights and weekends, but productivity has this tricky way of balancing out in the long run anyway...) The only thing worth stressing about is whether you're working on the *right* issues. You're never going to get that exactly right, either, but if you do periodic triage and prioritization reviews, you can get closer to the imaginary perfect ordering. As long as you're actively balancing the amount of backlog management and actual task execution, you're doing as well as you can. From andy at petdance.com Wed May 9 15:11:30 2007 From: andy at petdance.com (Andy Lester) Date: Wed, 9 May 2007 17:11:30 -0500 Subject: [sf-perl] Bug management / time management In-Reply-To: <7d7f2e8c0705091427w656056cbg85efc36a60bce2b6@mail.gmail.com> References: <7d7f2e8c0705091427w656056cbg85efc36a60bce2b6@mail.gmail.com> Message-ID: <26720222-8AFB-4712-9923-8F5EE0FD6903@petdance.com> On May 9, 2007, at 4:27 PM, Steve Fink wrote: > One thing I'm surprised nobody has brought up is the distinction > between severity and priority. Severity can help drive priority, but it's not the only determinant. A bug might cause your Apache to crash, but only once a year on New Years Eve. It's a severe bug, but might not be a high priority. You might have another bug that errors out during a data load when it finds a malformed data field. No data is harmed, and it's just an annoyance, but it happens every other day and it takes a programmer half an hour to find the bad data and start the data load process again. Not a severe bug, but probably would be a high priority. That's why I talk about the costs of fixing the problem vs. the costs of having it still be there. THAT'S where priority should derive from. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From sphink at gmail.com Wed May 9 19:07:06 2007 From: sphink at gmail.com (Steve Fink) Date: Wed, 9 May 2007 19:07:06 -0700 Subject: [sf-perl] Bug management / time management In-Reply-To: <26720222-8AFB-4712-9923-8F5EE0FD6903@petdance.com> References: <7d7f2e8c0705091427w656056cbg85efc36a60bce2b6@mail.gmail.com> <26720222-8AFB-4712-9923-8F5EE0FD6903@petdance.com> Message-ID: <7d7f2e8c0705091907n29e62e8cl5f8dc74e926b5852@mail.gmail.com> On 5/9/07, Andy Lester wrote: > > On May 9, 2007, at 4:27 PM, Steve Fink wrote: > > > One thing I'm surprised nobody has brought up is the distinction > > between severity and priority. > > Severity can help drive priority, but it's not the only determinant. > A bug might cause your Apache to crash, but only once a year on New > Years Eve. It's a severe bug, but might not be a high priority. I fully agree. That's why it's useful to keep both fields separately. Although with your specific example, I would hope that the requester would mark the annual crash bug as lower severity than the bad data one. Severity is intended to be the impact on the user, not some objective measure of how hard the system goes down when the issue is encountered. In your terms, severity is the cost of having the bug still be there, and that is used in conjunction with the cost of fixing the bug to determine the priority. Or, if you're not explicitly tracking priority, the two together determine when someone gets around to fixing it. :-) Of course, I'd usually leave it up to the development team to make those decisions, with the understanding that if they don't take the severity into account when choosing priorities (== deciding what to work on, and in what order), that they aren't serving the needs of their users very well and might want to start stealing more office supplies in case they don't have the opportunity too much longer... But depending on your setup, it may work fine for someone else to do the prioritization, as long as the developers pay attention to it. From Peter.Loo at source.wolterskluwer.com Fri May 11 14:10:22 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 11 May 2007 14:10:22 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> Hi All, I am trying to add a day to a date using Perl Time::Local library within a Korn shell. However it is not allowing my Korn shell variable to be used within the Perl command. MM=05 DD=06 YYYY=2007 DAY_ADDED=`perl -e 'use Time::Local; ($secs = timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); ($year, $mon, $day) = (localtime($secs))[5,4,3]; $year+=1900; $mon =~ s/^/0/ if $mon < 10; $day =~ s/^/0/ if $day < 10; print $year . $mon . $day;';` echo $DAY_ADDED I am getting the following error: Day '' out of range 1..31 at -e line 1 Then I tried the following and got a different error: PERL_CMD="perl -e 'use Time::Local; (\$secs = timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); (\$year, \$mon, \$day) = (localtime(\$secs))[5,4,3]; \$year+=1900; \$mon =~ s/^/0/ if \$mon < 10; \$day =~ s/^/0/ if \$day < 10; print \$year . \$mon . \$day; ';" DAY_ADDED=`${PERL_CMD}` Can't find string terminator "'" anywhere before EOF at -e line 1. What am I doing wrong here? Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070511/7d3f90cb/attachment.html From quinn at fairpath.com Fri May 11 14:25:15 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Fri, 11 May 2007 14:25:15 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> Message-ID: <20070511212515.GA29331@fu.funkspiel.org> On Fri, May 11, 2007 at 02:10:22PM -0700, Loo, Peter # PHX wrote: > Hi All, > > I am trying to add a day to a date using Perl Time::Local library within > a Korn shell. However it is not allowing my Korn shell variable to be > used within the Perl command. Right. To get access to a shell variable within Perl, you need to something like this: $ENV{DD} %ENV is a magic tied hash that gives access to environment variables. I think you would have an easier time with this program if you broke out the Perl part into a separate file. Then you could format it nicely, instead of putting it all on one line. Also, you could test it separately. I won't lecture you on the fact that this is an ugly hack, the kind that gives Perl a bad name. I assume you know that already. ;) Also... > > Then I tried the following and got a different error: > > PERL_CMD="perl -e 'use Time::Local; (\$secs = > timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); (\$year, \$mon, \$day) = > (localtime(\$secs))[5,4,3]; \$year+=1900; \$mon =~ s/^/0/ if \$mon < 10; > \$day =~ s/^/0/ if \$day < 10; print \$year . \$mon . \$day; ';" > DAY_ADDED=`${PERL_CMD}` > > Can't find string terminator "'" anywhere before EOF at -e line 1. It's complaining that you are missing a closing single quote. You did perl -e '... and then never closed that quote. Hairy quoting issues like this are another good reason to move your Perl code to a separate file. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From Peter.Loo at source.wolterskluwer.com Fri May 11 14:31:23 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 11 May 2007 14:31:23 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <20070511212515.GA29331@fu.funkspiel.org> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> <20070511212515.GA29331@fu.funkspiel.org> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A03525B9F@phxmail02.phx.ndchealth.com> Thank you very much Quinn. I had forgotten all about that. 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 Quinn Weaver Sent: Friday, May 11, 2007 2:25 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Embedded Perl in a Korn shell program On Fri, May 11, 2007 at 02:10:22PM -0700, Loo, Peter # PHX wrote: > Hi All, > > I am trying to add a day to a date using Perl Time::Local library > within a Korn shell. However it is not allowing my Korn shell > variable to be used within the Perl command. Right. To get access to a shell variable within Perl, you need to something like this: $ENV{DD} %ENV is a magic tied hash that gives access to environment variables. I think you would have an easier time with this program if you broke out the Perl part into a separate file. Then you could format it nicely, instead of putting it all on one line. Also, you could test it separately. I won't lecture you on the fact that this is an ugly hack, the kind that gives Perl a bad name. I assume you know that already. ;) Also... > > Then I tried the following and got a different error: > > PERL_CMD="perl -e 'use Time::Local; (\$secs = > timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); (\$year, \$mon, \$day) = > (localtime(\$secs))[5,4,3]; \$year+=1900; \$mon =~ s/^/0/ if \$mon < > 10; \$day =~ s/^/0/ if \$day < 10; print \$year . \$mon . \$day; ';" > DAY_ADDED=`${PERL_CMD}` > > Can't find string terminator "'" anywhere before EOF at -e line 1. It's complaining that you are missing a closing single quote. You did perl -e '... and then never closed that quote. Hairy quoting issues like this are another good reason to move your Perl code to a separate file. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ _______________________________________________ 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 sphink at gmail.com Fri May 11 14:34:26 2007 From: sphink at gmail.com (Steve Fink) Date: Fri, 11 May 2007 14:34:26 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> Message-ID: <7d7f2e8c0705111434t7e09122by3a38fb0654d58271@mail.gmail.com> On 5/11/07, Loo, Peter # PHX wrote: > > > Hi All, > > I am trying to add a day to a date using Perl Time::Local library within a > Korn shell. However it is not allowing my Korn shell variable to be used > within the Perl command. > > MM=05 > DD=06 > YYYY=2007 > > DAY_ADDED=`perl -e 'use Time::Local; ($secs = timelocal(0,0,0,$MM,$DD,$YYYY) > + 86400); ($year, $mon, $day) = (localtime($secs))[5,4,3]; $year+=1900; $mon > =~ s/^/0/ if $mon < 10; $day =~ s/^/0/ if $day < 10; print $year . $mon . > $day;';` > > echo $DAY_ADDED > > I am getting the following error: > > > Day '' out of range 1..31 at -e line 1 > > Then I tried the following and got a different error: > > PERL_CMD="perl -e 'use Time::Local; (\$secs = timelocal(0,0,0,$MM,$DD,$YYYY) > + 86400); (\$year, \$mon, \$day) = (localtime(\$secs))[5,4,3]; \$year+=1900; > \$mon =~ s/^/0/ if \$mon < 10; \$day =~ s/^/0/ if \$day < 10; print \$year . > \$mon . \$day; ';" > DAY_ADDED=`${PERL_CMD}` > > Can't find string terminator "'" anywhere before EOF at -e line 1. > > What am I doing wrong here? In addition to what Quinn just said, I wonder if you're literally typing MM=05? If so, you're not exporting those variable settings. It still isn't pretty (or correct; days aren't always 86400 seconds long), but this is simpler than what you're doing: MM=05 DD=06 YYYY=2007 perl -MTime::Local -MPOSIX -le '$secs = timelocal(0,0,0,$ENV{MM},$ENV{DD},$ENV{YYYY}) + 86400; print strftime("%Y-%m-%d", localtime($secs))' From quinn at fairpath.com Fri May 11 14:33:58 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Fri, 11 May 2007 14:33:58 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> Message-ID: <20070511213358.GA29411@fu.funkspiel.org> On Fri, May 11, 2007 at 02:10:22PM -0700, Loo, Peter # PHX wrote: > Hi All, > > I am trying to add a day to a date using Perl Time::Local library within > a Korn shell. However it is not allowing my Korn shell variable to be > used within the Perl command. One more thing: you need to "export" your shell variables into the environment in order for Perl to see them. Otherwise the variables are private to your shell. For instance: DD=foo export DD perl -e 'use strict; use warnings; print "$ENV{DD}\n"'; That will output foo But if you don't export... DD=foo perl -e 'use strict; use warnings; print "$ENV{DD}\n"'; You'll get this error message: Use of uninitialized value in concatenation (.) or string at -e line 1. Because $ENV{DD} is undefined. HTH. When you move your Perl code to a separate file, remember to turn on use strict; use warnings; -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From rdm at cfcl.com Fri May 11 14:36:19 2007 From: rdm at cfcl.com (Rich Morin) Date: Fri, 11 May 2007 14:36:19 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <20070511212515.GA29331@fu.funkspiel.org> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> <20070511212515.GA29331@fu.funkspiel.org> Message-ID: It's quite possible to embed multi-line Perl scripts in shell scripts. And, although the quoting issues can get pretty complicated, there are also some cool things that you can do by using the shell as a macro pre-processor for Perl (e.g., put a Perl script in a loop, varying the code from iteration to iteration). That said, I agree that keeping Perl in a separate file is generally both simpler and safer. -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 Adam.Morgan at safeway.com Fri May 11 14:40:54 2007 From: Adam.Morgan at safeway.com (Adam Morgan) Date: Fri, 11 May 2007 15:40:54 -0600 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> Message-ID: <5113C869AE8FD844B3589414188D35A9012F750C@PHITPR05EXC01.safeway01.ad.safeway.com> As well as all the good advice you have already received, if you are using the perl purely to add a day to the date in ksh, then you can get that fiunctionality using the gnu date command, for example: date -d "01/01/2002 +1 day" gives "Wed Jan 2 00:00:00 MST 2002" as it's result or date -d "+1 day" gave "Sat May 12 15:39:09 MDT 2007" when I ran it as it is relative to now. ________________________________ From: sanfrancisco-pm-bounces+adam.morgan=safeway.com at pm.org [mailto:sanfrancisco-pm-bounces+adam.morgan=safeway.com at pm.org] On Behalf Of Loo, Peter # PHX Sent: Friday, May 11, 2007 2:10 PM To: sanfrancisco-pm at pm.org Subject: [sf-perl] Embedded Perl in a Korn shell program Hi All, I am trying to add a day to a date using Perl Time::Local library within a Korn shell. However it is not allowing my Korn shell variable to be used within the Perl command. MM=05 DD=06 YYYY=2007 DAY_ADDED=`perl -e 'use Time::Local; ($secs = timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); ($year, $mon, $day) = (localtime($secs))[5,4,3]; $year+=1900; $mon =~ s/^/0/ if $mon < 10; $day =~ s/^/0/ if $day < 10; print $year . $mon . $day;';` echo $DAY_ADDED I am getting the following error: Day '' out of range 1..31 at -e line 1 Then I tried the following and got a different error: PERL_CMD="perl -e 'use Time::Local; (\$secs = timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); (\$year, \$mon, \$day) = (localtime(\$secs))[5,4,3]; \$year+=1900; \$mon =~ s/^/0/ if \$mon < 10; \$day =~ s/^/0/ if \$day < 10; print \$year . \$mon . \$day; ';" DAY_ADDED=`${PERL_CMD}` Can't find string terminator "'" anywhere before EOF at -e line 1. What am I doing wrong here? Peter "MMS " made the following annotations. ------------------------------------------------------------------------------ Warning: All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately. ============================================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070511/99a41448/attachment-0001.html From Peter.Loo at source.wolterskluwer.com Fri May 11 14:57:37 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 11 May 2007 14:57:37 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <20070511213358.GA29411@fu.funkspiel.org> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> <20070511213358.GA29411@fu.funkspiel.org> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A03525BFE@phxmail02.phx.ndchealth.com> Yes, thank you all very much once again. 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 Quinn Weaver Sent: Friday, May 11, 2007 2:34 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Embedded Perl in a Korn shell program On Fri, May 11, 2007 at 02:10:22PM -0700, Loo, Peter # PHX wrote: > Hi All, > > I am trying to add a day to a date using Perl Time::Local library > within a Korn shell. However it is not allowing my Korn shell > variable to be used within the Perl command. One more thing: you need to "export" your shell variables into the environment in order for Perl to see them. Otherwise the variables are private to your shell. For instance: DD=foo export DD perl -e 'use strict; use warnings; print "$ENV{DD}\n"'; That will output foo But if you don't export... DD=foo perl -e 'use strict; use warnings; print "$ENV{DD}\n"'; You'll get this error message: Use of uninitialized value in concatenation (.) or string at -e line 1. Because $ENV{DD} is undefined. HTH. When you move your Perl code to a separate file, remember to turn on use strict; use warnings; -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ _______________________________________________ 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 Peter.Loo at source.wolterskluwer.com Fri May 11 15:01:16 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 11 May 2007 15:01:16 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <5113C869AE8FD844B3589414188D35A9012F750C@PHITPR05EXC01.safeway01.ad.safeway.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> <5113C869AE8FD844B3589414188D35A9012F750C@PHITPR05EXC01.safeway01.ad.safeway.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A03525C08@phxmail02.phx.ndchealth.com> Thanks Adam. I am afraid I don't have the luxury of using "date" utility in my Sun Unix OS. :D date: illegal option -- d usage: date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff] Peter ________________________________ 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 Adam Morgan Sent: Friday, May 11, 2007 2:41 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Embedded Perl in a Korn shell program As well as all the good advice you have already received, if you are using the perl purely to add a day to the date in ksh, then you can get that fiunctionality using the gnu date command, for example: date -d "01/01/2002 +1 day" gives "Wed Jan 2 00:00:00 MST 2002" as it's result or date -d "+1 day" gave "Sat May 12 15:39:09 MDT 2007" when I ran it as it is relative to now. ________________________________ From: sanfrancisco-pm-bounces+adam.morgan=safeway.com at pm.org [mailto:sanfrancisco-pm-bounces+adam.morgan=safeway.com at pm.org] On Behalf Of Loo, Peter # PHX Sent: Friday, May 11, 2007 2:10 PM To: sanfrancisco-pm at pm.org Subject: [sf-perl] Embedded Perl in a Korn shell program Hi All, I am trying to add a day to a date using Perl Time::Local library within a Korn shell. However it is not allowing my Korn shell variable to be used within the Perl command. MM=05 DD=06 YYYY=2007 DAY_ADDED=`perl -e 'use Time::Local; ($secs = timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); ($year, $mon, $day) = (localtime($secs))[5,4,3]; $year+=1900; $mon =~ s/^/0/ if $mon < 10; $day =~ s/^/0/ if $day < 10; print $year . $mon . $day;';` echo $DAY_ADDED I am getting the following error: Day '' out of range 1..31 at -e line 1 Then I tried the following and got a different error: PERL_CMD="perl -e 'use Time::Local; (\$secs = timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); (\$year, \$mon, \$day) = (localtime(\$secs))[5,4,3]; \$year+=1900; \$mon =~ s/^/0/ if \$mon < 10; \$day =~ s/^/0/ if \$day < 10; print \$year . \$mon . \$day; ';" DAY_ADDED=`${PERL_CMD}` Can't find string terminator "'" anywhere before EOF at -e line 1. What am I doing wrong here? Peter 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. "MMS " made the following annotations. ------------------------------------------------------------------------ ------ Warning: All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately. ======================================================================== ====== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070511/d1c3b58a/attachment.html From andy at petdance.com Fri May 11 15:11:00 2007 From: andy at petdance.com (Andy Lester) Date: Fri, 11 May 2007 17:11:00 -0500 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03525C08@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com> <5113C869AE8FD844B3589414188D35A9012F750C@PHITPR05EXC01.safeway01.ad.safeway.com> <8E3D502A002DA04FADBDED4CB4D94D3A03525C08@phxmail02.phx.ndchealth.com> Message-ID: On May 11, 2007, at 5:01 PM, Loo, Peter # PHX wrote: > Thanks Adam. I am afraid I don't have the luxury of using "date" > utility in my Sun Unix OS. :D What are you going to do with this date when you're done with it? Take a look here at what I did where I thought I needed to build a date, but I didn't really: http://petdance.livejournal.com/ 124373.html It's in edge_walker's response. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From Peter.Loo at source.wolterskluwer.com Fri May 11 15:27:40 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 11 May 2007 15:27:40 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: References: <8E3D502A002DA04FADBDED4CB4D94D3A03525B59@phxmail02.phx.ndchealth.com><5113C869AE8FD844B3589414188D35A9012F750C@PHITPR05EXC01.safeway01.ad.safeway.com><8E3D502A002DA04FADBDED4CB4D94D3A03525C08@phxmail02.phx.ndchealth.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A03525C4B@phxmail02.phx.ndchealth.com> Here is what I am doing: YYYYMMDD is a value retrieved from a file. This file contains the date of a previously processed file date. export YYYY=`echo $YYYYMMDD | cut -c1-4` export MM=`echo $YYYYMMDD | cut -c5-6` export DD=`echo $YYYYMMDD | cut -c7-8` if [ "$YYYY" = "" -o "$MM" = "" -o "$DD" = "" ]; then MESSAGE="ERROR: Parsing $YYYYMMDD failed." echo "$MESSAGE\n" STATUS=$FAILURE func_Exit $STATUS $LOGFILE fi echo "MM IS: $MM" echo "DD IS: $DD" echo "YYYY IS: $YYYY\n" MMDD=`perl -MTime::Local -MPOSIX -le \ '$secs = timelocal(0,0,0,$ENV{DD},$ENV{MM}-1,$ENV{YYYY}) + 86400; \ print strftime("%m%d", localtime($secs))'` echo "MMDD IS: $MMDD\n" IN_FILE="ndct${MMDD}.gz" Then the IN_FILE is used further in the Korn shell. 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 Andy Lester Sent: Friday, May 11, 2007 3:11 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Embedded Perl in a Korn shell program On May 11, 2007, at 5:01 PM, Loo, Peter # PHX wrote: > Thanks Adam. I am afraid I don't have the luxury of using "date" > utility in my Sun Unix OS. :D What are you going to do with this date when you're done with it? Take a look here at what I did where I thought I needed to build a date, but I didn't really: http://petdance.livejournal.com/ 124373.html It's in edge_walker's response. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance _______________________________________________ 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 Fri May 11 15:38:07 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Fri, 11 May 2007 15:38:07 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03525C4B@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525C4B@phxmail02.phx.ndchealth.com> Message-ID: <20070511223807.GA29805@fu.funkspiel.org> On Fri, May 11, 2007 at 03:27:40PM -0700, Loo, Peter # PHX wrote: > > Here is what I am doing: > > YYYYMMDD is a value retrieved from a file. This file contains the date > of a previously processed file date. Sounds like you're pushing some pretty complicated syntax and semantics into a flat file. Of course, I don't know if you have Korn-specific stuff in there, but... have you considered using a relational database instead? -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From Adam.Morgan at safeway.com Fri May 11 15:43:41 2007 From: Adam.Morgan at safeway.com (Adam Morgan) Date: Fri, 11 May 2007 16:43:41 -0600 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03525C08@phxmail02.phx.ndchealth.com> Message-ID: <5113C869AE8FD844B3589414188D35A9012F750D@PHITPR05EXC01.safeway01.ad.safeway.com> Sorry - I use it on Solaris 7 thru 9, so I must have a custom install. ________________________________ From: sanfrancisco-pm-bounces+adam.morgan=safeway.com at pm.org [mailto:sanfrancisco-pm-bounces+adam.morgan=safeway.com at pm.org] On Behalf Of Loo, Peter # PHX Sent: Friday, May 11, 2007 3:01 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Embedded Perl in a Korn shell program Thanks Adam. I am afraid I don't have the luxury of using "date" utility in my Sun Unix OS. :D date: illegal option -- d usage: date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff] Peter ________________________________ 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 Adam Morgan Sent: Friday, May 11, 2007 2:41 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Embedded Perl in a Korn shell program As well as all the good advice you have already received, if you are using the perl purely to add a day to the date in ksh, then you can get that fiunctionality using the gnu date command, for example: date -d "01/01/2002 +1 day" gives "Wed Jan 2 00:00:00 MST 2002" as it's result or date -d "+1 day" gave "Sat May 12 15:39:09 MDT 2007" when I ran it as it is relative to now. ________________________________ From: sanfrancisco-pm-bounces+adam.morgan=safeway.com at pm.org [mailto:sanfrancisco-pm-bounces+adam.morgan=safeway.com at pm.org] On Behalf Of Loo, Peter # PHX Sent: Friday, May 11, 2007 2:10 PM To: sanfrancisco-pm at pm.org Subject: [sf-perl] Embedded Perl in a Korn shell program Hi All, I am trying to add a day to a date using Perl Time::Local library within a Korn shell. However it is not allowing my Korn shell variable to be used within the Perl command. MM=05 DD=06 YYYY=2007 DAY_ADDED=`perl -e 'use Time::Local; ($secs = timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); ($year, $mon, $day) = (localtime($secs))[5,4,3]; $year+=1900; $mon =~ s/^/0/ if $mon < 10; $day =~ s/^/0/ if $day < 10; print $year . $mon . $day;';` echo $DAY_ADDED I am getting the following error: Day '' out of range 1..31 at -e line 1 Then I tried the following and got a different error: PERL_CMD="perl -e 'use Time::Local; (\$secs = timelocal(0,0,0,$MM,$DD,$YYYY) + 86400); (\$year, \$mon, \$day) = (localtime(\$secs))[5,4,3]; \$year+=1900; \$mon =~ s/^/0/ if \$mon < 10; \$day =~ s/^/0/ if \$day < 10; print \$year . \$mon . \$day; ';" DAY_ADDED=`${PERL_CMD}` Can't find string terminator "'" anywhere before EOF at -e line 1. What am I doing wrong here? Peter 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. "MMS " made the following annotations. ------------------------------------------------------------------------ ------ Warning: All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately. ======================================================================== ====== "MMS " made the following annotations. ------------------------------------------------------------------------------ Warning: All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately. ============================================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070511/67c1bbeb/attachment.html From Peter.Loo at source.wolterskluwer.com Fri May 11 15:47:03 2007 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 11 May 2007 15:47:03 -0700 Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <20070511223807.GA29805@fu.funkspiel.org> References: <8E3D502A002DA04FADBDED4CB4D94D3A03525C4B@phxmail02.phx.ndchealth.com> <20070511223807.GA29805@fu.funkspiel.org> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A03525C8F@phxmail02.phx.ndchealth.com> Yes Quinn, I did think about using a database to do the date calculation, but because I only need to add a "day" to this single value in the file, I had decided against using the database. It is working great now. Perl is not being used for multiple pass in a loop. 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 Quinn Weaver Sent: Friday, May 11, 2007 3:38 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Embedded Perl in a Korn shell program On Fri, May 11, 2007 at 03:27:40PM -0700, Loo, Peter # PHX wrote: > > Here is what I am doing: > > YYYYMMDD is a value retrieved from a file. This file contains the > date of a previously processed file date. Sounds like you're pushing some pretty complicated syntax and semantics into a flat file. Of course, I don't know if you have Korn-specific stuff in there, but... have you considered using a relational database instead? -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ _______________________________________________ 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 dat1965 at yahoo.com Fri May 11 16:53:06 2007 From: dat1965 at yahoo.com (David Thompson) Date: Fri, 11 May 2007 16:53:06 -0700 (PDT) Subject: [sf-perl] Embedded Perl in a Korn shell program In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A03525C4B@phxmail02.phx.ndchealth.com> Message-ID: <200966.85570.qm@web55108.mail.re4.yahoo.com> --- "Loo, Peter # PHX" wrote: > export YYYY=`echo $YYYYMMDD | cut -c1-4` > export MM=`echo $YYYYMMDD | cut -c5-6` > export DD=`echo $YYYYMMDD | cut -c7-8` [snip] > MMDD=`perl -MTime::Local -MPOSIX -le \ > '$secs = timelocal(0,0,0,$ENV{DD},$ENV{MM}-1,$ENV{YYYY}) + Let me take a stab at a worthy explanation that addresses the original question. Without the export above, you would have had to adjust your quoting to insert the values of the shell variables directly into the perl program, like this, '$secs = timelocal(0,0,0,'$DD','$MM'-1,'$YYYY') + 86400; \ ^^^ ^^^ ^^^^^ The ^^^ are used to point out the shell variables. Larger explanation: You close the quote for the perl code (so that you're back to shell) and so $DD is the shell variable, reqoute to add a comma for perl, then unquote to insert $MM shell variable, requote to tell perl to subtract one, unquote to insert shell's $YYYY, then requote for perl. But that is pedantic. If you really know what you're doing, you could have shortened that to this, '$secs = timelocal(0,0,0,'$DD,$MM-1,$YYYY') + 86400; \ because ksh will correctly expand this portion, $DD,$MM-1,$YYYY as you would expect. You have to know shell parsing syntax pretty well to know why this produces correct results. Turning quotes on and off like this is a pain, but is quite common and historical technique for inserting values of shell variables directly into inline awk programs inside shell scripts. But since perl has its $ENV, it's much cleaner to export the shell variables (exporting a shell variable 'promotes' it to an environment variable, thus available via perl's $ENV hash) and thus you can stay completely inside perl to fetch the value of the exported shell variable, happily avoiding the traditional thorny quoting issues of how-to-get-the-value-of-the-shell-variable-into-your-perl-program. Enjoy! David ____________________________________________________________________________________Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow From extasia at extasia.org Mon May 14 10:04:39 2007 From: extasia at extasia.org (David Alban) Date: Mon, 14 May 2007 10:04:39 -0700 Subject: [sf-perl] Perl in shell Message-ID: <4c714a9c0705141004i350b483cye1bc68d68fe6cf5e@mail.gmail.com> Following up on the recent thread regarding embedding perl in shell code... Sometimes you're maintaining/enhancing a piece of shell code for which you don't have the option to convert it to perl. I recently needed to validate a unix permissions string from within a bash program. I chose to embed the perl code rather than put it in an external file. The perl code is not terribly complex, and shouldn't need to change very much. I write perl rather than shell when I have the choice, but I don't think embedding perl in shell is necessarily a bad thing. It's not difficult to use shell variables in perl. For example: #!/bin/bash var=foo perl -e ' my $var = q{'"$foo"'}; print "$foo\n"; ' This assigns the shell's value of $var to a perl variable named $var and prints the value. Let's look at the quoting to get the shell value: my $var = [a] q{ [b] SINGLEQUOTE [c] DOUBLEQUOTE $foo [c] DOUBLEQUOTE [b] SINGLEQUOTE [a] } [a] is a method you might use to quote your value in perl: my $var = q{foo}; Here we definitely use it to improve readability. Quotes [b] cause a brief respite from the singly quoted portion of the embedded perl code, so that we may reference values in shell variables. Quotes [c] are double quotes in the shell. They are the quotes you'd use in: echo "$var" Note that by defining "my $var ...", I use The Ugly Shell Interpolation for Use in Embedded Perl Code Quoting Method(TM) only to assign the shell value to the perl variable. I don't try embedding that quoting in, say, the print statement, or in other more complex statements. Here's my shell function to check the validity of a numeric unix perms string: #----------------------------------------------------------------------- perms_are_valid () { candidate_perms="$1" perl -e ' use strict; use warnings; # get candidate perms string from shell my $perms = q{'"$candidate_perms"'}; # must be three or four chars long my $perms_length = length $perms; $perms_length != 3 and $perms_length != 4 and exit 1; # if four characters in length, first char must be in [01234] if ( $perms_length == 4 ) { my ( $first_char, $dontcare ) = unpack "A1A*", $perms; $first_char =~ m{ [^01234] }xms and exit 1; } # # can contain only octal digits $perms =~ m{ [^0-7] }xms and exit 1; exit 0 ' perms_validated=$? return $perms_validated } # perms_are_valid When invoked using: for i in 0 foo 2 002 111 400 0755 0855 0779 0664 2755 4755 5755; do if perms_are_valid "$i" ; then results=" valid" else results="NOT valid" fi printf "%6s %s\n" "$i:" "$results" done We get: 0: NOT valid foo: NOT valid 2: NOT valid 002: valid 111: valid 400: valid 0755: valid 0855: NOT valid 0779: NOT valid 0664: valid 2755: valid 4755: valid 5755: NOT valid (One could argue for allowing one- and two-character perms strings, but for my purposes I chose not to allow it.) David P.S. One last note. Be sure not to use single quote characters in comments in the embedded perl! It only takes one instance of a comment like the following (note the single quote hiding as an apostrophe) to cause Badness(TM): # we don't want foo to be greater than bar -- Live in a world of your own, but always welcome visitors. From merlyn at stonehenge.com Mon May 14 11:15:25 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Mon, 14 May 2007 11:15:25 -0700 Subject: [sf-perl] Perl in shell In-Reply-To: <4c714a9c0705141004i350b483cye1bc68d68fe6cf5e@mail.gmail.com> (David Alban's message of "Mon, 14 May 2007 10:04:39 -0700") References: <4c714a9c0705141004i350b483cye1bc68d68fe6cf5e@mail.gmail.com> Message-ID: <86d513nuf6.fsf@blue.stonehenge.com> >>>>> "David" == David Alban writes: David> I write perl rather than shell when I have the choice, but I don't David> think embedding perl in shell is necessarily a bad thing. David> It's not difficult to use shell variables in perl. For example: David> #!/bin/bash David> var=foo David> perl -e ' David> my $var = q{'"$foo"'}; David> print "$foo\n"; David> ' Or just: var="something arbitrarily complex" export var perl -e ' $var = $ENV{var}; ... ' No fancying quoting required. :) -- 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 Mon May 14 11:27:34 2007 From: extasia at extasia.org (David Alban) Date: Mon, 14 May 2007 11:27:34 -0700 Subject: [sf-perl] Perl in shell In-Reply-To: <86d513nuf6.fsf@blue.stonehenge.com> References: <4c714a9c0705141004i350b483cye1bc68d68fe6cf5e@mail.gmail.com> <86d513nuf6.fsf@blue.stonehenge.com> Message-ID: <4c714a9c0705141127p619cdf19i4d39b639a3f41b72@mail.gmail.com> Excellent! Thanks. On 5/14/07, Randal L. Schwartz wrote: > Or just: > > var="something arbitrarily complex" > export var > > perl -e ' > $var = $ENV{var}; > ... > ' > > No fancying quoting required. :) -- Live in a world of your own, but always welcome visitors. From quinn at fairpath.com Thu May 17 11:13:38 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Thu, 17 May 2007 11:13:38 -0700 Subject: [sf-perl] Wednesday, May 23: Beer and Scripting SIG Message-ID: <20070517181337.GA87661@fu.funkspiel.org> Late-breaking news: This month our meeting conflicts with a PostgreSQL Users' Group meeting. So, instead, let's meet on Wednesday, at Rich's Beer and Scripting SIG. http://www.cfcl.com/rdm/bass/ More languages + more people = more interesting. I have a speaker lined up for June, but I'm waiting for venue confirmation. More details soon. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From extasia at extasia.org Sat May 19 10:25:03 2007 From: extasia at extasia.org (David Alban) Date: Sat, 19 May 2007 10:25:03 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user Message-ID: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> Greetings, I wrote a tool that performs a code build. It's a command line tool. I'm not very experienced with web programming, and I'm trying to write a perl cgi front end to it that pretty much just invokes the build tool. This is all on internal networks, so there are no internet facing components. This is on linux, with apache. On the machine in question (release management build server), I created the (non-privileged) user 'build'. I want the cgi front end to invoke the build tool as user build, not as the user that owns the httpd processes. I can't figure out how to do this. I thought about making the build tool (owned by build:build) setuid. But I'd rather not allow anyone with a login on the machine to be able to run the build tool. A cow-orker pointed me toward suexec. But suexec looks like its job is to run all cgi programs in a domain as a particular non-privileged user. I only want the build tool to be run as user build. I don't want to change the owner of *any* cgi program, not even my own cgi front end. Any suggestions on how to accomplish this without making the build tool setuid? Pointers to man pages or other online docs welcome. Or do folks pretty much just do the setuid thing? (Maybe make the build tool setuid but put it down a path only reachable by user build and the group of the user running the web server...?) Is there a better / more web-programming-standard way? Thanks, David -- Live in a world of your own, but always welcome visitors. From david at fetter.org Sat May 19 10:52:27 2007 From: david at fetter.org (David Fetter) Date: Sat, 19 May 2007 10:52:27 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user In-Reply-To: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> References: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> Message-ID: <20070519175227.GD26453@fetter.org> On Sat, May 19, 2007 at 10:25:03AM -0700, David Alban wrote: > Greetings, > > I wrote a tool that performs a code build. It's a command line > tool. I'm not very experienced with web programming, and I'm trying > to write a perl cgi front end to it that pretty much just invokes > the build tool. This is all on internal networks, so there are no > internet facing components. This is on linux, with apache. > > On the machine in question (release management build server), I > created the (non-privileged) user 'build'. I want the cgi front end > to invoke the build tool as user build, not as the user that owns > the httpd processes. I can't figure out how to do this. I thought > about making the build tool (owned by build:build) setuid. But I'd > rather not allow anyone with a login on the machine to be able to > run the build tool. > > A cow-orker pointed me toward suexec. But suexec looks like its job > is to run all cgi programs in a domain as a particular > non-privileged user. I only want the build tool to be run as user > build. I don't want to change the owner of *any* cgi program, not > even my own cgi front end. > > Any suggestions on how to accomplish this without making the build > tool setuid? Pointers to man pages or other online docs welcome. > Or do folks pretty much just do the setuid thing? > > (Maybe make the build tool setuid but put it down a path only > reachable by user build and the group of the user running the web > server...?) Is there a better / more web-programming-standard way? I think you might want to look into the fine-grained control that sudo provides. You can, for example, allow the "nobody" user to execute exactly one command without password authentication as the "build" user. Yeah, I know it's not the perliest thing to do, but perl isn't the right tool for *every* job :) Cheers, D -- 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 extasia at extasia.org Sat May 19 11:04:13 2007 From: extasia at extasia.org (David Alban) Date: Sat, 19 May 2007 11:04:13 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user In-Reply-To: <20070519175227.GD26453@fetter.org> References: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> <20070519175227.GD26453@fetter.org> Message-ID: <4c714a9c0705191104p40004b81ga4e33613fb75b946@mail.gmail.com> On 5/19/07, David Fetter wrote: > I think you might want to look into the fine-grained control that sudo > provides. You can, for example, allow the "nobody" user to execute > exactly one command without password authentication as the "build" > user. Oh yeah, I forgot to say that sudo is the *first* thing I tried. :-) I added a line in /etc/sudoers that allowed apache (who owns our httpd processes) to run the build too. Didn't work. I figured there was a problem when from root I tried to su to apache to run the sudo manually and su said something like user apache (who owns our httpd processes) was unavailable. Probably doesn't have a shell. I didn't look. Or perhaps my lack of apache knowledge is at work here. Even though user apache shows up in the process table as owning the httpd processes, should I still try sudo for user 'nobody'? I can try that on Monday. > Yeah, I know it's not the perliest thing to do, but perl isn't the > right tool for *every* job :) TMTOTTDI? (more than one *tool*... :-) -- Live in a world of your own, but always welcome visitors. From quinn at fairpath.com Sat May 19 14:59:34 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Sat, 19 May 2007 14:59:34 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user In-Reply-To: <4c714a9c0705191104p40004b81ga4e33613fb75b946@mail.gmail.com> References: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> <20070519175227.GD26453@fetter.org> <4c714a9c0705191104p40004b81ga4e33613fb75b946@mail.gmail.com> Message-ID: <20070519215933.GA8074@fu.funkspiel.org> On Sat, May 19, 2007 at 11:04:13AM -0700, David Alban wrote: > On 5/19/07, David Fetter wrote: > > I think you might want to look into the fine-grained control that sudo > > provides. You can, for example, allow the "nobody" user to execute > > exactly one command without password authentication as the "build" > > user. > > Oh yeah, I forgot to say that sudo is the *first* thing I tried. :-) > > I added a line in /etc/sudoers that allowed apache (who owns our > httpd processes) to run the build too. Didn't work. I figured there > was a problem when from root I tried to su to apache to run the sudo > manually and su said something like user apache (who owns our httpd > processes) was unavailable. Probably doesn't have a shell. I didn't > look. > > Or perhaps my lack of apache knowledge is at work here. Even though > user apache shows up in the process table as owning the httpd > processes, should I still try sudo for user 'nobody'? I can try that > on Monday. I wouldn't allow sudo for user 'nobody'. If you do that, you're defeating the intended security for the whole box. nobody is supposed be a user with no privileges; apache and some other packages rely on that. If I were you, I would make the CGI script setuid to the build user. Then you have just one place where you're granting extra privs, rather than altering the expected behavior of nobody system-wide, or altering the behavior of all code running under apache with suexec. Of course, that solution works for CGI only, not for mod_perl. For mod_perl, the solution I've seen is to run a whole separate Apache instance under a different UID. It's a bit of a pain to set up, but there's no good way around it... suexec, as you pointed out, affects all apache children, no matter what URL they're serving/code they're running. -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ From ray at warmroom.com Sat May 19 15:59:47 2007 From: ray at warmroom.com (Ray Baxter) Date: Sat, 19 May 2007 15:59:47 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user In-Reply-To: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> References: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> Message-ID: <464F8163.6070305@warmroom.com> David Alban wrote: > Any suggestions on how to accomplish this without making the build > tool setuid? 1) Have the cgi touch a file. 2) Have the build script user run a cron job every few minutes. Check to see if the sentinel file exists and that there is not a build in process, then delete the file and start the build. Elaborations on this idea: put the e-mail or other user id in the sentinel file. Check to see if that user has permission to request a build if that makes sense. Send them e-mail when the build is completed. Allow for the possibility that two users will have requested a build since the last build. Ray From shift8 at digitrash.com Sat May 19 19:47:28 2007 From: shift8 at digitrash.com (shift8) Date: Sat, 19 May 2007 19:47:28 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user In-Reply-To: <464F8163.6070305@warmroom.com> References: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> <464F8163.6070305@warmroom.com> Message-ID: <1179629249.19425.15.camel@localhost> apache 1.2+ has its own suExec that allows for cgi's *in the home directory of a given user* to run as that user - i've used it before, but long ago. it does work: http://httpd.apache.org/docs/1.3/suexec.html apache 2.0 has a like module: http://httpd.apache.org/docs/2.0/mod/mod_suexec.html On Sat, 2007-05-19 at 15:59 -0700, Ray Baxter wrote: > David Alban wrote: > > Any suggestions on how to accomplish this without making the build > > tool setuid? > > 1) Have the cgi touch a file. > > 2) Have the build script user run a cron job every few minutes. Check to > see if the sentinel file exists and that there is not a build in > process, then delete the file and start the build. > > Elaborations on this idea: put the e-mail or other user id in the > sentinel file. Check to see if that user has permission to request a > build if that makes sense. Send them e-mail when the build is completed. > Allow for the possibility that two users will have requested a build > since the last build. > > Ray > > > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > -- Mechanize something idiosyncratic. From extasia at extasia.org Sat May 19 20:38:26 2007 From: extasia at extasia.org (David Alban) Date: Sat, 19 May 2007 20:38:26 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user In-Reply-To: <20070519215933.GA8074@fu.funkspiel.org> References: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> <20070519175227.GD26453@fetter.org> <4c714a9c0705191104p40004b81ga4e33613fb75b946@mail.gmail.com> <20070519215933.GA8074@fu.funkspiel.org> Message-ID: <4c714a9c0705192038w4e66b81ncc84fcc7cd20725c@mail.gmail.com> I'll try making the cgi program setuid and owned by build:build. Thanks. FYI, the sudo entry would only have allowed 'nobody' specifically to run the build tool as user 'build'. No other commands would have been allowed. No other privilege would have been granted. (It's an internal network, and anyone is allowed to kick off a build...) On 5/19/07, Quinn Weaver wrote: > I wouldn't allow sudo for user 'nobody'. If you do that, you're > defeating the intended security for the whole box. nobody is supposed > be a user with no privileges; apache and some other packages rely on > that. > > If I were you, I would make the CGI script setuid to the build user. > Then you have just one place where you're granting extra privs, > rather than altering the expected behavior of nobody system-wide, > or altering the behavior of all code running under apache with > suexec. > > Of course, that solution works for CGI only, not for mod_perl. For > mod_perl, the solution I've seen is to run a whole separate Apache > instance under a different UID. It's a bit of a pain to set up, but > there's no good way around it... suexec, as you pointed out, affects > all apache children, no matter what URL they're serving/code they're > running. -- Live in a world of your own, but always welcome visitors. From extasia at extasia.org Sat May 19 20:40:11 2007 From: extasia at extasia.org (David Alban) Date: Sat, 19 May 2007 20:40:11 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user In-Reply-To: <464F8163.6070305@warmroom.com> References: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> <464F8163.6070305@warmroom.com> Message-ID: <4c714a9c0705192040oca13698y3b9bf57968d922f2@mail.gmail.com> Yeah, there are any number of workarounds I could do like this, thanks. I'm going to try to go with setuid unless I can't get it to work... On 5/19/07, Ray Baxter wrote: > 1) Have the cgi touch a file. > > 2) Have the build script user run a cron job every few minutes. Check to > see if the sentinel file exists and that there is not a build in > process, then delete the file and start the build. > > Elaborations on this idea: put the e-mail or other user id in the > sentinel file. Check to see if that user has permission to request a > build if that makes sense. Send them e-mail when the build is completed. > Allow for the possibility that two users will have requested a build > since the last build. -- Live in a world of your own, but always welcome visitors. From extasia at extasia.org Sat May 19 20:42:07 2007 From: extasia at extasia.org (David Alban) Date: Sat, 19 May 2007 20:42:07 -0700 Subject: [sf-perl] How to get cgi program to invoke another program as a specific non-privileged user In-Reply-To: <1179629249.19425.15.camel@localhost> References: <4c714a9c0705191025m1b4ffd5fh8189fbb7a94477b5@mail.gmail.com> <464F8163.6070305@warmroom.com> <1179629249.19425.15.camel@localhost> Message-ID: <4c714a9c0705192042k46da661du8eb787caabe05503@mail.gmail.com> umm... awesome! i'll try it. thanks. On 5/19/07, shift8 wrote: > apache 1.2+ has its own suExec that allows for cgi's *in the home > directory of a given user* to run as that user - i've used it before, > but long ago. it does work: > > http://httpd.apache.org/docs/1.3/suexec.html > > apache 2.0 has a like module: > http://httpd.apache.org/docs/2.0/mod/mod_suexec.html -- Live in a world of your own, but always welcome visitors. From quinn at fairpath.com Mon May 21 10:57:49 2007 From: quinn at fairpath.com (Quinn Weaver) Date: Mon, 21 May 2007 10:57:49 -0700 Subject: [sf-perl] FYI: YAPC early-bird registration ends tomorrow Message-ID: <20070521175749.GA27758@fu.funkspiel.org> FYI, for anyone who was thinking of going to YAPC::NA. (It's in Houston this year.) ----- Forwarded message from Jeremy Fluhmann ----- Date: Mon, 21 May 2007 10:47:49 -0500 From: Jeremy Fluhmann To: pm_groups at pm.org Subject: [pm_groups] yapc-na early bird pricing ending Please pass along to your group as you see fit. ---------- Forwarded message ---------- From: Jeremy Fluhmann Date: May 21, 2007 10:47 AM Subject: yapc-na early bird pricing ending To: yapc Early Bird pricing for YAPC::NA 2007 will be ending soon. Register before it's too late! Early Bird pricing ends midnight (CST) Tuesday, May 22nd. If you haven't registered yet, please do so by visiting http://conferences.mongueurs.net/yn2007/. If you already have a login, but haven't purchased your ticket yet, choose the 'Edit profile' from the left menu and follow the 'purchase your conference ticket' link. I apologize for the late notice. As someone mentioned, it's not much of an 'early' bird anymore ;-) Thanks, Jeremy -- 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/ From tony at technicon.com Mon May 21 12:26:24 2007 From: tony at technicon.com (Anthony Mirante) Date: Mon, 21 May 2007 12:26:24 -0700 Subject: [sf-perl] JOB: Perl consultant needed Message-ID: <278E86C2FF57AE45A3FD6B71E07C45D5131AB6@mail.technicon.com> Hi, We are looking for a Perl consultant experienced with Unicode. Here is the short description of what we are looking for: We have a bunch of Excel spreadsheets that have product catalog information. These documents include a number of wide characters which represent fractions, degrees, etc. We would like to define a set of rules to convert the wide characters to numbers and to strip out certain symbols such as degrees. Please shoot me an email if you are interested. Thanks. Tony Mirante TechniCon e: tony at technicon.com w: www.technicon.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20070521/9f69eaf5/attachment.html From david at fetter.org Mon May 21 14:19:53 2007 From: david at fetter.org (David Fetter) Date: Mon, 21 May 2007 14:19:53 -0700 Subject: [sf-perl] PostgreSQL Meeting: Sourceforge Infrastructure Message-ID: <20070521211953.GC28235@fetter.org> Folks, Find out how Sourceforge does it. What: Sourceforge Infrastructure When: Tuesday, May 22 at 7:30PM Who: You, if you like :) Where: Casa Donde 2500B Magnolia Street Oakland CA 94607-2410 +1 415 235 3778 Event Description: Ross Turk of Sourceforge http://sf.net/ will discuss Sourceforge's infrastructure including how PostgreSQL makes the whole thing work. You *will* get lost if you do not print the following URL and bring it with you. http://casadonde.org/ RSVP: ASAP so you can eat Zachary's Pizza. If you have dietary preferences, your reply is a great place to tell me about them. See you tomorrow :) 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 rdm at cfcl.com Tue May 22 12:45:15 2007 From: rdm at cfcl.com (Rich Morin) Date: Tue, 22 May 2007 12:45:15 -0700 Subject: [sf-perl] BASS Meeting (SF), Wed. May 23 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, May 23, 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