From jay at jays.net Wed Dec 7 16:40:23 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 07 Dec 2005 18:40:23 -0600 Subject: [Omaha.pm] Mtg: next Thr Dec 15! Message-ID: <439780F7.1060703@jays.net> Its that time of month again! http://omaha.pm.org/ Come on down! Was that pizza I got last time OK? If I don't get any other feedback or RSVPs I'll get 3 jumbos again. Anyone have any topic suggestions? Questions? Things you're struggling with you'd like us to go over? We're open to anything! If no other suggestions, I'll present my "5 minute" lightning talk: Perl Operator Overloading and Class::Date. I bored the crap out of Robert's class with it last night, so now it's YOUR turn to suffer. -grin- See you there! j Meetings are sponsored by Paragon IT Professionals. Thanks Chad!! http://www.paragondm.com/ From jay at jays.net Wed Dec 7 17:05:27 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 07 Dec 2005 19:05:27 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: References: <7456c398f37fc36d795df9f92898576f@jays.net> <7179bd1132f2babcff8e1c09457a418d@jays.net> <6cb6eebc0511271805n109fd207l95b127cb5367319d@mail.gmail.com> Message-ID: <439786D7.2060901@jays.net> My thoughts on last night's lightning talks: My presentation (tough love, constructive criticism -grin-): - I don't think I did a good job picking a topic, nor delivering it. For starters, I think the subject matter was too advanced. I was surprised no one had played w/ OO coding at all, and if you haven't played w/ objects (at all, in any language?) then Perl operator overloading (which only works for classes) probably isn't interesting, nor is Date::Calc. The fact that I couldn't play off anyone's feedback deadened the energy of my presentation (not to mention my total lack of charisma -laugh-). I need to work on keeping my energy level up w/ a dead (sleeping?) audience. -grin- - If I'm ever invited back, I think I'll just to a big run through of the Acme::* namespace -- all kinds of fun, goofy stuff in there that might hold people's attention better than what I did last night? - Any feedback for me out there? (*cough* bob mccoy? *cough*) - I'm still naive enough to think I could pull off a 1+ hour TT demo if the audience has a touch of web programming experience. With or w/o a behind the scenes tour of www.omnihotels.com. PHP - Perl's Template Toolkit is one of Perl's many PHP-esque toolsets. I'm very versed in TT nowadays. Living and learning, j From jay at jays.net Wed Dec 7 17:15:14 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 07 Dec 2005 19:15:14 -0600 Subject: [Omaha.pm] [Fwd: Newsletter from O'Reilly UG Program, December 2] Message-ID: <43978922.30609@jays.net> Snipped for Perl content only. Looks like a bunch of Perl authors will be @ LISA this year. j ================================================ Upcoming Events ================================================ ***For more events, please see: http://events.oreilly.com/ ***O'Reilly at LISA 2005, San Diego, CA--December 4-9 Authors Eric Allman ("sendmail Desktop Reference" and "sendmail"), David N. Blank-Edelman ("Perl for System Administration"), Gerald Carter ("LDAP System Administration"), Tom Christiansen ("Perl Cookbook," and "Programming Perl"), AEleen Frisch ("Essential System Administration, 3rd Edition" and "Essential Windows NT System Administration"), Tom Limoncelli ("Time Management for System Administrators"), and W. Curtis Preston ("Using SANs and NAS" and "Unix Backup & Recovery") lead sessions at this sys admin confab. And don't miss the special evening with MAKE Magazine on Monday night! From bob at mccoy.net Wed Dec 7 17:43:40 2005 From: bob at mccoy.net (Bob McCoy) Date: Wed, 7 Dec 2005 19:43:40 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: <439786D7.2060901@jays.net> Message-ID: <000d01c5fb98$d0cb91d0$d7730d44@bobnet03> Truth be told ... I thought your presentation was the only coherent one of the lot (don't even get me started on gaming consoles). I missed the first round of talks during the previous week. Obviously they didn't set a very high bar for the students. I was also shocked that, as we are now at the semester's end, that no one in that group had any OO exposure. Here's what I liked most about your presentation -- even though it was ostensibly about operator overloading, the Date example was really useful at showing the power of Perl modules to solve really thorny issues. It was like getting a bonus presentation. I liked it. I was engaged, but you probably couldn't tell as I was at the far back of the room and there was a vast sea of zombie-like faces between us. There was one other guy that seemed to get it. That was the guy who did the talk on SMS messaging. Sandy Vlasnik's class was in there because we had some database projects based on the MovieTickets.com site. I think that title caught her eye. So we had a "field trip." And while the speaker did manage to munge together information from MovieTickets.com and IMDB, his talk really didn't give any insights into the efficacy or the vagaries of the process. Anyway, good job. And if I ever get a semester that's not too hairy, I may return to the Perl Mongers' gatherings. Bob -----Original Message----- From: omaha-pm-bounces at pm.org [mailto:omaha-pm-bounces at pm.org] On Behalf Of Jay Hannah Sent: Wednesday, December 07, 2005 7:05 PM To: Perl Mongers of Omaha, Nebraska USA Subject: Re: [Omaha.pm] Lightning Talks from UNO on Perl! :) My thoughts on last night's lightning talks: My presentation (tough love, constructive criticism -grin-): - I don't think I did a good job picking a topic, nor delivering it. For starters, I think the subject matter was too advanced. I was surprised no one had played w/ OO coding at all, and if you haven't played w/ objects (at all, in any language?) then Perl operator overloading (which only works for classes) probably isn't interesting, nor is Date::Calc. The fact that I couldn't play off anyone's feedback deadened the energy of my presentation (not to mention my total lack of charisma -laugh-). I need to work on keeping my energy level up w/ a dead (sleeping?) audience. -grin- - If I'm ever invited back, I think I'll just to a big run through of the Acme::* namespace -- all kinds of fun, goofy stuff in there that might hold people's attention better than what I did last night? - Any feedback for me out there? (*cough* bob mccoy? *cough*) - I'm still naive enough to think I could pull off a 1+ hour TT demo if the audience has a touch of web programming experience. With or w/o a behind the scenes tour of www.omnihotels.com. PHP - Perl's Template Toolkit is one of Perl's many PHP-esque toolsets. I'm very versed in TT nowadays. Living and learning, j _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From robert at fulkerson.com Wed Dec 7 18:48:46 2005 From: robert at fulkerson.com (Robert A. Fulkerson) Date: Wed, 7 Dec 2005 20:48:46 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: <000d01c5fb98$d0cb91d0$d7730d44@bobnet03> References: <439786D7.2060901@jays.net> <000d01c5fb98$d0cb91d0$d7730d44@bobnet03> Message-ID: <6cb6eebc0512071848y56ec52d4i25922d5be2e40480@mail.gmail.com> Hello, On 12/7/05, Bob McCoy wrote: > > Truth be told ... I thought your presentation was the only coherent one > of the lot (don't even get me started on gaming consoles). I missed the > first round of talks during the previous week. Obviously they didn't > set a very high bar for the students. The gaming consoles talk was a special guest lecture I offered to Mr. Cavanaugh as he was trying to recruit students for a just-added-on-Tuesday special topics course on the "History of Gaming". Just because a topic may not be of interest to you specifically does not make an irrelevant or "don't even get me started on ..." topic. For the audience of CSCI 2850 students, it was a perfect topic though it had nothing to do with Perl. Frankly, the first week's presentations were better organized and presented than this week's lectures, which was disappointing to me, especially with a larger audience. The technical glitch of the computer rebooting and wiping people's presentation slides off the computer at the beginning of class didn't help matters much. Part of the disappointment rests on my shoulders, as I threw this idea of lightning talks at them only three weeks ago and they didn't have a long time to prepare on top of their other classes' end-of-semester work. Having never seen a lightning talk of my own but having only read about them, I was able to give some guidance but not much. This semester's talks have given me much to think about in how I present the assignment to my students next semester. They will at least know about the assignment from the first day of class and will be more focused in topics they can cover. I was also shocked that, as we are now at the semester's end, that no > one in that group had any OO exposure. Most students in the class have had two or three semesters of OO exposure in C++ and probably Java before getting to the course. The course, however, is structured to be a crash course in Perl including regexes (6-7 weeks), the Apache web server (2 weeks) and CGI programming (the remainder). We do some OO stuff here and there, but that's not the focus of the course. Here's what I liked most about your presentation -- even though it was > ostensibly about operator overloading, the Date example was really > useful at showing the power of Perl modules to solve really thorny > issues. It was like getting a bonus presentation. It was a great presentation, if a little long, Jay. :) At 10 minutes, it _was_ like a bonus presentation ... :) My goal with the talks was to have them investigate something of interest, something exciting to them and then try to excite the audience about those things, too. It became apparent to me last night that not many of the presenters were excited about what they had chosen, which is a shame since there's so much to get excited about. Perhaps next semester as we go through the semester and they _know_ they're giving a talk on something, they can be looking for topics along the way instead of last-minute. Sandy Vlasnik's class was in there because we had some database projects > based on the MovieTickets.com site. I think that title caught her eye. > So we had a "field trip." And while the speaker did manage to munge > together information from MovieTickets.com and IMDB, his talk really > didn't give any insights into the efficacy or the vagaries of the > process. It's difficult to compare Jay's presentation -- by a guy who's been doing Perl for as long as he has and professionally at that -- to the presentation of a student who has only been doing Perl for about 13 weeks and who's just getting his feet wet. I thought that the Google and IMDB::Film presentations were, while rough around the edges, ones that may have sold a few more people on what they can do with Perl. It's a learning process. I expect next semester's talks to be better than this semester's, and once the ball gets rolling and students have seen what's come before them, who knows how good they'll be a year or two down the road. Consider that an early invitation for next semester's talks ... :) -- b -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051208/f1cfd220/attachment.html From dan at linder.org Thu Dec 8 14:27:41 2005 From: dan at linder.org (Daniel Linder) Date: Thu, 8 Dec 2005 16:27:41 -0600 (CST) Subject: [Omaha.pm] Push/pop and guranteed order? Message-ID: <1967.68.13.86.85.1134080861.squirrel@mail.linder.org> Fellow Mongers, When I push values to an array, am I guranteed that they will be returned in the same order when I use "foreach"???Here is my test code: #!perl @CurrentList=(); printf ("Pushing: "); foreach ("A" .. "Z") { ? push @CurrentList, $_; ? printf ("$_ "); } printf ("\nReview:? "); foreach (@CurrentList) { ? printf ("$_ "); } The output of the code looks correct: Pushing: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Review:? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z If not, is there an easy way to create a FIFO (First In, First Out) array?? I don't want to resort to creating a key/value pair (i.e. key/value: 1:A, 2:B, 3:C,...,26:Z) and have to sort on the key. Dan - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computers, I fear the lack of them." -- Isaac Asimov GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051208/93f634fc/attachment.html From andy at petdance.com Thu Dec 8 14:33:42 2005 From: andy at petdance.com (Andy Lester) Date: Thu, 8 Dec 2005 16:33:42 -0600 Subject: [Omaha.pm] Push/pop and guranteed order? In-Reply-To: <1967.68.13.86.85.1134080861.squirrel@mail.linder.org> References: <1967.68.13.86.85.1134080861.squirrel@mail.linder.org> Message-ID: <20051208223342.GD2231@petdance.com> On Thu, Dec 08, 2005 at 04:27:41PM -0600, Daniel Linder (dan at linder.org) wrote: > When I push values to an array, am I guranteed that they will be > returned in the same order when I use "foreach"? Yes. An array is ordered. Hashes are not. > If not, is there an easy way to create a FIFO (First In, First Out) > array?? I don't want to resort to creating a key/value pair (i.e. > key/value: 1:A, 2:B, 3:C,...,26:Z) and have to sort on the key. Are you coming to Perl from having used PHP? xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jay at jays.net Thu Dec 8 19:06:15 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 08 Dec 2005 21:06:15 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: <6cb6eebc0512071848y56ec52d4i25922d5be2e40480@mail.gmail.com> References: <439786D7.2060901@jays.net> <000d01c5fb98$d0cb91d0$d7730d44@bobnet03> <6cb6eebc0512071848y56ec52d4i25922d5be2e40480@mail.gmail.com> Message-ID: <4398F4A7.4080203@jays.net> Robert A. Fulkerson wrote: > It's a learning process. I expect next semester's talks to be > better than this semester's, and once the ball gets rolling and students > have seen what's come before them, who knows how good they'll be a year > or two down the road. Thanks again, Robert! Gong show gong me next time. -grin- Need some sort of 2m warning or something? Interesting HOWTO: http://www.perl.com/pub/a/2004/07/30/lightningtalk.html It would be neat to get a DVD of OSCON/JAPC lightning talks... j From jhannah at omnihotels.com Fri Dec 9 08:31:19 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 9 Dec 2005 10:31:19 -0600 Subject: [Omaha.pm] use lib "$ENV{J}/lib"; Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB4D@exchange2k3.omnihotels.net> This is pretty weird, but I got a call from a friend, and yes, indeed, you can set up @INC via "use lib" using an enfironmental variable... Is that obscure enough for a Friday morning post to this list? -laugh- j $ export J=/tmp $ cat j.pl use lib "$ENV{J}/lib"; print join "\n", @INC; print "\n"; $ perl j.pl /tmp/lib /usr/lib/perl5/site_perl/Omni/MVC /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/i686-linux /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl . From dan at linder.org Fri Dec 9 08:44:30 2005 From: dan at linder.org (Daniel Linder) Date: Fri, 9 Dec 2005 10:44:30 -0600 (CST) Subject: [Omaha.pm] Push/pop and guranteed order? In-Reply-To: <20051208223342.GD2231@petdance.com> References: <1967.68.13.86.85.1134080861.squirrel@mail.linder.org> <20051208223342.GD2231@petdance.com> Message-ID: <16781.12.160.138.78.1134146670.squirrel@mail.linder.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, December 8, 2005 16:33, Andy Lester wrote: > Yes. An array is ordered. Hashes are not. I was thinking as such, but I was running on to few awake brain cells when I asked... >> If not, is there an easy way to create a FIFO (First In, First Out) >> array? I don't want to resort to creating a key/value pair (i.e. >> key/value: 1:A, 2:B, 3:C,...,26:Z) and have to sort on the key. > > Are you coming to Perl from having used PHP? Nah, I'm a perl hack since about '95 or so.? Why do you ask? :) I've dabbled in PHP, but nothing big.? I like how easy it is to make a simple all-in-one web page for simple forms and such.? I'd like to give Mason and/or mod_perl a try to see if I like it over PHP. Dan - - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computers, I fear the lack of them." -- Isaac Asimov GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDmbRusrDMR0/em2gRArZdAJ92WX1IFhlDTUT8O9Gn7u94edI19QCgyReB 7sFHsscARyB9K3btUhqBwu0= =3gAV -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051209/1d638a80/attachment.html From andy at petdance.com Fri Dec 9 08:52:27 2005 From: andy at petdance.com (Andy Lester) Date: Fri, 9 Dec 2005 10:52:27 -0600 Subject: [Omaha.pm] Push/pop and guranteed order? In-Reply-To: <16781.12.160.138.78.1134146670.squirrel@mail.linder.org> References: <1967.68.13.86.85.1134080861.squirrel@mail.linder.org> <20051208223342.GD2231@petdance.com> <16781.12.160.138.78.1134146670.squirrel@mail.linder.org> Message-ID: <20051209165227.GB16943@petdance.com> On Fri, Dec 09, 2005 at 10:44:30AM -0600, Daniel Linder (dan at linder.org) wrote: > > Are you coming to Perl from having used PHP? > > Nah, I'm a perl hack since about '95 or so.? Why do you ask? :) Because in PHP, arrays are ordered like Perl arrays, but sortable in place, and they have string key lookups, like hashes. They're kinda goofy. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jhannah at omnihotels.com Fri Dec 9 11:51:45 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 9 Dec 2005 13:51:45 -0600 Subject: [Omaha.pm] How do I turn 17.1 into "017.100" ? Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB54@exchange2k3.omnihotels.net> Given any number I want a string where (1) the whole string is 7 characters long, (2) there are three digits after the decimal point, and (3) the number is zero padded in front. e.g.: 17.1 becomes "017.100". Is there a printf FORMAT for this? Or is this a 4 liner? Thanks, j From andy at petdance.com Fri Dec 9 11:56:52 2005 From: andy at petdance.com (Andy Lester) Date: Fri, 9 Dec 2005 13:56:52 -0600 Subject: [Omaha.pm] How do I turn 17.1 into "017.100" ? In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB54@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB54@exchange2k3.omnihotels.net> Message-ID: <20051209195652.GA19793@petdance.com> On Fri, Dec 09, 2005 at 01:51:45PM -0600, Jay Hannah (jhannah at omnihotels.com) wrote: > Is there a printf FORMAT for this? Or is this a 4 liner? printf "%07.3f", 17.1 perldoc -f sprintf xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From pbaker at omnihotels.com Fri Dec 9 12:03:37 2005 From: pbaker at omnihotels.com (Sean Baker) Date: Fri, 9 Dec 2005 14:03:37 -0600 Subject: [Omaha.pm] How do I turn 17.1 into "017.100" ? Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B03796057@exchange2k3.omnihotels.net> Do you care about numbers that exceed 4 decimals? They'll get chopped in a printf.... pbaker at razorbill:~> perl -e "printf('%07.3f',17.1)" 017.100 pbaker at razorbill:~> perl -e "printf('%07.3f',17.12345)" 017.123 -----Original Message----- From: omaha-pm-bounces at pm.org [mailto:omaha-pm-bounces at pm.org] On Behalf Of Jay Hannah Sent: Friday, December 09, 2005 1:52 PM To: omaha-pm at pm.org Subject: [Omaha.pm] How do I turn 17.1 into "017.100" ? Given any number I want a string where (1) the whole string is 7 characters long, (2) there are three digits after the decimal point, and (3) the number is zero padded in front. e.g.: 17.1 becomes "017.100". Is there a printf FORMAT for this? Or is this a 4 liner? Thanks, j _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From jay at jays.net Fri Dec 9 12:19:20 2005 From: jay at jays.net (Jay Hannah) Date: Fri, 09 Dec 2005 14:19:20 -0600 Subject: [Omaha.pm] How do I turn 17.1 into "017.100" ? In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B03796057@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B03796057@exchange2k3.omnihotels.net> Message-ID: <4399E6C8.8010200@jays.net> Shweet. Thanks guys. IRC gave me the answer too, but you beat 'em to it. :) irc.freenode.net #perl is handy when you're really stuck. j From andy at petdance.com Fri Dec 9 12:22:57 2005 From: andy at petdance.com (Andy Lester) Date: Fri, 9 Dec 2005 14:22:57 -0600 Subject: [Omaha.pm] How do I turn 17.1 into "017.100" ? In-Reply-To: <4399E6C8.8010200@jays.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B03796057@exchange2k3.omnihotels.net> <4399E6C8.8010200@jays.net> Message-ID: <20051209202257.GB19793@petdance.com> On Fri, Dec 09, 2005 at 02:19:20PM -0600, Jay Hannah (jay at jays.net) wrote: > > Shweet. Thanks guys. IRC gave me the answer too, but you beat 'em to it. :) > > irc.freenode.net #perl is handy when you're really stuck. I'm usually over on irc.perl.org #perl, but that's not a help channel. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jbisbee at gmail.com Sun Dec 11 17:11:46 2005 From: jbisbee at gmail.com (Jeff Bisbee) Date: Sun, 11 Dec 2005 20:11:46 -0500 Subject: [Omaha.pm] use lib "$ENV{J}/lib"; In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB4D@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB4D@exchange2k3.omnihotels.net> Message-ID: On 12/9/05, Jay Hannah wrote: > This is pretty weird, but I got a call from a friend, and yes, indeed, > you can set up @INC via "use lib" using an enfironmental variable... If you're going to modify an environment variable why not PERL5LIB? (It's how we manage things at work). (use "$ENV{J}/lib" is a cool trick though) :) Another trick I do is to define environment vars to turn on bits of debugging. use constant DEV_REQUEST => $ENV{DEV_REQUEST} || 0; ... warn "new request" if DEV_REQUEST; Since this is done in mod_perl, if its false, the will be completely skipped if DEV_REQUEST if false. -- Jeff Bisbee / jbisbee at gmail.com / jbisbee.com From jay at jays.net Sun Dec 11 19:45:04 2005 From: jay at jays.net (Jay Hannah) Date: Sun, 11 Dec 2005 21:45:04 -0600 Subject: [Omaha.pm] use lib "$ENV{J}/lib"; In-Reply-To: References: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB4D@exchange2k3.omnihotels.net> Message-ID: <439CF240.2070000@jays.net> Jeff Bisbee wrote: > On 12/9/05, Jay Hannah wrote: >>This is pretty weird, but I got a call from a friend, and yes, indeed, >>you can set up @INC via "use lib" using an enfironmental variable... > > If you're going to modify an environment variable why not PERL5LIB? > (It's how we manage things at work). (use "$ENV{J}/lib" is a cool > trick though) :) Yes... Using %ENV generally makes me feel dirty. I don't recommend it, but in this case my friend was trying to debug a bunch of vendor supplied code w/ obscure environment variable names and "didn't want to re-write everything". > Another trick I do is to define environment vars to turn on bits of debugging. > > use constant DEV_REQUEST => $ENV{DEV_REQUEST} || 0; > ... > warn "new request" if DEV_REQUEST; > > Since this is done in mod_perl, if its false, the will be completely > skipped if DEV_REQUEST if false. We're currently handling this sort of debug switching via Log::Log4perl, which is pretty handy. Haven't heard from you in a while. I thought maybe Florida swallowed you up? -grin- (Tangent: Perhaps we should order t-shirts again before the 2 year anniv rolls around and they might chuck our screen?) j From jay at jays.net Tue Dec 13 20:29:59 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 13 Dec 2005 22:29:59 -0600 Subject: [Omaha.pm] Template Toolkit MACRO Message-ID: <439F9FC7.6030405@jays.net> Hey Dave -- I'm hoping you can help me with an apparent MACRO problem in the Perl Mongers bin/build script. When I run the script, it runs for all source files creating all the destination files, but then this source: Select a continent: [% link_to("/groups/africa.html", "Africa") %], [% link_to("/groups/asia.html", "Asia") %], [% link_to("/groups/central_america.html", "Central America") %], [% link_to("/groups/europe.html", "Europe") %], [% link_to("/groups/non_geographical.html", "Non-geographical") %], [% link_to("/groups/north_america.html", "North America") %], [% link_to("/groups/oceania.html", "Oceania") %], [% link_to("/groups/south_america.html", "South America") %]. Turns into this output: Select a continent: , , , , , , , . So it looks like TT is not finding link_to(). link_to() lives in lib/layout like so: [% MACRO link_to(url, text) BLOCK %] [% text %] [% END %] and the bin/build script below uses INCLUDE_PATH 'lib', and the source file in question starts with [% WRAPPER layout title = "Perl Mongers: User groups" %] So shouldn't link_to() work and kick out URLs? It concerns me that when I rename the link_to() to anything else, TT still doesn't complain... How do I debug this thing? DEBUG_ALL => 1 in the Template->new() call doesn't seem to do anything... I'm not used to TT macros... Thanks, j bin/build: -------------------------- #!/usr/bin/perl -w use strict; use File::Copy; use File::Find::Rule; use File::Path; use File::Spec::Functions qw(splitpath); use Template; my $tt = Template->new({ POST_CHOMP => 1, PRE_CHOMP => 1, TRIM => 1, EVAL_PERL => 1 , INCLUDE_PATH => ['.', 'lib', 'src'], }); my $source = 'src'; my $destination = 'www'; my $parms; my $rule = File::Find::Rule->new; $rule->or( $rule->new->directory->name('.svn')->prune->discard, $rule->new ); my @files = $rule->file()->name(qr/^.[^~]+$/)->in($source); foreach my $file (@files) { print STDERR $file, "\n"; my $destfile = $file; $destfile =~ s/^$source/$destination/; my($volume, $directories, $filepart) = splitpath($destfile); mkpath $directories; warn "$file -> $destfile\n"; if ($file =~ /\.png$/) { copy($file, $destfile); } else { $tt->process($file, $parms, $destfile) || die $tt->error; } } From rps at willcomminc.com Thu Dec 15 10:53:29 2005 From: rps at willcomminc.com (Ryan Stille) Date: Thu, 15 Dec 2005 12:53:29 -0600 Subject: [Omaha.pm] DBI odbc question Message-ID: <9A8B75E3985324438F1BFA08B160E82057B2CD@suxsvr.willconsult.com> I am working on a script that inserts records into a Progress database. The script connects via DBI and odbc. As I loop through each potential record to import, I query the database for some info. Occasionally I get errors like this: DBD::ODBC::st execute failed: [OpenLink][ODBC][Progress Server]Stale request handle. Request was not opened or has been closed. (1253) (SQL-S1000)(DBD: st_execute/SQLExecute err=-1) at ./siimport.pl line 170. DBD::ODBC::st fetchrow_array failed: (DBD: no select statement currently executing err=-1) at ./siimport.pl line 171. DBD::ODBC::st execute failed: [OpenLink][ODBC][Progress Server]Stale request handle. Request was not opened or has been closed. (1253) (SQL-S1000)(DBD: st_execute/SQLExecute err=-1) at ./siimport.pl line 170. DBD::ODBC::st fetchrow_array failed: (DBD: no select statement currently executing err=-1) at ./siimport.pl line 171. DBD::ODBC::st execute failed: [OpenLink][ODBC][Progress Server]Stale request handle. Request was not opened or has been closed. (1253) (SQL-S1000)(DBD: st_execute/SQLExecute err=-1) at ./siimport.pl line 170. DBD::ODBC::st fetchrow_array failed: (DBD: no select statement currently executing err=-1) at ./siimport.pl line 171. On some of the queries I was able to switch from: $sth = $dbh->prepare($query); $rc = $sth->execute(); ($si_owner) = $sth->fetchrow_array(); To: ($si_owner) = $dbh->selectrow_array($query); Which make the problem go away for some reason. I was not able to change all the queries to use selectrow_array of course. But after googling the "select statement currently executing" I came up with this: $dbh->{odbc_exec_direct} = 1; Which made the problem go away completely. But I'd really like to understand why. I hate to see this problem come up again when I put the script into production. The blurb from the documentation was no help: odbc_exec_direct Force DBD::ODBC to use SQLExecDirect instead of SQLPrepare() then SQLExecute. There are drivers that only support SQLExecDirect and the DBD::ODBC do() override doesn't allow returning result sets. Therefore, the way to do this now is to set the attributed odbc_exec_direct. There are currently two ways to get this: $dbh->prepare($sql, { odbc_exec_direct => 1}); and $dbh->{odbc_exec_direct} = 1; When $dbh->prepare() is called with the attribute "ExecDirect" set to a non-zero value dbd_st_prepare do NOT call SQLPrepare, but set the sth flag odbc_exec_direct to 1. Thanks for any help. -Ryan From jay at jays.net Thu Dec 15 12:22:44 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 15 Dec 2005 14:22:44 -0600 Subject: [Omaha.pm] DBI odbc question In-Reply-To: <9A8B75E3985324438F1BFA08B160E82057B2CD@suxsvr.willconsult.com> References: <9A8B75E3985324438F1BFA08B160E82057B2CD@suxsvr.willconsult.com> Message-ID: <43A1D094.2080203@jays.net> Ryan Stille wrote: > I am working on a script that inserts records into a Progress database. > The script connects via DBI and odbc. Since I don't see a DBD::Progress I guess that's the way to go. http://www.cpan.org/modules/by-module/DBD/ > As I loop through each potential record to import, I query the database > for some info. Occasionally I get errors like this: > > DBD::ODBC::st execute failed: [OpenLink][ODBC][Progress Server]Stale > request handle. Request was not opened or has been closed. (1253) > (SQL-S1000)(DBD: st_execute/SQLExecute err=-1) at ./siimport.pl line > 170. Yikes. I've been doing DBI for years and I've never seen "Stale request handle" before. Sorry. I never use DBD::ODBC. > On some of the queries I was able to switch from: > $sth = $dbh->prepare($query); > $rc = $sth->execute(); > ($si_owner) = $sth->fetchrow_array(); > > To: > ($si_owner) = $dbh->selectrow_array($query); > > Which make the problem go away for some reason. I was not able to > change all the queries to use selectrow_array of course. But after > googling the "select statement currently executing" I came up with this: Generally speaking, that should just be a shortcut that does the same thing behind the scenes. > $dbh->{odbc_exec_direct} = 1; > > Which made the problem go away completely. But I'd really like to > understand why. I hate to see this problem come up again when I put the > script into production. The blurb from the documentation was no help: > > odbc_exec_direct > Force DBD::ODBC to use SQLExecDirect instead of SQLPrepare() then > SQLExecute. There are drivers that only support SQLExecDirect and the > DBD::ODBC do() override doesn't allow returning result sets. Therefore, > the way to do this now is to set the attributed odbc_exec_direct. There > are currently two ways to get this: $dbh->prepare($sql, { > odbc_exec_direct => 1}); and $dbh->{odbc_exec_direct} = 1; When > $dbh->prepare() is called with the attribute "ExecDirect" set to a > non-zero value dbd_st_prepare do NOT call SQLPrepare, but set the sth > flag odbc_exec_direct to 1. No clue. I don't know jack about the internals of ODBC. Many DBI/DBD::* geniuses and authors hang out here: http://lists.cpan.org/showlist.cgi?name=dbi-users Good folk. You may get some answers if you join that list and re-post what you posted to this list. (Excellent explanation of the problem, by the way.) Sorry I couldn't help more, j From jhannah at omnihotels.com Thu Dec 15 14:07:27 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 15 Dec 2005 16:07:27 -0600 Subject: [Omaha.pm] FW: ActiveState ends development of dynamic language plug-ins forMicrosoft Visual Studio Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB97@exchange2k3.omnihotels.net> Doh! j -----Original Message----- From: visualperl-announce-bounces at listserv.ActiveState.com [mailto:visualperl-announce-bounces at listserv.ActiveState.com] On Behalf Of Shantel Shave Sent: Thursday, December 15, 2005 1:53 PM To: visualperl-announce at listserv.ActiveState.com Subject: ActiveState ends development of dynamic language plug-ins forMicrosoft Visual Studio ActiveState has announced the end of engineering support for Visual Perl, Visual Python, and Visual XSLT, effective immediately. The plug-ins will not be updated for Visual Studio 2005, and there will be no further maintenance on the Visual Studio 2003- and 2002-compatible versions. Due to the necessary inclusion of Visual Studio integration code in Visual Perl, Visual Python, and Visual XSLT, the plug-ins can not be open-sourced. Our decision to discontinue these products was driven by the disproportionately large development effort required to keep them in sync with Visual Studio. Despite an avid user base, customer demand did not reach levels required to fund ongoing development. We are committed to working with our customers to miminize any inconvenience that may result from this decision. To that end, ActiveState will: a) at customer's request, replace each commercial plug-in license with a license for Komodo Professional Edition, and each educational plug-in license with a license for Komodo Personal Edition; b) provide unlimited licenses for the current 2003/2002 plug-ins; c) continue to host the installable software for Visual Studio 2003 and 2002, via FTP; d) offer installation and configuration support through June 15, 2006; and e) continue to host the visualperl-discuss, visualpython-discuss, and visual-xslt-discuss mailing lists on ASPN. Existing customers are encouraged to contact Sales at ActiveState.com for further details. _______________________________________________ VisualPerl-announce mailing list VisualPerl-announce at listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs From jay at jays.net Thu Dec 15 16:36:42 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 15 Dec 2005 18:36:42 -0600 Subject: [Omaha.pm] FW: ActiveState ends development of dynamic language plug-ins forMicrosoft Visual Studio In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB97@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B037AFB97@exchange2k3.omnihotels.net> Message-ID: <43A20C1A.1010100@jays.net> Jay Hannah wrote: > ActiveState has announced the end of engineering support for Visual > Perl, > Visual Python, and Visual XSLT, effective immediately. Ack! Sorry about the line wrap. I got my lappie fixed (Thunderbird on OS X), but my work computer (Outlook 2003 on WinX) is still annoying... j From jay at jays.net Thu Dec 15 16:51:15 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 15 Dec 2005 18:51:15 -0600 Subject: [Omaha.pm] Template Toolkit MACRO In-Reply-To: <43A025E8.404@dave.org.uk> References: <439F9FC7.6030405@jays.net> <43A025E8.404@dave.org.uk> Message-ID: <43A20F83.7070708@jays.net> Dave Cross wrote: > Jay Hannah wrote: > >> Hey Dave -- >> >> I'm hoping you can help me with an apparent MACRO problem in the Perl >> Mongers bin/build script. >> >> When I run the script, it runs for all source files creating all the >> destination files, but then this source: >> >> Select a continent: >> [% link_to("/groups/africa.html", "Africa") %], >> [% link_to("/groups/asia.html", "Asia") %], >> [% link_to("/groups/central_america.html", "Central America") %], >> [% link_to("/groups/europe.html", "Europe") %], >> [% link_to("/groups/non_geographical.html", "Non-geographical") %], >> [% link_to("/groups/north_america.html", "North America") %], >> [% link_to("/groups/oceania.html", "Oceania") %], >> [% link_to("/groups/south_america.html", "South America") %]. >> >> Turns into this output: >> >> Select a continent: >> , , , , , , , . > > > Jay, > > The problem wasn't the MACRO, it was the WRAPPER. Previously bin/build > used PRE_PROCESS and POST_PROCESS instead of WRAPPER but I changed it > recently as I thought it was tidier. Unfortunately it was the side > effect that the MACROs defined in the WRAPPER template weren't defined > at the point at which they were used. > > I've fixed this by creating a new template (lib/macro) which contains > all of the macros (or, at least, all the ones I could find) which is > PRE_PROCESSed before each template. Thereby ensuring that the MACROs are > correctly defined. > > If you update your svn repository, then it should all start to work. > > Sorry for causing problems. No worries. Thanks for the help! Once I study the changes hopefully I'll be able to figure that out all by my lonesome next time. j hoping my line wrap is fixed like I think it is -grin- From jay at jays.net Thu Dec 15 16:54:07 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 15 Dec 2005 18:54:07 -0600 Subject: [Omaha.pm] [Fwd: [pm_groups] Census Results] Message-ID: <43A2102F.3030602@jays.net> FYI. I assume today "tomorrow" is yesterday now, so it's OK to broadcast this. :) j -------- Original Message -------- Subject: [pm_groups] Census Results Date: Tue, 13 Dec 2005 22:38:01 +0000 From: Dave Cross To: pm_groups at pm.org I'll be announcing this to the rest of the world tomorrow, but you can get a sneak preview of the full census results from http://pm.org/census/ Currently that page only has links to the data returned by each group together with information about the groups who either said they were now inactive or didn't reply at all. Later on I intend to add some summary reports. The next step will be to use this data to clean up the pm.org DNS records and remove dead web sites. This will hopefully happen early next year. Dave... -- 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 From jhannah at omnihotels.com Fri Dec 16 11:07:08 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 16 Dec 2005 13:07:08 -0600 Subject: [Omaha.pm] Safely instantiate (or not) a class that may or may not exist? Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFBA9@exchange2k3.omnihotels.net> [Attempt #1 to describe my problem.] Howdy! I've got a chuck of code. For most partner_id's, I have an OutboundHeader. For some, though, I don't. So I'm trying to safely trap the possible non-existance using eval like so: my $class = "${namespace}::${partner_id}::OutboundHeader"; my $obj; eval($obj = $class->new(Globals=>$self->Globals)); return 0 if $@; # Header doesn't exist, so skip it. But, no joy. It still pukes out on me: Can't locate object method "new" via package "Model::Rewards::Record::AA::OutboundHeader" (perhaps you forgot to load "Model::Rewards::Record::AA::OutboundHeader"?) at /usr/lib/perl5/site_perl/Omni/MVC/Model/Rewards/File.pm line 428. How can I ask Perl if it can find a class, and skip instantiation if it can't find it? [Attempt #2 to describe my problem.] This bombs out if there isn't a package "X" with a subroutine "new()": my $class = "X"; my $obj = $class->new(); For any given $class that may or may not exist, how can I ask Perl IF $class->new() is going fatal error or not, w/o a fatal error actually occuring? My attempt at eval() failed... [The solution from IRC] I was using eval() wrong. Curly braces are required/best. This works: my $class = "${namespace}::${partner_id}::OutboundHeader"; my $obj; eval { $obj = $class->new(Globals=>$self->Globals) }; return 0 if $@; # Header doesn't exist, so skip it. I still fear the black magic of eval(). -grin- j From kthompson at omnihotels.com Fri Dec 16 11:14:10 2005 From: kthompson at omnihotels.com (Kenneth Thompson) Date: Fri, 16 Dec 2005 13:14:10 -0600 Subject: [Omaha.pm] Safely instantiate (or not) a class that may or may notexist? Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B03E51F57@exchange2k3.omnihotels.net> Any chance this approach might work? my $obj = ref("${namespace}::${partner_id}::OutboundHeader"); my $class = $obj || ""; return 1 if $class (Completely untested, and off the top of my head...) --------------------- Howdy! I've got a chuck of code. For most partner_id's, I have an OutboundHeader. For some, though, I don't. So I'm trying to safely trap the possible non-existance using eval like so: From jhannah at omnihotels.com Fri Dec 16 11:52:48 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 16 Dec 2005 13:52:48 -0600 Subject: [Omaha.pm] stored procedures Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFBAB@exchange2k3.omnihotels.net> From: Chad Hendren > I had a discussion with an Applications Architect at lunch. It yielded some > interesting points about the use of stored procedures versus not using them. > I hope we get the chance to talk about it at the next PM meeting. I'll be there. -grin- j From jay at jays.net Fri Dec 16 12:41:32 2005 From: jay at jays.net (Jay Hannah) Date: Fri, 16 Dec 2005 14:41:32 -0600 Subject: [Omaha.pm] Safely instantiate (or not) a class that may or may notexist? In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B03E51F57@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B03E51F57@exchange2k3.omnihotels.net> Message-ID: <43A3267C.8010908@jays.net> Kenneth Thompson wrote: > Any chance this approach might work? > > my $obj = ref("${namespace}::${partner_id}::OutboundHeader"); > my $class = $obj || ""; > return 1 if $class > > (Completely untested, and off the top of my head...) I don't think so. AFAIK ref doesn't ever instantiate anything. perldoc -f ref j From jay at jays.net Sat Dec 17 17:02:24 2005 From: jay at jays.net (Jay Hannah) Date: Sat, 17 Dec 2005 19:02:24 -0600 Subject: [Omaha.pm] Template Toolkit MACRO In-Reply-To: <43A025E8.404@dave.org.uk> References: <439F9FC7.6030405@jays.net> <43A025E8.404@dave.org.uk> Message-ID: <43A4B520.6010604@jays.net> Dave Cross wrote: > If you update your svn repository, then it should all start to work. Working poifectly now. Thanks! j From jay at jays.net Sun Dec 18 00:25:24 2005 From: jay at jays.net (Jay Hannah) Date: Sun, 18 Dec 2005 02:25:24 -0600 Subject: [Omaha.pm] Fwd: Apress Quarterly UG Newsletter Message-ID: <43A51CF4.7090805@jays.net> Snipped for Perl content... j 6. The Latest Apress Books--Hot Off the Press "Beginning Perl Web Development: From Novice to Professional" By Steve Suehring November 2005 | ISBN: 1-59059-531-9 | 376 pages | $39.99 http://www.apress.com/book/bookDisplay.html?bID=10009 From jay at jays.net Mon Dec 19 16:34:22 2005 From: jay at jays.net (Jay Hannah) Date: Mon, 19 Dec 2005 18:34:22 -0600 Subject: [Omaha.pm] Add a pipe to a pipe delim file Message-ID: <43A7518E.4040701@jays.net> Problem: You have a pipe delimited file and need to pretend that there's an extra field right after the 9th field. Solution: $ cat j.pl #!/usr/bin/perl while (<>) { my @l = split /\|/; $l[8] = "$l[8]|"; print join "|", @l; } I ran it like so: $ perl j.pl reward_event_ar.unl > reward_event_ar.unl.2 I'm sure there's a shorter solution out there, but that's how I code that solution off the top of my head. j From pbaker at omnihotels.com Tue Dec 20 07:13:25 2005 From: pbaker at omnihotels.com (Sean Baker) Date: Tue, 20 Dec 2005 09:13:25 -0600 Subject: [Omaha.pm] Add a pipe to a pipe delim file Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B0379609B@exchange2k3.omnihotels.net> If all you want to do is add a pipe to the end: perl -pi -e "s/$/|/g" [filename] Or the beginning: perl -pi -e "s/^/|/g" [filename] -----Original Message----- From: omaha-pm-bounces at pm.org [mailto:omaha-pm-bounces at pm.org] On Behalf Of Jay Hannah Sent: Monday, December 19, 2005 6:34 PM To: omaha-pm at pm.org Subject: [Omaha.pm] Add a pipe to a pipe delim file Problem: You have a pipe delimited file and need to pretend that there's an extra field right after the 9th field. Solution: $ cat j.pl #!/usr/bin/perl while (<>) { my @l = split /\|/; $l[8] = "$l[8]|"; print join "|", @l; } I ran it like so: $ perl j.pl reward_event_ar.unl > reward_event_ar.unl.2 I'm sure there's a shorter solution out there, but that's how I code that solution off the top of my head. j _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From jay at jays.net Tue Dec 20 11:16:16 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 20 Dec 2005 13:16:16 -0600 Subject: [Omaha.pm] Add a pipe to a pipe delim file In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B0379609B@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B0379609B@exchange2k3.omnihotels.net> Message-ID: <43A85880.5010909@jays.net> Sean Baker wrote: > If all you want to do is add a pipe to the end: > > perl -pi -e "s/$/|/g" [filename] > > Or the beginning: > > perl -pi -e "s/^/|/g" [filename] Ya. To do what I needed (tweak the 9th column, not the last one), perhaps -a or -F would do that in a one liner? I'm not good with those yet. j perldoc perlrun -a turns on autosplit mode when used with a -n or -p. An implicit split command to the @F array is done as the first thing inside the implicit while loop produced by the -n or -p. perl -ane 'print pop(@F), "\n";' is equivalent to while (<>) { @F = split(' '); print pop(@F), "\n"; } An alternate delimiter may be specified using -F. From pterry2 at mac.com Tue Dec 20 20:38:55 2005 From: pterry2 at mac.com (Philip Terry) Date: Tue, 20 Dec 2005 20:38:55 -0800 Subject: [Omaha.pm] GD::Graph installation on G5 OS X 10.4 In-Reply-To: <9871955.1135139789162.JavaMail.nickgoodyer@mac.com> References: <9871955.1135139789162.JavaMail.nickgoodyer@mac.com> Message-ID: <9461967.1135139935807.JavaMail.pterry2@mac.com> Hello, I would like to install the GD::Graph Perl module on a G5 OS X 10.4 machine to practice building some graphs. This will be my first installation of a module requiring all these libraries ahead of the actual CPAN modules on OS X. Reference: S. Wallace Oreilly book, Perl Graphics Programming (p-26), suggests an order of installation: first need 4 libraries (PNG, zlib, TrueType fonts, JPEG), then libgd, then GD Perl module, apparently finally GD::Graph Perl module 1. PNG graphics library (www.libpng.org/pub/png/libpng.html) the current binary for Mac OS X is libpng 1.2.8-, (Question: appears to be two options here, i.e., a Fink mediated approach or something termed a framework for libpng & zlib frameworks??) Question: can someone recommend how to proceed? (for example, perhaps a download of the GD module from CPAN might take care of the libraries which are supposed to be installed ahead of the GD module?). Thank you for comments, Mike Terry From mat at phpconsulting.com Tue Dec 20 22:10:19 2005 From: mat at phpconsulting.com (Mat Caughron) Date: Wed, 21 Dec 2005 00:10:19 -0600 (CST) Subject: [Omaha.pm] GD::Graph installation on G5 OS X 10.4 In-Reply-To: <9461967.1135139935807.JavaMail.pterry2@mac.com> References: <9871955.1135139789162.JavaMail.nickgoodyer@mac.com> <9461967.1135139935807.JavaMail.pterry2@mac.com> Message-ID: Phil: Does this help at all? http://p5-graph.darwinports.com/ Mat On Tue, 20 Dec 2005, Philip Terry wrote: > Hello, > > I would like to install the GD::Graph Perl module on a G5 OS X 10.4 machine to practice building some graphs. This will be my first installation of a module requiring all these libraries ahead of the actual CPAN modules on OS X. > > Reference: S. Wallace Oreilly book, Perl Graphics Programming (p-26), suggests an order of installation: first need 4 libraries (PNG, zlib, TrueType fonts, JPEG), then libgd, then GD Perl module, apparently finally GD::Graph Perl module > 1. PNG graphics library (www.libpng.org/pub/png/libpng.html) > the current binary for Mac OS X is libpng 1.2.8-, (Question: appears to be two options here, i.e., a Fink mediated approach or something termed a framework for libpng & zlib frameworks??) > > Question: can someone recommend how to proceed? (for example, perhaps a download of the GD module from CPAN might take care of the libraries which are supposed to be installed ahead of the GD module?). > > Thank you for comments, > Mike Terry > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > From mat at phpconsulting.com Tue Dec 20 22:11:36 2005 From: mat at phpconsulting.com (Mat Caughron) Date: Wed, 21 Dec 2005 00:11:36 -0600 (CST) Subject: [Omaha.pm] GD::Graph installation on G5 OS X 10.4 In-Reply-To: <9461967.1135139935807.JavaMail.pterry2@mac.com> References: <9871955.1135139789162.JavaMail.nickgoodyer@mac.com> <9461967.1135139935807.JavaMail.pterry2@mac.com> Message-ID: Mike: Correction, see: http://p5-gdgraph.darwinports.com/ Mat On Tue, 20 Dec 2005, Philip Terry wrote: > Hello, > > I would like to install the GD::Graph Perl module on a G5 OS X 10.4 machine to practice building some graphs. This will be my first installation of a module requiring all these libraries ahead of the actual CPAN modules on OS X. > > Reference: S. Wallace Oreilly book, Perl Graphics Programming (p-26), suggests an order of installation: first need 4 libraries (PNG, zlib, TrueType fonts, JPEG), then libgd, then GD Perl module, apparently finally GD::Graph Perl module > 1. PNG graphics library (www.libpng.org/pub/png/libpng.html) > the current binary for Mac OS X is libpng 1.2.8-, (Question: appears to be two options here, i.e., a Fink mediated approach or something termed a framework for libpng & zlib frameworks??) > > Question: can someone recommend how to proceed? (for example, perhaps a download of the GD module from CPAN might take care of the libraries which are supposed to be installed ahead of the GD module?). > > Thank you for comments, > Mike Terry > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > From jhannah at omnihotels.com Wed Dec 21 07:15:15 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 21 Dec 2005 09:15:15 -0600 Subject: [Omaha.pm] Merry Holidays Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFBD2@exchange2k3.omnihotels.net> > i tried attaching but it didn't like such big attachements so > goto: > http://criffield.net/~eli/tojay/ > insted Cool, thanks. Want to present Python at the next Perl Mongers meeting? We'll have a Python night. ? j From jhannah at omnihotels.com Wed Dec 21 07:31:18 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 21 Dec 2005 09:31:18 -0600 Subject: [Omaha.pm] Next meeting: Tue, Jan 17th 2006 @ 7pm! Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFBD5@exchange2k3.omnihotels.net> I'm not available the 3rd Thr of January, so lets try Tue: http://omaha.pm.org/ Next meeting: Tue, Jan 17th 2006 @ 7pm! I'll try to remember to send another reminder 1 week before. Free food, pop, etc. Thanks Paragon IT Professionals! As always, meeting topics are and/or presentation volunteers are welcome. Otherwise I'll present whatever I've been playing with recently :) See you there! j From Scott.L.Miller at hp.com Wed Dec 21 07:32:35 2005 From: Scott.L.Miller at hp.com (Miller, Scott L (Omaha Networks)) Date: Wed, 21 Dec 2005 09:32:35 -0600 Subject: [Omaha.pm] Next meeting: Tue, Jan 17th 2006 @ 7pm! Message-ID: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302EA0D@omaexc11.americas.cpqcorp.net> Hey! I'd actually be able to make some of the meetings held on Tuesday! -Scott -----Original Message----- From: omaha-pm-bounces at pm.org [mailto:omaha-pm-bounces at pm.org] On Behalf Of Jay Hannah Sent: Wednesday, December 21, 2005 9:31 AM To: omaha-pm at pm.org Cc: eli at criffield.net Subject: [Omaha.pm] Next meeting: Tue, Jan 17th 2006 @ 7pm! I'm not available the 3rd Thr of January, so lets try Tue: http://omaha.pm.org/ Next meeting: Tue, Jan 17th 2006 @ 7pm! I'll try to remember to send another reminder 1 week before. Free food, pop, etc. Thanks Paragon IT Professionals! As always, meeting topics are and/or presentation volunteers are welcome. Otherwise I'll present whatever I've been playing with recently :) See you there! j _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From jay at jays.net Wed Dec 21 17:01:20 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 21 Dec 2005 19:01:20 -0600 Subject: [Omaha.pm] Next meeting: Tue, Jan 17th 2006 @ 7pm! In-Reply-To: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302EA0D@omaexc11.americas.cpqcorp.net> References: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302EA0D@omaexc11.americas.cpqcorp.net> Message-ID: <43A9FAE0.2030005@jays.net> Miller, Scott L (Omaha Networks) wrote: > Hey! I'd actually be able to make some of the meetings held on Tuesday! Great! Maybe we'll see you there! The "third Thursday" thing is totally arbitrary. If anyone wants different dates/times/locations, just speak up. If I don't hear alternate suggestions I just keep plodding forward assuming it works for everyone who cares. j From jay at jays.net Wed Dec 21 18:21:13 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 21 Dec 2005 20:21:13 -0600 Subject: [Omaha.pm] GD::Graph installation on G5 OS X 10.4 In-Reply-To: References: <9871955.1135139789162.JavaMail.nickgoodyer@mac.com> <9461967.1135139935807.JavaMail.pterry2@mac.com> Message-ID: <43AA0D99.3050603@jays.net> Mat Caughron wrote: > Correction, see: > > http://p5-gdgraph.darwinports.com/ Hmm... Theoretically that'd be pretty cool. But I can't get it working on my Mac OS X 10.3.9. (Am I behind on my OS version now?) I followed these instructions http://darwinports.com/ But the next step (according to the instructions) doesn't work: # sudo port -d selfupdate sudo: port: command not found So I ran /usr/libexec/locate.updatedb So I could run locate '/port' Which showed me where "port" is (I think), but then: # sudo /opt/local/bin/port -d selfupdate dyld: /usr/bin/tclsh can't open library: /usr/lib/libcurl.3.dylib (No such file or directory, errno = 2) while executing "load /opt/local/share/darwinports/Tcl/pextlib1.0/Pextlib.dylib" ("package ifneeded" script) invoked from within "package_native require Pextlib 1.0" ("eval" body line 1) invoked from within "eval package_native $args" (procedure "package" line 14) invoked from within "package require Pextlib 1.0" (procedure "dportinit" line 309) invoked from within "dportinit ui_options global_options global_variations" Error: /opt/local/bin/port: Failed to initialize ports system, dyld: /usr/bin/tclsh can't open library: /usr/lib/libcurl.3.dylib (No such file or directory, errno = 2) And since I don't know TCL I don't know what's going on now. Have you had any luck yet Philip? I tend to attempt installing everything from source, and tend to avoid package systems... On Tue, 20 Dec 2005, Philip Terry wrote: > Question: can someone recommend how to proceed? (for example, perhaps a download of the GD module from CPAN might take care of the libraries which are supposed to be installed ahead of the GD module?). In my experience installing the GD module will not install its non-Perl pre-requisites. You need to do that separately, which I've never done on a Mac. The last few times I've tried on Linux (over the last 3-4 years or so) it's always worked on Linux. Your list of dependencies sound right to me. Have you tried to install any of the prereqs? Any luck? j From rps at willcomminc.com Thu Dec 22 09:50:55 2005 From: rps at willcomminc.com (Ryan Stille) Date: Thu, 22 Dec 2005 11:50:55 -0600 Subject: [Omaha.pm] Less is more Message-ID: <9A8B75E3985324438F1BFA08B160E82057B366@suxsvr.willconsult.com> I am was trying to get this done in one line, just for the heck of it. I need the modification time of a file referenced by $file ($file contains the path and filename of the file). @filedate = localtime((stat($file))[9]); ($month,$day,$year) = split(/\//,strftime("%D", at filedate)); But I can't seem to put localtime in place of @filedate: ($month,$day,$year) = split(/\//,strftime("%D",localtime((stat($file))[9]))); Gives me: Type of arg 2 to Date::Format::strftime must be array (not localtime) So I tried to make localtime() return as an array, and here is where I'm not so sure as to what I'm doing. I tried this: ($month,$day,$year) = split(/\//,strftime("%D",(localtime((stat($file))[9])))); And this: ($month,$day,$year) = split(/\//,strftime("%D",(localtime((stat($file))[9]))[])); Which didn't work either. What am I doing wrong? Thanks, -Ryan From jay at jays.net Thu Dec 22 10:22:09 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 22 Dec 2005 12:22:09 -0600 Subject: [Omaha.pm] Less is more In-Reply-To: <9A8B75E3985324438F1BFA08B160E82057B366@suxsvr.willconsult.com> References: <9A8B75E3985324438F1BFA08B160E82057B366@suxsvr.willconsult.com> Message-ID: <43AAEED1.1080406@jays.net> Ryan Stille wrote: > I am was trying to get this done in one line, just for the heck of it. > I need the modification time of a file referenced by $file ($file > contains the path and filename of the file). I don't know how to get that strftime thing working... my ($y, $m, $d) = (localtime((stat($file))[9]))[5,4,3]; $y += 1900; ? j From Chris.Hefling at nmhs.org Thu Dec 22 11:27:20 2005 From: Chris.Hefling at nmhs.org (Hefling, Chris) Date: Thu, 22 Dec 2005 13:27:20 -0600 Subject: [Omaha.pm] Less is more Message-ID: <804D74BA90FBB5418AA7C966CD7D731703210267@w2k3ex01.nmhs.org> This should work... #! /bin/perl use Time::gmtime; use File::stat; $file="test.txt"; # HERE IS THE ONE LINE @modtime=split(" ",localtime(stat($file)->mtime)); # print @modtime[3]; Chris -----Original Message----- From: omaha-pm-bounces at pm.org [mailto:omaha-pm-bounces at pm.org] On Behalf Of Jay Hannah Sent: Thursday, December 22, 2005 12:22 PM To: Perl Mongers of Omaha, Nebraska USA Subject: Re: [Omaha.pm] Less is more Ryan Stille wrote: > I am was trying to get this done in one line, just for the heck of it. > I need the modification time of a file referenced by $file ($file > contains the path and filename of the file). I don't know how to get that strftime thing working... my ($y, $m, $d) = (localtime((stat($file))[9]))[5,4,3]; $y += 1900; ? j _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm This message and any included attachments are from Nebraska Methodist Health System and its affiliates and are intended only for the addressee. The message may contain privileged, confidential and/or proprietary information intended only for the person(s) named. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Nebraska Methodist Health System and its affiliates in Omaha, Nebraska, U.S.A at (402)354-2280. From Andrew.Hadenfeldt at alltel.com Thu Dec 22 21:24:28 2005 From: Andrew.Hadenfeldt at alltel.com (Andrew.Hadenfeldt@alltel.com) Date: Thu, 22 Dec 2005 23:24:28 -0600 Subject: [Omaha.pm] Less is more Message-ID: Not sure why Date::Format might be different, but the POSIX version worked for me: use POSIX qw(strftime); ($month,$day,$year) = split(/\//,strftime("%D",localtime((stat($file))[9]))); -Andy -----Original Message----- From: Ryan Stille [mailto:rps at willcomminc.com] Sent: Thursday, December 22, 2005 11:51 AM To: Perl Mongers of Omaha, Nebraska USA Subject: [Omaha.pm] Less is more I am was trying to get this done in one line, just for the heck of it. I need the modification time of a file referenced by $file ($file contains the path and filename of the file). @filedate = localtime((stat($file))[9]); ($month,$day,$year) = split(/\//,strftime("%D", at filedate)); But I can't seem to put localtime in place of @filedate: ($month,$day,$year) = split(/\//,strftime("%D",localtime((stat($file))[9]))); Gives me: Type of arg 2 to Date::Format::strftime must be array (not localtime) So I tried to make localtime() return as an array, and here is where I'm not so sure as to what I'm doing. I tried this: ($month,$day,$year) = split(/\//,strftime("%D",(localtime((stat($file))[9])))); And this: ($month,$day,$year) = split(/\//,strftime("%D",(localtime((stat($file))[9]))[])); Which didn't work either. What am I doing wrong? Thanks, -Ryan _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, ALLTEL requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From jhannah at omnihotels.com Tue Dec 27 11:20:03 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 27 Dec 2005 13:20:03 -0600 Subject: [Omaha.pm] perl -e '$_ = "jwh"; s/w/ap/; print;' Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFC0D@exchange2k3.omnihotels.net> My new sig. Turns my initials into a glorious acronym. Thanks Sean! j From jay at jays.net Tue Dec 27 12:23:20 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 27 Dec 2005 14:23:20 -0600 Subject: [Omaha.pm] Class::Date makes life cleaner Message-ID: <43B1A2B8.1010208@jays.net> Before Class::Date we used a DateConvert() method we wrote where you had to remember arbitrary conversions like "25" and "2" and "18" and remember what those meant, writing code like this: my $arrival_date = $Folio->get_arrival; $arrival_date = $Folio->DateConvert($arrival_date, 25); my $arrival_time = $Folio->DateConvert($arrival_date, 2); $arrival_date = $Folio->DateConvert($arrival_date, 18); $arrival_date = $Folio->DateConvert($arrival_date, 13); $R_Folio->set_arrival_date($arrival_date); $arrival_time = substr($arrival_time, 0, 5); $arrival_time =~ s/\:+//; $R_Folio->set_arrival_time($arrival_time); my $depart_date = $Folio->get_departure; $depart_date = $Folio->DateConvert($depart_date, 25); my $depart_time = $Folio->DateConvert($depart_date, 2); $depart_date = $Folio->DateConvert($depart_date, 18); $depart_date = $Folio->DateConvert($depart_date, 13); $R_Folio->set_departure_date($depart_date); $depart_time = substr($depart_time, 0, 5); $depart_time =~ s/\:+//; $R_Folio->set_departure_time($depart_time); # ... my $nights = ($depart_date - $arrival_date); $R_Folio->set_number_of_stay_nights($nights); Thanks to Class::Date we can write code like this (our Class::Date wrapper is called Control::DateTime): $R_Folio->set_arrival_depart($Folio->get_arrival, $Folio->get_departure); sub set_arrival_depart { my ($self, $arrival, $depart) = @_; my $arrival = Control::DateTime->new($arrival); my $departure = Control::DateTime->new($depart); $self->set_arrival_date($arrival->format("%Y%m%d")); $self->set_arrival_time($arrival->format("%H%M")); $self->set_departure_date($departure->format("%Y%m%d")); $self->set_departure_time($departure->format("%H%M")); $self->set_number_of_stay_nights( ($departure - $arrival)->day ); return 1; }; Yay! %Y = 4 digit year is a lot easier to remember and read than 25 converts 'Sep 02 2003 12:00AM' to 'yyyy-mm-ddThh:00:00' Here's to progress, -grin- j perl -e '$_ = "jwh"; s/w/ap/; print;' From jhannah at omnihotels.com Wed Dec 28 07:16:06 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 28 Dec 2005 09:16:06 -0600 Subject: [Omaha.pm] Favorite code Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFC1F@exchange2k3.omnihotels.net> > -----Original Message----- > From: Sean Baker > To: Jay Hannah > > This code ROCKS! > > foreach (sort @ls) { > s/\.rrd$//; > next if (/perseus/); > next if (/Expedia/); > next if (/event_notify_/); > next if (/USW\-(cnt|drops)/); > next if (/umm/); > next if (/onstat/); > next if (/e_n_d/); > next if (/(hrms_fpc|rcvlbmn)/); > refresh_graph_level1($_); -laugh- Thanks!! I like it too! Grin, j j a black hat p h From jay at jays.net Wed Dec 28 11:40:48 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 28 Dec 2005 13:40:48 -0600 (CST) Subject: [Omaha.pm] Why I hack Perl Message-ID: This is Date.xs, some C code that Class::Date uses. Glancing at this today reminded me how spoiled I am by being a Perl programmer. j (I'm in pine. I hope this doesn't line wrap.) void strftime_xs(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1) char * fmt int sec int min int hour int mday int mon int year int wday int yday int isdst PPCODE: { char tmpbuf[128]; struct tm mytm; int len; memset(&mytm, 0, sizeof(mytm)); mytm.tm_sec = sec; mytm.tm_min = min; mytm.tm_hour = hour; mytm.tm_mday = mday; mytm.tm_mon = mon; mytm.tm_year = year; mytm.tm_wday = wday; mytm.tm_yday = yday; mytm.tm_isdst = isdst; classdate_mini_mktime(&mytm); CLASSDATE_TM_DEBUG(mytm); len = strftime(tmpbuf, sizeof tmpbuf, fmt, &mytm); /* ** The following is needed to handle to the situation where ** tmpbuf overflows. Basically we want to allocate a buffer ** and try repeatedly. The reason why it is so complicated ** is that getting a return value of 0 from strftime can indicate ** one of the following: ** 1. buffer overflowed, ** 2. illegal conversion specifier, or ** 3. the format string specifies nothing to be returned(not ** an error). This could be because format is an empty string ** or it specifies %p that yields an empty string in some locale. ** If there is a better way to make it portable, go ahead by ** all means. */ if ((len > 0 && len < sizeof(tmpbuf)) || (len == 0 && *fmt == '\0')) ST(0) = sv_2mortal(newSVpv(tmpbuf, len)); else { /* Possibly buf overflowed - try again with a bigger buf*/ int fmtlen = strlen(fmt); int bufsize = fmtlen + sizeof(tmpbuf); char* buf; int buflen; New(0, buf, bufsize, char); while (buf) { CLASSDATE_TM_DEBUG(mytm); ...etc... From jhannah at omnihotels.com Thu Dec 29 05:14:28 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 29 Dec 2005 07:14:28 -0600 Subject: [Omaha.pm] Test::More skip_all Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFC32@exchange2k3.omnihotels.net> skip_all is pretty handy. One of our vendors is transitioning from one file format to another, so our automated tests are broken for now. I want to rework all the tests once I get their new spec, though, so I don't want to just nuke the test script altogether. I just want to skip all the tests in Inbound.t for now... That's what skip_all does in the top of your .t file: --- $ head -1 Inbound.t use Test::More ( skip_all => 'AA is in transition to new format' ); $ perl Inbound.t 1..0 # Skip AA is in transition to new format $ prove Inbound.t Inbound....skipped all skipped: AA is in transition to new format All tests successful, 1 test skipped. Files=1, Tests=0, 0 wallclock secs ( 0.03 cusr + 0.01 csys = 0.04 CPU) --- Handy, huh? j From jhannah at omnihotels.com Thu Dec 29 06:24:37 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 29 Dec 2005 08:24:37 -0600 Subject: [Omaha.pm] Class::Date objects in scalar context perl 5.8.3 vs. 5.8.7? or something else? Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFC34@exchange2k3.omnihotels.net> Hi dLux -- I was wondering if you had any idea what is happening here off the top of your head... Here's my test script: $ cat j.t use Test::More tests => 1; use Class::Date qw(:errors -DateParse ) ; my $d = Class::Date->new("2005-08-03"); print "$d\n"; is($d, "2005-08-03", "???"); Pretty straight-forward, right? Yet undef Perl 5.8.3 the test script passes when it shouldn't? $ /usr/bin/perl5.8.3 j.t 1..1 2005-08-03 00:00:00 ok 1 - ??? Perl 5.8.7 fails as expected: $ /usr/bin/perl5.8.7 j.t 1..1 2005-08-03 00:00:00 not ok 1 - ??? # Failed test '???' # in j.t at line 5. # got: '2005-08-03 00:00:00' # expected: '2005-08-03' # Looks like you failed 1 test of 1. And I'm having a hard time blaming Test::More, since this behaves as expected under 5.8.3: $ cat j.t use Test::More tests => 1; is("2005-08-03 00:00:00", "2005-08-03", "???"); $ /usr/bin/perl5.8.3 j.t 1..1 not ok 1 - ??? # Failed test (j.t at line 2) # got: '2005-08-03 00:00:00' # expected: '2005-08-03' # Looks like you failed 1 test of 1. So somewhere something is going wrong inside Test::More's use of your string() overload in Class::Date? uhhh... Any thoughts would be appreciated. Thanks! j From sidney.omaha.pm at gmail.com Thu Dec 29 09:25:29 2005 From: sidney.omaha.pm at gmail.com (sidney.omaha.pm@gmail.com) Date: Thu, 29 Dec 2005 11:25:29 -0600 Subject: [Omaha.pm] My lost week problem.. In-Reply-To: Message-ID: <3.0.6.32.20051229112529.007ce580@pop.radiks.net> The week between Christmas and New Years is called, in some circles, the lost week and in others, cleanup week. Generally, not much work gets done but interesting projects that might be useful or helpful if people had time to play with them are dragged out and finished or dropped. I got a late start this year, and I'm afraid my lost week project is beyond me anyway. So I'm offering it up as a challenge to anyone interested before I drop it in the circular file. At http://samoyed.org/rescue_org.html (Samoyed.org) and http://www.samoyedrescue.com/availabledogs.htm (aka SRA) each list Samoyed dogs living with various rescue groups across the US and Canada while waiting for good homes. The pages are run by different people who are not competitive but rather very cooperative. The listings on samoyed.org are sent via email to a volunteer who formats them using an Excel spreadsheet. They are posted by copying and pasting the speadsheet into a big box on a web form, which runs a perl script which splits each line on the tabs, dealing with odd line wraps, and formats it into html table tags. I wrote that script, but do not pretend to remember it, and expect it's probably a large plate of spagetti. The SRA page uses some code supplied by petfinder to display listings from the petfinder database in an iframe:
Scroll down to see more dogs
Not everyone who rescues dogs is capable of or cares to figure out how to use petfinder, in case anyone is wondering why we don't just tell people to get a petfinder account and use the above code on both pages. Now what I want to do is change the page at samoyed.org to a script that reads in the listings formatted from the excel spreadsheet, sorts them by state and city (probably from a file that gets updated whenever the excel spreadsheet is pasted into the big box - the sorting by state and city can be done when that file is created. I think. ) calls up and sorts the listings from petfinder by state and city (petfinder uses zipcode,) and conglomerates the two into one sorted and nicely formatted table. If I can make it work on samoyed.org, I will send the script to SRA, and they will use it there too if they can run perl scripts - I don't know. From jay at jays.net Thu Dec 29 11:08:49 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 29 Dec 2005 13:08:49 -0600 Subject: [Omaha.pm] My lost week problem.. In-Reply-To: <3.0.6.32.20051229112529.007ce580@pop.radiks.net> References: <3.0.6.32.20051229112529.007ce580@pop.radiks.net> Message-ID: <43B43441.1080300@jays.net> sidney.omaha.pm at gmail.com wrote: > Now what I want to do is change the page at samoyed.org to a script that > reads in the listings formatted from the excel spreadsheet, sorts them by > state and city (probably from a file that gets updated whenever the excel > spreadsheet is pasted into the big box - the sorting by state and city can > be done when that file is created. I think. ) calls up and sorts the > listings from petfinder by state and city (petfinder uses zipcode,) and > conglomerates the two into one sorted and nicely formatted table. If I can > make it work on samoyed.org, I will send the script to SRA, and they will > use it there too if they can run perl scripts - I don't know. Are you stuck on a specific step of this multi-step task? j From jhannah at omnihotels.com Thu Dec 29 11:15:13 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 29 Dec 2005 13:15:13 -0600 Subject: [Omaha.pm] Class::Date truncate() Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFC3C@exchange2k3.omnihotels.net> Used Class::Date's truncate() for the first time today. print $arrival; # 2005-11-07 12:57:39 print $depart; # 2005-12-21 00:00:00 print ($depart - $arrival)->day; # 43.4599652777778 Whoah. We only deal in integer lengths of stay ("how many nights is the guest staying?"), so that fraction is interesting, but unhelpful. Call truncate() on your Class::Date objects and the time drops away. $arrival = $arrival->truncate; # 2005-11-07 00:00:00 $depart = $depart->truncate; # 2005-12-21 00:00:00 print ($depart - $arrival)->day; # 44 j From jhannah at omnihotels.com Thu Dec 29 11:23:41 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 29 Dec 2005 13:23:41 -0600 Subject: [Omaha.pm] My lost week problem.. Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFC3D@exchange2k3.omnihotels.net> >> From: omaha-pm-bounces at pm.org [mailto:omaha-pm-bounces at pm.org] On Behalf Of sidney.omaha.pm at gmail.com From: Kenneth Thompson > AAAAHHHHHHH. This "from" address scared me. I thought for an > instant perhaps a certain someone was going to now review the > pm content. Our mailing list is not moderated. Mailman supports that, but I have no interest in trying to censor anyone/anything in advance. I don't know why the From: looked like that on that message. If people started spamming the list w/ viagra ads or something I'd blacklist them, but I can't imagine we'll ever moderate the main Omaha Perl Mongers mailing list. j From sidney.omaha.pm at gmail.com Thu Dec 29 11:49:41 2005 From: sidney.omaha.pm at gmail.com (sidney.omaha.pm@gmail.com) Date: Thu, 29 Dec 2005 13:49:41 -0600 Subject: [Omaha.pm] My lost week problem.. In-Reply-To: <43B43441.1080300@jays.net> References: <3.0.6.32.20051229112529.007ce580@pop.radiks.net> <3.0.6.32.20051229112529.007ce580@pop.radiks.net> Message-ID: <3.0.6.32.20051229134941.007ddb70@pop.radiks.net> At 01:08 PM 12/29/2005 -0600, Jay Hannah wrote: >Are you stuck on a specific step of this multi-step task? I haven't been able to figure out how to pull the listings from petfinder into a file so I can do things to them. -Sidney (whadja mean the from address scared you? I am not the least bit scarey. Well, ok, maybe when I was talking about geek knitting, with diagrams and photos at the last meeting, but really that was only a momentary lapse!) From jay at jays.net Thu Dec 29 14:45:21 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 29 Dec 2005 16:45:21 -0600 Subject: [Omaha.pm] My lost week problem.. In-Reply-To: <3.0.6.32.20051229134941.007ddb70@pop.radiks.net> References: <3.0.6.32.20051229112529.007ce580@pop.radiks.net> <3.0.6.32.20051229112529.007ce580@pop.radiks.net> <3.0.6.32.20051229134941.007ddb70@pop.radiks.net> Message-ID: <43B46701.9000503@jays.net> sidney.omaha.pm at gmail.com wrote: > I haven't been able to figure out how to pull the listings from petfinder > into a file so I can do things to them. Can you give us an example URL? > (whadja mean the from address scared you? I am not the least bit scarey. > Well, ok, maybe when I was talking about geek knitting, with diagrams and > photos at the last meeting, but really that was only a momentary lapse!) Due to the weird "From:" in your last email Kenn thought I deccided to start moderating our mailing list. I didn't and won't. Happy almost new year, everybody! j From sidney.omaha.pm at gmail.com Thu Dec 29 15:43:30 2005 From: sidney.omaha.pm at gmail.com (sidney.omaha.pm@gmail.com) Date: Thu, 29 Dec 2005 17:43:30 -0600 Subject: [Omaha.pm] My lost week problem.. In-Reply-To: <43B46701.9000503@jays.net> References: <3.0.6.32.20051229134941.007ddb70@pop.radiks.net> <3.0.6.32.20051229112529.007ce580@pop.radiks.net> <3.0.6.32.20051229112529.007ce580@pop.radiks.net> <3.0.6.32.20051229134941.007ddb70@pop.radiks.net> Message-ID: <3.0.6.32.20051229174330.007eea70@pop.radiks.net> At 04:45 PM 12/29/2005 -0600, Jay Hannah wrote: >Can you give us an example URL? > http://www.samoyed.org/rescuelist.html has the list generated from the excel spreadsheet (just the table part, the rest is just boilerplate) and http://www.samoyedrescue.com/availabledogs.htm has the listings served from petfinder. I want to combine all the listings on one page without just pasting the petfinder listings at the top of the other table. People will look only "see" either the petfinder listings and miss the others, or only see the others and miss the petfinder listings. They all have to be in together. Once I can get the petfinder listings read into a script, I can reformat them so all the listings look alike. Then people can see them all. BTW, dogs listed on samoyed.org have a 75 - 80% higher chance of being adopted than dogs not listed. I suspect petfinder, with pictures, confers an even greater advantage. From chad at catcom.us Sat Dec 31 10:02:27 2005 From: chad at catcom.us (chad@catcom.us) Date: Sat, 31 Dec 2005 12:02:27 -0600 Subject: [Omaha.pm] Camel and Onion In-Reply-To: Message-ID: It is perfectly acceptable and appropriate to use the logos in the context of the Group Cards, Jay. -----Original Message----- From: omaha-pm-bounces at pm.org [mailto:omaha-pm-bounces at pm.org]On Behalf Of omaha-pm-request at pm.org Sent: Saturday, November 12, 2005 2:00 PM To: omaha-pm at pm.org Subject: Omaha-pm Digest, Vol 19, Issue 6 Send Omaha-pm mailing list submissions to omaha-pm at pm.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.pm.org/mailman/listinfo/omaha-pm or, via email, send a message with subject or body 'help' to omaha-pm-request at pm.org You can reach the person managing the list at omaha-pm-owner at pm.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Omaha-pm digest..." Today's Topics: 1. Fwd: Perl Mongers: camel, onion: business cards, letterhead (Jay Hannah) ---------------------------------------------------------------------- Message: 1 Date: Sat, 12 Nov 2005 10:08:10 -0600 From: Jay Hannah Subject: [Omaha.pm] Fwd: Perl Mongers: camel, onion: business cards, letterhead To: Omaha Perl Mongers Message-ID: Content-Type: text/plain; charset=US-ASCII; format=flowed > Round 3 off design is ready for feedback: > > http://omaha.pm.org/kwiki/index.cgi?BusinessCards > > Karen: Are these uses of the camel OK with O'Reilly? > > Perl Foundation: Are these uses of the onion OK with The Perl > Foundation? > > Thanks all, > > j Local thoughts? j ------------------------------ _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm End of Omaha-pm Digest, Vol 19, Issue 6 ***************************************