From jhannah at omnihotels.com Mon Nov 7 11:34:29 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 7 Nov 2005 13:34:29 -0600 Subject: [Omaha.pm] use Switch 'Perl6'; Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA1F@exchange2k3.omnihotels.net> LOL! Really? Is that better than the original? I didn't know there was such a thing... j -----Original Message----- From: Kenneth Thompson Another fun way to write that... use Switch 'Perl6'; [...] given $prop_id { when ( /(AUSCTR|CANCUN|CHIDTN|CHOCHV|CLTDTN|CRPBFT|CRPTWR|DETDTN|INDSEV|MONDTN| NYCBER|CHIAMB|OAEAST|JAXJAX|OMNIJH|STLDTN|OMNIST|HVNYAL|OMNNHY|ORFNEW|PH LPHL|RICRIC|TUSNTL)/) { $connect_to_db = "hotel"; } when ( /(DALLBJ|PARKWE)/i ) { $connect_to_db = "dallbj"; } when ( /(HOUWST|HOUSHO)/i ) { $connect_to_db = "houwst"; } else { $connect_to_db = $prop_id; } } From jhannah at omnihotels.com Mon Nov 7 11:41:20 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 7 Nov 2005 13:41:20 -0600 Subject: [Omaha.pm] FW: Class::Date - change once set Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA21@exchange2k3.omnihotels.net> Hi dLux. Thanks!! This is funny because I just got done lecturing someone not to break encapsulation on your class (Class::Date), and now your advice is to do just that. Strange world, isn't it? Thanks so much for your help! Sorry the spammers are irritating you. I feel your pain there. Take care, j Omaha Perl Mongers: http://omaha.pm.org -----Original Message----- From: "Bal?zs Szab? (dLux)" [mailto:dlux at dlux.hu] Sent: Monday, October 31, 2005 7:04 AM To: Jay Hannah Subject: Re: FW: Class::Date - change once set Hi! Sorry, I removed the email-list, because of the lots of spam, but probably I will resurrect if there is a need for this... No, you cannot change the object, it is by design. Class::Date objects are immutable. Use it as it would be a simple integer value. What you can do is to use references for them. For example the @_ array holds references for the variables, not the variables themselves, so the following is working: use Class::Date qw(date); sub swap1 { $x = $_[0]; $_[0] = $_[1]; $_[1] = $x; } $a = date "2000-11-11"; $b = date "1970-10-21"; print "a: $a, b: $b\n"; swap1($a, $b); print "a: $a, b: $b\n"; Regards, dLux Jay Hannah wrote: Oops... Looks like posting to the mailing list doesn't work? I subscribed successfully, but then my message bounced... Below is my message if you have a minute. Thanks! j _____________________________________________ From: System Administrator Sent: Monday, October 24, 2005 2:23 PM To: 'class-date at lists.dlux.hu' Subject: Undeliverable:Class::Date - change once set Your message did not reach some or all of the intended recipients. Subject: Class::Date - change once set Sent: 10/24/2005 2:22 PM The following recipient(s) could not be reached: 'class-date at lists.dlux.hu' on 10/24/2005 2:23 PM There was a SMTP communication problem with the recipient's email server. Please contact your system administrator. Hola -- Is there any way to change a Class::Date value once one has been set? Right now my demo script is failing: My script: --- use Class::Date qw( date ); my $d1 = date "1970-01-01"; my $d2 = date "2000-01-01"; stuff($d1, $d2); print "[$d1][$d2]\n"; sub stuff { my ($d1, $d2) = @_; if ($d2 > $d1) { $d1 = $d2; # <---- I want to overwrite the existing $d1 here } print "[$d1][$d2]\n"; } --- When I run it: $ perl j.pl [2000-01-01 00:00:00][2000-01-01 00:00:00] [1970-01-01 00:00:00][2000-01-01 00:00:00] $d1 is getting a NEW object, not overwriting the original $d1, so when stuff() returns I have lost my change to $d1. Is there any way to change $d1 inside stuff()? I tried clone() and set() without any luck. Thanks! j -- Szab? Bal?zs (dLux) -- -- - - - -- - From jhannah at omnihotels.com Tue Nov 8 07:32:20 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 8 Nov 2005 09:32:20 -0600 Subject: [Omaha.pm] FW: FW: Class::Date - change once set Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA2D@exchange2k3.omnihotels.net> Forwarding message as dLux requested. j -----Original Message----- From: "Bal?zs Szab? (dLux)" [mailto:dlux at dlux.hu] Sent: Monday, November 07, 2005 5:53 PM To: Jay Hannah Cc: omaha-pm at pm.org Subject: Re: FW: Class::Date - change once set Hi, It does not break the encapsulation, you probably misunderstood someting. I have checked the omaha-pm list, and this swap1 method uses the @_ array, which holds the function parameters, which are references to any variables. If you use swap1 for integers, it will work as well: $a = 1; $b = 1; swap1($a,$b); But since $a and $b are used by reference, swap1(1,2) won't work. Check the perlsub manual page, you can see how this variable works. So Class::Date objects are immutable, and I only copied references, and it is not really Class::Date specific what you copy with swap1. Please understand how the @_ variable work! (But before it, understand what references are. :-) ) If you need help, just write! Regards, Bal?zs (dLux) Jay Hannah wrote: >Hi dLux. Thanks!! > >This is funny because I just got done lecturing someone not to break encapsulation on your class (Class::Date), and now your advice is to do just that. Strange world, isn't it? > >Thanks so much for your help! Sorry the spammers are irritating you. I feel your pain there. > >Take care, > >j >Omaha Perl Mongers: http://omaha.pm.org > > > >-----Original Message----- >From: "Bal?zs Szab? (dLux)" [mailto:dlux at dlux.hu] >Sent: Monday, October 31, 2005 7:04 AM >To: Jay Hannah >Subject: Re: FW: Class::Date - change once set > >Hi! > >Sorry, I removed the email-list, because of the lots of spam, but probably I will resurrect if there is a need for this... > >No, you cannot change the object, it is by design. Class::Date objects are immutable. Use it as it would be a simple integer value. > >What you can do is to use references for them. For example the @_ array holds references for the variables, not the variables themselves, so the following is working: > >use Class::Date qw(date); >sub swap1 { > $x = $_[0]; > $_[0] = $_[1]; > $_[1] = $x; >} > >$a = date "2000-11-11"; >$b = date "1970-10-21"; > >print "a: $a, b: $b\n"; >swap1($a, $b); >print "a: $a, b: $b\n"; > >Regards, > >dLux > From jhannah at omnihotels.com Tue Nov 8 07:34:32 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 8 Nov 2005 09:34:32 -0600 Subject: [Omaha.pm] Class::Date - change once set Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA2E@exchange2k3.omnihotels.net> > So Class::Date objects are immutable, and I only copied references, and > it is not really Class::Date specific what you copy with swap1. > > Please understand how the @_ variable work! (But before it, understand > what references are. :-) ) > > If you need help, just write! Since I don't even know what "immutable" means, I must not understand. -grin- Let me study your example and get back to you. Thanks for the lesson! j From jhannah at omnihotels.com Tue Nov 8 10:16:55 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 8 Nov 2005 12:16:55 -0600 Subject: [Omaha.pm] Class::Date - change once set Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA31@exchange2k3.omnihotels.net> -----Original Message----- From: "Bal?zs Szab? (dLux)" [mailto:dlux at dlux.hu] Sent: Tuesday, November 08, 2005 11:32 AM To: Jay Hannah Subject: Re: Class::Date - change once set Hi! Immutable means if it is created one time, it should not be changed later. Like strings in Java. So if you want to add something to a Class::Date object, then you have to create a new instance. (Of course, you can hack the values manually if you know the structure of the Class::Date object, but it is designed to be not modifiable.) It won't be the same object. This is by design. This is why "clone" and "set" basically does the same thing: create a new object based on another one. Regards, Bal?zs / dLux Jay Hannah wrote: So Class::Date objects are immutable, and I only copied references, and it is not really Class::Date specific what you copy with swap1. Please understand how the @_ variable work! (But before it, understand what references are. :-) ) If you need help, just write! Since I don't even know what "immutable" means, I must not understand. -grin- Let me study your example and get back to you. Thanks for the lesson! j -- Szab? Bal?zs (dLux) -- -- - - - -- - From jay at jays.net Tue Nov 8 19:14:09 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 8 Nov 2005 21:14:09 -0600 Subject: [Omaha.pm] PerlWar Message-ID: Laugh... http://babyl.dyndns.org/perlwar j From jhannah at omnihotels.com Wed Nov 9 08:27:23 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 9 Nov 2005 10:27:23 -0600 Subject: [Omaha.pm] Class::Date + "91" Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA51@exchange2k3.omnihotels.net> Ooo... what did + 91 do Sean? Add 91 seconds? < my $date = $today + "91"; -- > my $date = $today + "91D"; j From pbaker at omnihotels.com Wed Nov 9 08:35:45 2005 From: pbaker at omnihotels.com (Sean Baker) Date: Wed, 9 Nov 2005 10:35:45 -0600 Subject: [Omaha.pm] Class::Date + "91" Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B03795F71@exchange2k3.omnihotels.net> Yes. Nasty little feature. -----Original Message----- From: omaha-pm-bounces at pm.org [mailto:omaha-pm-bounces at pm.org] On Behalf Of Jay Hannah Sent: Wednesday, November 09, 2005 10:27 AM To: omaha-pm at pm.org Subject: [Omaha.pm] Class::Date + "91" Ooo... what did + 91 do Sean? Add 91 seconds? < my $date = $today + "91"; -- > my $date = $today + "91D"; j _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From jay at jays.net Thu Nov 10 11:36:40 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 10 Nov 2005 13:36:40 -0600 Subject: [Omaha.pm] camel v. onion Message-ID: <60252d396ec54cb8a69b77d3521cc118@jays.net> Logo FYI: The camel may be swapped out for the onion. http://www.perlfoundation.org/ j On Nov 10, 2005, at 1:06 PM, Dave Cross wrote: > It may be a bad time to get round to printing those cards, as "real > soon now", the Perl Mongers site will be rebranding to use the Onion > logo like the rest of TPF. > On Nov 10, 2005, at 1:15 PM, Dave Cross wrote: >> I haven't seen anyone objecting to the plan. > > $0.02 -- > > I guess it doesn't matter, but I have a mild emotional/historical > attachment to the camel and the onion means nothing* to me. > > Since I've never seen any argument for leaving the camel all I see is a > change for the sake of change, a phenom I routinely resist. If there's > an argument somewhere I'd like to read it. > > Anyway I won't denounce Perl/TPF/PM over it or cry or anything. > > Is there a huge soft copy of that onion logo somewhere? I don't see a > link to one on TPF website. > > Thanks, > > j > Omaha.pm > * except that ogres are like onions. -Shrek -grin- > From jay at jays.net Thu Nov 10 13:08:32 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 10 Nov 2005 15:08:32 -0600 Subject: [Omaha.pm] camel v. onion Message-ID: FYI j > Jay Hannah wrote: >> On Nov 10, 2005, at 1:15 PM, Dave Cross wrote: >>> I haven't seen anyone objecting to the plan. >> $0.02 -- >> I guess it doesn't matter, but I have a mild emotional/historical >> attachment to the camel and the onion means nothing* to me. >> Since I've never seen any argument for leaving the camel all I see is >> a change for the sake of change, a phenom I routinely resist. If >> there's an argument somewhere I'd like to read it. >> Anyway I won't denounce Perl/TPF/PM over it or cry or anything. > > The main argument is that the camel doesn't belong to us. It belongs > to O'Reilly. And whilst they've always been generous allowing us to > use it, that has permission has always come with restrictions. Makes > far more sense, to me at least, to create our own logo that we can use > wherever we want. > >> Is there a huge soft copy of that onion logo somewhere? I don't see a >> link to one on TPF website. > > Let me check that out and get back to you. > > Dave... From jay at jays.net Thu Nov 10 14:01:06 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 10 Nov 2005 16:01:06 -0600 Subject: [Omaha.pm] Fwd: O'Reilly UG Program MAKE Magazine Holiday Offer Message-ID: <919c338cf9472843afde547677989834@jays.net> Plug! Since they sent us a free issue I guess I should plug it! Its a neat rag. http://makezine.com/ j Begin forwarded message: > From: Marsee Henon > Date: November 3, 2005 11:38:19 AM CST > To: jay at jays.net > Subject: O'Reilly UG Program MAKE Magazine Holiday Offer > > Hello, > > Here is a special offer for you to share with your group members. > Please > pass it along through your newsletters, email lists, or distribute at > your next meeting. > > > ***Give the Gift of MAKE Magazine*** > > Give the geek on your list a truly unique gift this holiday season-- > their very own subscription to MAKE magazine. MAKE is the first > magazine > devoted to digital projects, hardware hacks, and DIY inspiration. Each > rich issue brings the do-it-yourself mindset to all the technology in > your life. > > > You have a choice: > > Give a gift for $5 off the regular gift subscription rate--$29.95 (US), > $34.95 (Canada), $44.95 (all other countries): > > > > > To place your gift order at the regular price $34.95 (US), $39.95 > (Canada), > $49.95 (all other countries)--and get a MAKE T-shirt free. > > > > > For more information on MAKE or to read the MAKE Blog, go to: > http://makezine.com/ > > > > **Please note gift postcards and MAKE vol 4 will begin mailing on > 12/9/05, orders received after 12/9/05 and non-US orders may not arrive > in time for the holiday season. Your recipient(s) will receive the > opportunity to add digital access to their subscription. All MAKE > T-shirts will ship to your billing address. To order multiple orders > for > multiple countries, please contact customer service at 1-866-289-8847 > (US & Canada), 1-818-487-2037 (all other countries) between the hours > of 5am to 5pm San Francisco time or Email: MAKE at espcomp.com > > > > Thanks and have a wonderful holiday season, > > Marsee Henon > > > > > ================================================================ > O'Reilly > 1005 Gravenstein Highway North > Sebastopol, CA 95472 > http://ug.oreilly.com/ http://www.oreilly.com > ================================================================ From jay at jays.net Thu Nov 10 15:09:42 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 10 Nov 2005 17:09:42 -0600 Subject: [Omaha.pm] FW: FW: Class::Date - change once set In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA2D@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA2D@exchange2k3.omnihotels.net> Message-ID: <3f7fee6f912d3be34f6da6adf63131de@jays.net> From: "Bal?zs Szab? (dLux)" [mailto:dlux at dlux.hu] > use Class::Date qw(date); > $a = date "2000-11-11"; > $b = date "1970-10-21"; > > print "a: $a, b: $b\n"; > swap1($a, $b); > print "a: $a, b: $b\n"; > > sub swap1 { > $x = $_[0]; > $_[0] = $_[1]; > $_[1] = $x; > } Ahhh, yes. I misread your email the first time. To make sure I know what's happening let me walk through it... > sub swap1 { $a is obj in year 2000. $b is obj in year 1970. $_[0] is a ref to $a. $_[1] is a ref to $b. > $x = $_[0]; $x is created, a new obj in year 2000. (via clone() inside Class::Date) > $_[0] = $_[1]; $a obj is destroyed. A new $a is created, year 1970. (via clone() inside Class::Date) > $_[1] = $x; > } $b obj is destroyed. A new $b is created, year 2000. (via clone() inside Class::Date) Is that right? Thanks, j From jay at jays.net Fri Nov 11 06:17:23 2005 From: jay at jays.net (Jay Hannah) Date: Fri, 11 Nov 2005 08:17:23 -0600 Subject: [Omaha.pm] Class::Date - change once set Message-ID: <708f502864ccfdb6eeb90f225b4ca942@jays.net> Forwarding dLux's message. j From: "Bal?zs Szab? (dLux)" Date: November 11, 2005 3:06:01 AM CST To: Jay Hannah Subject: Re: [Omaha.pm] FW: FW: Class::Date - change once set Hi, Jay Hannah wrote: > From: "Bal?zs Szab? (dLux)" [mailto:dlux at dlux.hu] > >> use Class::Date qw(date); >> $a = date "2000-11-11"; >> $b = date "1970-10-21"; >> >> print "a: $a, b: $b\n"; >> swap1($a, $b); >> print "a: $a, b: $b\n"; >> >> sub swap1 { >> $x = $_[0]; >> $_[0] = $_[1]; >> $_[1] = $x; >> } > > > Ahhh, yes. I misread your email the first time. To make sure I know > what's happening let me walk through it... Ok. > >> sub swap1 { > > > $a is obj in year 2000. $b is obj in year 1970. $_[0] is a ref to $a. > $_[1] is a ref to $b. Correct. >> $x = $_[0]; > > > $x is created, a new obj in year 2000. (via clone() inside > Class::Date) Not correct. $_[0] is always points to the same object as $a, $_[1] always points to the same object as $b; In this case, we have a new object, $x, which is also points to the same as $a and $_[0]; >> $_[0] = $_[1]; > > $a obj is destroyed. A new $a is created, year 1970. (via clone() > inside Class::Date) Not correct. Now $a is points to the original $b, while $x keeps the reference to $a; >> $_[1] = $x; >> } > > $b obj is destroyed. A new $b is created, year 2000. (via clone() > inside Class::Date) > > Is that right? Not correct. $b now points to the $x, which kept the reference to the original $a, and in the previous step, we saw that $a is now pointing to the original $b; > > Thanks, > > j > So, it does not copy OBJECTS, it just increasing and decreasing reference counters to objects (since perl is a reference-counting language). Please see the perlobj and perlref (or perlreftut) manual to get what I had talked about. Regards, -- Szab? Bal?zs (dLux) -- -- - - - -- - From jay at jays.net Fri Nov 11 06:35:25 2005 From: jay at jays.net (Jay Hannah) Date: Fri, 11 Nov 2005 08:35:25 -0600 Subject: [Omaha.pm] Class::Date - change once set In-Reply-To: <43745EF9.1050307@dlux.hu> References: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA2D@exchange2k3.omnihotels.net> <3f7fee6f912d3be34f6da6adf63131de@jays.net> <43745EF9.1050307@dlux.hu> Message-ID: <6d43a5d8d650d34d88c7ddc1584ffc9b@jays.net> On Nov 11, 2005, at 3:06 AM, Bal?zs Szab? (dLux) wrote: >>> $x = $_[0]; >> >> $x is created, a new obj in year 2000. (via clone() inside >> Class::Date) > > Not correct. $_[0] is always points to the same object as $a, $_[1] > always points to the same object as $b; In this case, we have a new > object, $x, which is also points to the same as $a and $_[0]; Oh. At a glance inside the guts of your class and not knowing "overload" well I thought Class::Date was doing operator overloading on the assignment operator (=), invoking clone(). Now I've read up a little (perldoc overload) and may understand your guts better. Your explanation above explains that the assigment above is a vanilla Perl reference assignment, not some deep overloaded magic... This part of "perldoc overload" wigs me out: > SPECIAL SYMBOLS FOR "use overload" > > ... > > Copy Constructor > > The value for "=" is a reference to a function with three > arguments, > i.e., it looks like the other values in "use overload". > However, it > does not overload the Perl assignment operator. This would go > against > Camel hair. "would go against camel hair?" lol! Jay swoons w/ bemused incomprehension. I thought NOTHING was sacred inside overload. -laugh- Debugging your class objects always trips me up because of your (very useful) > use overload > '""' => "string", I'm used to debugging and seeing this: DB<1> p $x main=HASH(0x8d3a28) But on your objects I get this: DB<2> p $a 2000-11-11 00:00:00 So when I'm trying to understand what happens during/after an assignment operation I fail. -grin- Now that I know there's no magic going on I can understand it, but I won't know for sure when I'm looking at it in the debugger. Is there any way to get the "main=HASH(0x8d3a28)" to kick out on your objects? (So I can SEEE if its the same obj or some new one?) > So, it does not copy OBJECTS, it just increasing and decreasing > reference counters to objects (since perl is a reference-counting > language). > > Please see the perlobj and perlref (or perlreftut) manual to get what I > had talked about. Yes. I understand that default behavior. I thought Class::Date was being sneakier than the default. Thanks again for the help, you mad scientist genius you, -grin- j From jay at jays.net Fri Nov 11 06:42:49 2005 From: jay at jays.net (Jay Hannah) Date: Fri, 11 Nov 2005 08:42:49 -0600 Subject: [Omaha.pm] TEST please ignore Message-ID: <57143f1d7ddf6de9f9b7f133bc49af49@jays.net> Testing my line wrap. It's driving me nuts. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. This is a really long paragraph. From jay at jays.net Fri Nov 11 10:11:44 2005 From: jay at jays.net (Jay Hannah) Date: Fri, 11 Nov 2005 12:11:44 -0600 Subject: [Omaha.pm] Fwd: Class::Date - change once set Message-ID: <3d48bcb7580eda952e828451e40478ff@jays.net> dLux's response. j --- From: "Bal?zs Szab? (dLux)" Date: November 11, 2005 9:25:23 AM CST To: Jay Hannah Subject: Re: [Omaha.pm] Class::Date - change once set Hi, Jay Hannah wrote: > On Nov 11, 2005, at 3:06 AM, Bal?zs Szab? (dLux) wrote: > >>>> $x = $_[0]; >>> >>> >>> $x is created, a new obj in year 2000. (via clone() inside >>> Class::Date) >> >> >> Not correct. $_[0] is always points to the same object as $a, $_[1] >> always points to the same object as $b; In this case, we have a new >> object, $x, which is also points to the same as $a and $_[0]; > > > Oh. At a glance inside the guts of your class and not knowing > "overload" well I thought Class::Date was doing operator overloading > on the assignment operator (=), invoking clone(). > > Now I've read up a little (perldoc overload) and may understand your > guts better. Your explanation above explains that the assigment above > is a vanilla Perl reference assignment, not some deep overloaded > magic... > > This part of "perldoc overload" wigs me out: > >> SPECIAL SYMBOLS FOR "use overload" >> >> ... >> >> Copy Constructor >> >> The value for "=" is a reference to a function with three >> arguments, >> i.e., it looks like the other values in "use overload". >> However, it >> does not overload the Perl assignment operator. This would go >> against >> Camel hair. > > > "would go against camel hair?" lol! Jay swoons w/ bemused > incomprehension. I thought NOTHING was sacred inside overload. -laugh- > > Debugging your class objects always trips me up because of your (very > useful) > >> use overload >> '""' => "string", > > > I'm used to debugging and seeing this: > > DB<1> p $x > main=HASH(0x8d3a28) > > But on your objects I get this: > > DB<2> p $a > 2000-11-11 00:00:00 > > So when I'm trying to understand what happens during/after an > assignment operation I fail. -grin- Now that I know there's no magic > going on I can understand it, but I won't know for sure when I'm > looking at it in the debugger. > > Is there any way to get the "main=HASH(0x8d3a28)" to kick out on your > objects? (So I can SEEE if its the same obj or some new one?) Hmmm... Probably you can override the overloading while you are debugging: package Class::Date no overload '""'; package main; I have not tried, but it should work. >> So, it does not copy OBJECTS, it just increasing and decreasing >> reference counters to objects (since perl is a reference-counting >> language). >> >> Please see the perlobj and perlref (or perlreftut) manual to get what >> I >> had talked about. > > > Yes. I understand that default behavior. I thought Class::Date was > being sneakier than the default. noooo. :-) > > Thanks again for the help, you mad scientist genius you, -grin- > Oh! Your welcome! :-) > j > > -- Szab? Bal?zs (dLux) -- -- - - - -- - From jay at jays.net Sat Nov 12 08:08:10 2005 From: jay at jays.net (Jay Hannah) Date: Sat, 12 Nov 2005 10:08:10 -0600 Subject: [Omaha.pm] Fwd: Perl Mongers: camel, onion: business cards, letterhead Message-ID: > 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 From jay at jays.net Sat Nov 12 16:40:57 2005 From: jay at jays.net (Jay Hannah) Date: Sat, 12 Nov 2005 18:40:57 -0600 Subject: [Omaha.pm] UML diagrams Message-ID: <4933b6e6dc1093aa5252a4c878a1483c@jays.net> These are pretty slick: http://bioperl.open-bio.org/wiki/index.php/Class_Diagram j From jay at jays.net Mon Nov 14 10:57:17 2005 From: jay at jays.net (Jay Hannah) Date: Mon, 14 Nov 2005 12:57:17 -0600 Subject: [Omaha.pm] Nov 17th mtg CANCELLED (This Thr) Message-ID: <5a32f106f5deffd8a486452c478adad7@jays.net> Sorry, I'm catching a flight that night and the surrounding days/weeks are crazy busy. Of course, y'all are free to organize a mtg without me (I've heard those have the best turnout anyway -laugh-). http://omaha.pm.org/ Next Meeting: Thursday, December 15th 2005 @ 7pm! Thanks, j From dan at linder.org Tue Nov 15 09:34:22 2005 From: dan at linder.org (Daniel Linder) Date: Tue, 15 Nov 2005 11:34:22 -0600 (CST) Subject: [Omaha.pm] Perl and recursion... Message-ID: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to setup a script to recursively step through a directory and take action on files and directories.? Pretty simple, eh?? My script runs perfectly well and can handle the files and directory entries differently, it is only when I recursively call the subroutine that it fails.? The script recursively dives into the sub-directory, but when it is done with that directory the recursive call appears to kill the whole loop. Here is my code -- what am I missing? 1 #!/bin/perl -w 2 use strict; 3 4 sub ProcFiles { 5 my $dir = shift; 6 7 opendir (DIR, $dir) or die $!; 8 9 while (my $file = readdir(DIR)) { 10 next if ( -d "$dir/$file" && $file =~ /^\./); 11 if (-d "$dir/$file") { 12 printf ("Diving into \"%s/%s\".\n", $dir, $file); 13 &ProcFiles("$dir/$file"); 14 next; 15 } 16 17 printf ("Adding \"%s/%s\".\n", $dir, $file); 18 } 19 20 closedir(DIR); 21 } 22 23 &ProcFiles ("/tmp"); Dan - - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computer, 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) iD8DBQFDehwesrDMR0/em2gRAmPOAKCFjcQ3dUGuDjPx1jrr8xPDT57JegCgg/W6 mNoWjzNdW7e1BjjoP0x6VdE= =kDJ/ -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051115/957d7dff/attachment.html From tedkat at gmail.com Tue Nov 15 11:31:41 2005 From: tedkat at gmail.com (Theodore Katseres) Date: Tue, 15 Nov 2005 13:31:41 -0600 Subject: [Omaha.pm] Perl and recursion... In-Reply-To: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> Message-ID: On 11/15/05, Daniel Linder wrote: > -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to setup a script > to recursively step through a directory and take action on files and > directories. Pretty simple, eh? > > My script runs perfectly well and can handle the files and directory > entries differently, it is only when I recursively call the subroutine that > it fails. The script recursively dives into the sub-directory, but when it > is done with that directory the recursive call appears to kill the whole > loop. > > Here is my code -- what am I missing? It appears that no recursion is happening passed the initial dive. { ProcFiles("/tmp") } Check my comments. #!/bin/perl -w use strict; sub ProcFiles { my $dir = shift; opendir( DIR, $dir ) or die $!; while ( my $file = readdir(DIR) ) { next if ( -d "$dir/$file" && $file =~ /^\./ ); # above makes sure this block of code never gets executed if ( -d "$dir/$file" ) { printf( "Diving into\"%s/%s\".\n", $dir, $file ); &ProcFiles("$dir/$file"); next; } # your printing files that don't begin with "." printf( "Adding\"%s/%s\".\n", $dir, $file ); } closedir(DIR); } &ProcFiles("/tmp"); -- Ted Katseres ||=O=|| From dan at linder.org Tue Nov 15 11:44:46 2005 From: dan at linder.org (Daniel Linder) Date: Tue, 15 Nov 2005 13:44:46 -0600 (CST) Subject: [Omaha.pm] Perl and recursion... In-Reply-To: References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> Message-ID: <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, November 15, 2005 13:31, Theodore Katseres wrote: > It appears that no recursion is happening passed the initial dive. { > ProcFiles("/tmp") } I agree -- when I take out the '&ProcFiles("$dir/$file");' line, it continues through the /tmp directory fine.? With the recursive call to itself, I can watch the script dive into the sub-directory (/tmp/dir1), and it processes all the files in /tmp/dir1, but when it finishes with the files in "dir1" the program quits.? Unless I am missing something, I thought it should go back one level to the initial invocation of ProcFiles and continue where it left off there... > Check my comments. > > > #!/bin/perl -w > use strict; > > sub ProcFiles { > my $dir = shift; > > opendir( DIR, $dir ) or die $!; > > while ( my $file = readdir(DIR) ) { > > next if ( -d "$dir/$file" && $file =~ /^\./ ); > > # above makes sure this block of code never gets executed The line you mention ("next if ...") is used to make sure I skip the "." and ".." entries in the subdirectory -- otherwise it would back out of the "/tmp" to "/" and work there! :(? (It also has the effect of ignoring files with a leading "." -- that's also by design.) > if ( -d "$dir/$file" ) { > > printf( "Diving into\"%s/%s\".\n", $dir, $file ); > > &ProcFiles("$dir/$file"); > > next; > > } > > # your printing files that don't begin with "." True -- in my real script, this print line is replaced with a small bit of code to do some real work! In the example I posted to OLUG I wanted to keep it simple and see if I could make it work... > printf( "Adding\"%s/%s\".\n", $dir, $file ); > > } > > closedir(DIR); > > } > > &ProcFiles("/tmp"); Ted, thanks for your input. Dan - - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computer, 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) iD8DBQFDejqusrDMR0/em2gRAtT2AJ9cL6zR+u/XpmGtjXNCCM/Y9WDcvwCfY1Fp qXscyNVDA6vb5H8MuKUrEtM= =mFaZ -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051115/9f27c43b/attachment.html From jay at jays.net Tue Nov 15 13:26:52 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 15 Nov 2005 15:26:52 -0600 Subject: [Omaha.pm] Perl and recursion... In-Reply-To: <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> Message-ID: On Nov 15, 2005, at 1:44 PM, Daniel Linder wrote: > I agree -- when I take out the '&ProcFiles("$dir/$file");' line, it > continues through the /tmp directory fine.? With the recursive call to > itself, I can watch the script dive into the sub-directory > (/tmp/dir1), and it processes all the files in /tmp/dir1, but when it > finishes with the files in "dir1" the program quits.? Unless I am > missing something, I thought it should go back one level to the > initial invocation of ProcFiles and continue where it left off > there... Can you paste the output of the program to the list? That would help me understand what's happening. Recursion is tricky. If it was working what were you wanting to actually do to each file/dir you found? Thanks, j From dan at linder.org Tue Nov 15 14:14:05 2005 From: dan at linder.org (Daniel Linder) Date: Tue, 15 Nov 2005 16:14:05 -0600 (CST) Subject: [Omaha.pm] Perl and recursion... In-Reply-To: References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> Message-ID: <4070.68.13.86.85.1132092845.squirrel@mail.linder.org> On Tue, November 15, 2005 15:26, Jay Hannah wrote: > Can you paste the output of the program to the list? That would help me > understand what's happening. Sure thing.? Here is the output with line numbers. Lines 1 through 10 are the files in /tmp/base that I am testing with.? As you can see, there are files 1 through 4 in /tmp/base, and files A through C in /tmp/base/dir1. ???? 1??????? $ find /tmp/base -print ???? 2??????? /tmp/base ???? 3??????? /tmp/base/file1 ???? 4??????? /tmp/base/file2 ???? 5??????? /tmp/base/dir1 ???? 6??????? /tmp/base/dir1/fileA ???? 7??????? /tmp/base/dir1/fileB ???? 8??????? /tmp/base/dir1/fileC ???? 9??????? /tmp/base/file3 ??? 10??????? /tmp/base/file4 When I run the script with recursion enabled, it does dive into the /tmp/base directory and finds each "fileA" through "fileC".? Unfortunatly, when it gets to the end of that directory, it falls through and the script ends. ??? 12??????? $ perl testr.pl ??? 13??????? Adding "/tmp/base/file1". ??? 14??????? Adding "/tmp/base/file2". ??? 15??????? Diving into "/tmp/base/dir1". ??? 16??????? Adding "/tmp/base/dir1/fileA". ??? 17??????? Adding "/tmp/base/dir1/fileB". ??? 18??????? Adding "/tmp/base/dir1/fileC". ??? 19??????? Done. ??? 20??????? $ If I comment out the actual recursive call to the subroutine, I can see that it still finds the /tmp/base/dir1, and it continues as expected: ??? 23??????? $ perl testr.pl ??? 24??????? Adding "/tmp/base/file1". ??? 25??????? Adding "/tmp/base/file2". ??? 26??????? Diving into "/tmp/base/dir1". ??? 27??????? (recursive call commented out.) ??? 28??????? Adding "/tmp/base/file3". ??? 29??????? Adding "/tmp/base/file4". ??? 30??????? Done. ??? 31??????? $ > Recursion is tricky. If it was working what were you wanting to > actually do to each file/dir you found? What I want it to step through all the files and directories given the base directory to start in.? I've attached the script (testr.pl.AAA) if anyone wants to play with it.? Just save and rename it, I made it .AAA so the anti-virus programs won't try to strip it off as an attached script. I haven't had time, but I believe Theodore Kasteres' idea of puting the files/directores into an array and working from the array might be the way I attack this. Dan - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computer, I fear the lack of them." -- Isaac Asimov GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68 -------------- next part -------------- A non-text attachment was scrubbed... Name: testr.pl.aaa Type: application/octet-stream Size: 483 bytes Desc: not available Url : http://mail.pm.org/pipermail/omaha-pm/attachments/20051115/b35b8d95/testr.pl.obj From tedkat at gmail.com Tue Nov 15 14:20:40 2005 From: tedkat at gmail.com (Theodore Katseres) Date: Tue, 15 Nov 2005 16:20:40 -0600 Subject: [Omaha.pm] Fwd: Perl and recursion... In-Reply-To: References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> Message-ID: ---------- Forwarded message ---------- From: Theodore Katseres Date: Nov 15, 2005 2:54 PM Subject: Re: [Omaha.pm] Perl and recursion... To: dan at linder.org Sorry, Your code was right! The problem seems to be with while test. It keeps DIR descriptor open thru the recursion. I think this is why it dives and then quits. By loading up your files and directories into memory before recursion you no longer depend on the File descriptor to keep its previous state. opendir( DIR, $dir ) or die $!; my @arr = grep { !/^\.+$/ } readdir(DIR); ## just ignore . and .. close(DIR); while ..... On 11/15/05, Daniel Linder wrote: > -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > On Tue, November 15, 2005 13:31, Theodore Katseres wrote: > > It appears that no recursion is happening passed the initial dive. { > > ProcFiles("/tmp") } > > I agree -- when I take out the '&ProcFiles("$dir/$file");' line, it > continues through the /tmp directory fine. With the recursive call to > itself, I can watch the script dive into the sub-directory (/tmp/dir1), and > it processes all the files in /tmp/dir1, but when it finishes with the files > in "dir1" the program quits. Unless I am missing something, I thought it > should go back one level to the initial invocation of ProcFiles and continue > where it left off there... > > > Check my comments. > > > > > > #!/bin/perl -w > > use strict; > > > > sub ProcFiles { > > my $dir = shift; > > > > opendir( DIR, $dir ) or die $!; > > > > while ( my $file = readdir(DIR) ) { > > > > next if ( -d "$dir/$file" && $file =~ /^\./ ); > > > > # above makes sure this block of code never gets executed > > The line you mention ("next if ...") is used to make sure I skip the "." > and ".." entries in the subdirectory -- otherwise it would back out of the > "/tmp" to "/" and work there! :( (It also has the effect of ignoring files > with a leading "." -- that's also by design.) > > > if ( -d "$dir/$file" ) { > > > > printf( "Diving into\"%s/%s\".\n", $dir, $file ); > > > > &ProcFiles("$dir/$file"); > > > > next; > > > > } > > > > # your printing files that don't begin with "." > > True -- in my real script, this print line is replaced with a small bit of > code to do some real work! In the example I posted to OLUG I wanted to keep > it simple and see if I could make it work... > > > printf( "Adding\"%s/%s\".\n", $dir, $file ); > > > > } > > > > closedir(DIR); > > > > } > > > > &ProcFiles("/tmp"); > > Ted, thanks for your input. > > Dan > > - - - - - > "Wait for that wisest of all counselors, time." -- Pericles > "I do not fear computer, 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) > iD8DBQFDejqusrDMR0/em2gRAtT2AJ9cL6zR+u/XpmGtjXNCCM/Y9WDcvwCfY1Fp > qXscyNVDA6vb5H8MuKUrEtM= =mFaZ -----END PGP SIGNATURE----- -- Ted Katseres ||=O=|| -- Ted Katseres ||=O=|| From ranorton at cox.net Tue Nov 15 22:11:54 2005 From: ranorton at cox.net (Richard Norton) Date: Wed, 16 Nov 2005 00:11:54 -0600 Subject: [Omaha.pm] Fwd: Perl and recursion... In-Reply-To: References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> Message-ID: I'd agree with Theodore's comments...without refering back to documentation, I'm pretty sure you're hitting a scoping issue on your DIR file handle. As an alternative to frontloading all the filenames into an array, have you looked at the File::Find module? It confused the heck out of me when I first looked at it, but once you figure it out, it can do all sorts of neat stuff with directory trees and their content. Richard On Tue, 15 Nov 2005 16:20:40 -0600, Theodore Katseres wrote: > ---------- Forwarded message ---------- > From: Theodore Katseres > Date: Nov 15, 2005 2:54 PM > Subject: Re: [Omaha.pm] Perl and recursion... > To: dan at linder.org > > > Sorry, Your code was right! > The problem seems to be with while test. It keeps DIR descriptor open > thru the recursion. I think this is why it dives and then quits. > > By loading up your files and directories into memory before recursion > you no longer depend on the File descriptor to keep its previous > state. > > opendir( DIR, $dir ) or die $!; > my @arr = grep { !/^\.+$/ } readdir(DIR); ## just ignore . and .. > close(DIR); > > while ..... > > On 11/15/05, Daniel Linder wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >> On Tue, November 15, 2005 13:31, Theodore Katseres wrote: >> > It appears that no recursion is happening passed the initial dive. { >> > ProcFiles("/tmp") } >> >> I agree -- when I take out the '&ProcFiles("$dir/$file");' line, it >> continues through the /tmp directory fine. With the recursive call to >> itself, I can watch the script dive into the sub-directory (/tmp/dir1), >> and >> it processes all the files in /tmp/dir1, but when it finishes with the >> files >> in "dir1" the program quits. Unless I am missing something, I thought >> it >> should go back one level to the initial invocation of ProcFiles and >> continue >> where it left off there... >> >> > Check my comments. >> > >> > >> > #!/bin/perl -w >> > use strict; >> > >> > sub ProcFiles { >> > my $dir = shift; >> > >> > opendir( DIR, $dir ) or die $!; >> > >> > while ( my $file = readdir(DIR) ) { >> > >> > next if ( -d "$dir/$file" && $file =~ /^\./ ); >> > >> > # above makes sure this block of code never gets executed >> >> The line you mention ("next if ...") is used to make sure I skip the >> "." >> and ".." entries in the subdirectory -- otherwise it would back out of >> the >> "/tmp" to "/" and work there! :( (It also has the effect of ignoring >> files >> with a leading "." -- that's also by design.) >> >> > if ( -d "$dir/$file" ) { >> > >> > printf( "Diving into\"%s/%s\".\n", $dir, $file ); >> > >> > &ProcFiles("$dir/$file"); >> > >> > next; >> > >> > } >> > >> > # your printing files that don't begin with "." >> >> True -- in my real script, this print line is replaced with a small >> bit of >> code to do some real work! In the example I posted to OLUG I wanted to >> keep >> it simple and see if I could make it work... >> >> > printf( "Adding\"%s/%s\".\n", $dir, $file ); >> > >> > } >> > >> > closedir(DIR); >> > >> > } >> > >> > &ProcFiles("/tmp"); >> >> Ted, thanks for your input. >> >> Dan >> >> - - - - - >> "Wait for that wisest of all counselors, time." -- Pericles >> "I do not fear computer, 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) >> iD8DBQFDejqusrDMR0/em2gRAtT2AJ9cL6zR+u/XpmGtjXNCCM/Y9WDcvwCfY1Fp >> qXscyNVDA6vb5H8MuKUrEtM= =mFaZ -----END PGP SIGNATURE----- > > > -- > Ted Katseres > ||=O=|| > > > -- > Ted Katseres > ||=O=|| > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ From dan at linder.org Wed Nov 16 07:33:46 2005 From: dan at linder.org (Daniel Linder) Date: Wed, 16 Nov 2005 09:33:46 -0600 (CST) Subject: [Omaha.pm] Fwd: Perl and recursion... In-Reply-To: References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> Message-ID: <2038.68.13.86.85.1132155226.squirrel@mail.linder.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, November 16, 2005 00:11, Richard Norton wrote: > I'd agree with Theodore's comments...without refering back to > documentation, I'm pretty sure you're hitting a scoping issue on your DIR > file handle. That's what I'm thinking, too... :( > As an alternative to frontloading all the filenames into an array, have > you looked at the File::Find module? It confused the heck out of me when > I first looked at it, but once you figure it out, it can do all sorts of > neat stuff with directory trees and their content. Is File::Find part of the base Perl 5.X installation?? The perl I am using is part of a larger package (HP OpenView Network Node Manager) on a customers machine that I support -- HP has some dire warnings when it comes to upgrading the Perl they install with NNM, and the customers IT group has loaded their own copy of Perl 5.X in another directory for their own use. Gotta love administration of machines like this... :) Dan - - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computer, 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) iD8DBQFDe1FZsrDMR0/em2gRArKDAKCCruMNj7hXBb6nPdLyju8QS0B2pwCggsO8 gtzxt77hNgo4H30TjFjjeXc= =PHiC -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051116/f02bf8a1/attachment.html From jay at jays.net Wed Nov 16 12:54:17 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 16 Nov 2005 14:54:17 -0600 Subject: [Omaha.pm] Fwd: Perl and recursion... In-Reply-To: <2038.68.13.86.85.1132155226.squirrel@mail.linder.org> References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> <2038.68.13.86.85.1132155226.squirrel@mail.linder.org> Message-ID: <7a746b414a6328221205a34a4d66ef2d@jays.net> On Nov 16, 2005, at 9:33 AM, Daniel Linder wrote: > Is File::Find part of the base Perl 5.X installation?? Yes. > The perl I am using is part of a larger package (HP OpenView Network > Node Manager) on a customers machine that I support -- HP has some > dire warnings when it comes to upgrading the Perl they install with > NNM, and the customers IT group has loaded their own copy of Perl 5.X > in another directory for their own use. Gotta love administration of > machines like this... :) If it weren't "core perl" you could always install it elsewhere then tweak your script/environment so perl could find it. None of that would be "upgrading Perl" in my opinion. Perhaps even upgrading packages into the regular places isn't "upgrading Perl"...? Short of upgrading /usr/bin/perl the binary, "upgrading Perl" is probably in the eye of the beholder... j From andy at petdance.com Wed Nov 16 12:58:26 2005 From: andy at petdance.com (Andy Lester) Date: Wed, 16 Nov 2005 14:58:26 -0600 Subject: [Omaha.pm] Fwd: Perl and recursion... In-Reply-To: <7a746b414a6328221205a34a4d66ef2d@jays.net> References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> <2038.68.13.86.85.1132155226.squirrel@mail.linder.org> <7a746b414a6328221205a34a4d66ef2d@jays.net> Message-ID: <20051116205826.GB18629@petdance.com> On Wed, Nov 16, 2005 at 02:54:17PM -0600, Jay Hannah (jay at jays.net) wrote: > > On Nov 16, 2005, at 9:33 AM, Daniel Linder wrote: > > Is File::Find part of the base Perl 5.X installation?? > > Yes. $ corelist File::Find File::Find was first released with perl 5 -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From dan at linder.org Wed Nov 16 20:24:48 2005 From: dan at linder.org (Daniel Linder) Date: Wed, 16 Nov 2005 22:24:48 -0600 (CST) Subject: [Omaha.pm] Fwd: Perl and recursion... In-Reply-To: <20051116205826.GB18629@petdance.com> References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> <2038.68.13.86.85.1132155226.squirrel@mail.linder.org> <7a746b414a6328221205a34a4d66ef2d@jays.net> <20051116205826.GB18629@petdance.com> Message-ID: <2303.68.13.86.85.1132201488.squirrel@mail.linder.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Nov 16, 2005, at 9:33 AM, Daniel Linder wrote: > Is File::Find part of the base Perl 5.X installation? On Wed, Nov 16, 2005 at 02:54:17PM -0600, Jay Hannah (jay at jays.net) wrote: > Yes. On Wed, November 16, 2005 14:58, Andy Lester wrote: > $ corelist File::Find > > File::Find was first released with perl 5 But I *like* to re-invent the wheel all the time!? Sometimes the perfectly round ones i can buy at the store are just too easy... Thanks everyone! Dan - - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computer, 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) iD8DBQFDfAYQsrDMR0/em2gRAmSOAKC5JwNcd54uQeMENZ4CHXD6uDfEgwCdEwai kcHtxMEDDrwFwkqhpyN3g9g= =Uef/ -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051117/69c29f3f/attachment.html From jay at jays.net Wed Nov 16 20:35:05 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 16 Nov 2005 22:35:05 -0600 Subject: [Omaha.pm] Fwd: Perl and recursion... In-Reply-To: <2303.68.13.86.85.1132201488.squirrel@mail.linder.org> References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> <2038.68.13.86.85.1132155226.squirrel@mail.linder.org> <7a746b414a6328221205a34a4d66ef2d@jays.net> <20051116205826.GB18629@petdance.com> <2303.68.13.86.85.1132201488.squirrel@mail.linder.org> Message-ID: On Nov 16, 2005, at 10:24 PM, Daniel Linder wrote: > But I *like* to re-invent the wheel all the time!? Sometimes the > perfectly round ones i can buy at the store are just too easy... http://use.perl.org/article.pl?sid=05/10/25/127229&tid=32&tid=42 "CPAN: Reinventing the wheel since 1995" Grin, j From andy at petdance.com Wed Nov 16 20:36:55 2005 From: andy at petdance.com (Andy Lester) Date: Wed, 16 Nov 2005 22:36:55 -0600 Subject: [Omaha.pm] Fwd: Perl and recursion... In-Reply-To: References: <2379.68.13.86.85.1132076062.squirrel@mail.linder.org> <2384.68.13.86.85.1132083886.squirrel@mail.linder.org> <2038.68.13.86.85.1132155226.squirrel@mail.linder.org> <7a746b414a6328221205a34a4d66ef2d@jays.net> <20051116205826.GB18629@petdance.com> <2303.68.13.86.85.1132201488.squirrel@mail.linder.org> Message-ID: <1FA6A5F0-0D46-40DE-A6D5-1000B7792E3C@petdance.com> On Nov 16, 2005, at 10:35 PM, Jay Hannah wrote: > > "CPAN: Reinventing the wheel since 1995" I really wish she hadn't said that. :-( xoxo, Andy PR for The Perl Foundation -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jay at jays.net Thu Nov 17 12:33:10 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 17 Nov 2005 14:33:10 -0600 Subject: [Omaha.pm] Another 30s script Message-ID: Task: Find any lines in a pipe-delimited file where the 3rd column contains a non-alphanumeric character. j #!/usr/bin/perl open (IN, "j.unl"); while () { chomp; @l = split /\|/; print if ($l[2] =~ /[^a-z0-9]/i); } From jay at jays.net Thu Nov 17 18:33:40 2005 From: jay at jays.net (Jay Hannah) Date: Thu, 17 Nov 2005 20:33:40 -0600 Subject: [Omaha.pm] Fwd: Edsger W. Dijkstra quotes Message-ID: <78fe4ec8eb19ed159bc7104f44c26fbc@jays.net> Begin forwarded message: > . "If in physics there's something you don't understand, you can > always hide behind the uncharted depths of nature. You can always blame > God. You didn't make it so complex yourself. But if your program > doesn't > work, there is no one to hide behind. You cannot hide behind an > obstinate nature. If it doesn't work, you've messed up." Deep thoughts, j From andy at petdance.com Fri Nov 18 16:49:48 2005 From: andy at petdance.com (Andy Lester) Date: Fri, 18 Nov 2005 18:49:48 -0600 Subject: [Omaha.pm] Another 30s script In-Reply-To: References: Message-ID: <47610CDB-F6A7-4D33-9CDE-FBD40B298DE1@petdance.com> On Nov 17, 2005, at 2:33 PM, Jay Hannah wrote: > Task: Find any lines in a pipe-delimited file where the 3rd column > contains a non-alphanumeric character. > > open (IN, "j.unl"); > while () { > chomp; > @l = split /\|/; > print if ($l[2] =~ /[^a-z0-9]/i); > } What you're doing is very common, and so Perl has a number of tricks to handle most of that automatically. Try this: perl -n -a -F'\|' -e'print if $F[2] =~ /[^a-z0-9]/' j.unl This has the benefit of being able to operate on multiple files, not just the one. The -n says "loop through the input files." The -a says "automatically split $_, the input line, into @F". The -F says what to do the split() on. The pipe in the -F parm has to be backslashed because the -F parm is always a regex. See http://www.petdance.com/perl/command-line-options.pdf for more. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jay at jays.net Sun Nov 20 13:40:02 2005 From: jay at jays.net (Jay Hannah) Date: Sun, 20 Nov 2005 15:40:02 -0600 Subject: [Omaha.pm] Business cards, etc. I'm now taking orders from other groups. Message-ID: <3f9ed0bd1f4496778f2e15c582a8bf10@jays.net> I got my business card proofs @ FedEx Kinkos today. Pretty slick! So now I'm taking orders if other groups are interested: http://omaha.pm.org/kwiki/?BusinessCards Cheers, j Omaha.pm From raflists at gmail.com Sun Nov 20 21:22:58 2005 From: raflists at gmail.com (Robert) Date: Sun, 20 Nov 2005 23:22:58 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) Message-ID: Hello all, I'm the instructor of CSCI 2850, "Programming on the Internet" (a course title I've wanted to change for awhile, but the pain of the paperwork involved has thwarted me from doing it :). The course covers Perl, Apache and CGI. You can see the current slides for the course at http://morpo.com/robert/uno/ under the "csci 2850" link. In the coming weeks I'd like to solicit some input on revamping portions of the course. I think the course is pretty good as is, but it's time for me to seriously evaluate content in some areas. But, to the meat of this posting. My students are going to be giving a two-week series of 5-minute lightning talks on Tuesday, November 29th and Tuesday, December 6th from 6:00 PM until 7:30 PM each evening at the Peter Kiewit Institute at 68th and Pacific. Though they would probably prefer that I don't :), I'd like to invite you to the talks. I've attached a PDF (and if that doesn't come through, I'll send along a plaintext version and post it to the course website). Actually, we also have about three or four open talk slots if anyone is interested in doing something on December 6th. Just drop me a line and let me know and we'll see what we can work out. I'm contemplating doing a "How I converted my 8 years of Outlook e-mail to an non-proprietary format via Thunderbird and then used Mail::Box::Manager and Mail::Message::Construct::Bounce to get them all into GMail ... but I haven't quite had total success yet so ... :) Thanks, -- b -------------- next part -------------- A non-text attachment was scrubbed... Name: 2850 - Talks - 05 - Fa - Lightning Talks Flier.odt.pdf Type: application/pdf Size: 28374 bytes Desc: not available Url : http://mail.pm.org/pipermail/omaha-pm/attachments/20051121/39edd3be/2850-Talks-05-Fa-LightningTalksFlier.odt-0001.pdf From raflists at gmail.com Sun Nov 20 21:23:54 2005 From: raflists at gmail.com (Robert) Date: Sun, 20 Nov 2005 23:23:54 -0600 Subject: [Omaha.pm] OOps ... Message-ID: Hello again, I just realized I didn't mention that I teach 2850 at UNO. :) -- b From pduran at microlnk.com Mon Nov 21 02:00:59 2005 From: pduran at microlnk.com (Paul Duran) Date: Mon, 21 Nov 2005 04:00:59 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: References: Message-ID: <43819ADB.5020603@microlnk.com> Robert is there any interest in LDAP? As in Open LDAP? Seems I was working on this at one time and our developers didn't want anything to do with it. The relational vs. hiarchial(sp) thing. I could have been one of the leading LDAP developers in the area if this thing took off. Alot of people were just too comfortable with SQL to change which I can't blame them. It seemed to tie into java and the way classes are represented. just me ... Also while at UNO we were harped on regarding using or not using global variables. I was a Chem student and we used basic. It was riddled with "goto" statements. Ouch. I tried my damndest to use "local" or even "register" vars. Some homework was given in PASCAL, and I insisted it was compiled on thor using the p_to_c compiler. Those were the days (mid-90's). Currently, I'm totally interested in PHP. Hey, have fun Paul thanks Paul Robert wrote: >Hello all, > > I'm the instructor of CSCI 2850, "Programming on the Internet" (a >course title I've wanted to change for awhile, but the pain of the >paperwork involved has thwarted me from doing it :). The course >covers Perl, Apache and CGI. You can see the current slides for the >course at http://morpo.com/robert/uno/ under the "csci 2850" link. > > In the coming weeks I'd like to solicit some input on revamping >portions of the course. I think the course is pretty good as is, but >it's time for me to seriously evaluate content in some areas. > > But, to the meat of this posting. My students are going to be >giving a two-week series of 5-minute lightning talks on Tuesday, >November 29th and Tuesday, December 6th from 6:00 PM until 7:30 PM >each evening at the Peter Kiewit Institute at 68th and Pacific. > > Though they would probably prefer that I don't :), I'd like to >invite you to the talks. I've attached a PDF (and if that doesn't >come through, I'll send along a plaintext version and post it to the >course website). > > Actually, we also have about three or four open talk slots if >anyone is interested in doing something on December 6th. Just drop me >a line and let me know and we'll see what we can work out. > > I'm contemplating doing a "How I converted my 8 years of Outlook >e-mail to an non-proprietary format via Thunderbird and then used >Mail::Box::Manager and Mail::Message::Construct::Bounce to get them >all into GMail ... but I haven't quite had total success yet so ... >:) > > Thanks, > -- b > > >------------------------------------------------------------------------ > >_______________________________________________ >Omaha-pm mailing list >Omaha-pm at pm.org >http://mail.pm.org/mailman/listinfo/omaha-pm > From rps at willcomminc.com Mon Nov 21 08:03:09 2005 From: rps at willcomminc.com (Ryan Stille) Date: Mon, 21 Nov 2005 10:03:09 -0600 Subject: [Omaha.pm] Extracting overlayed text from an image Message-ID: <9A8B75E3985324438F1BFA08B160E82057B15C@suxsvr.willconsult.com> Have you guys come across anything that can extract text that is layed over a jpeg image? The text is black on a white background. I will already be processing this image data into a database, so if this can be done in Perl that would be ideal. Thanks, -Ryan From jay at jays.net Mon Nov 21 22:39:26 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 22 Nov 2005 00:39:26 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: References: Message-ID: <1475e69163f1c7a8d42468ffcc5b7186@jays.net> On Nov 20, 2005, at 11:22 PM, Robert wrote: > The course covers Perl, Apache and CGI. Hey, that's a big chunk of my career in a nutshell. -grin- > But, to the meat of this posting. My students are going to be > giving a two-week series of 5-minute lightning talks on Tuesday, > November 29th and Tuesday, December 6th from 6:00 PM until 7:30 PM > each evening at the Peter Kiewit Institute at 68th and Pacific. > > Though they would probably prefer that I don't :), I'd like to > invite you to the talks. I've attached a PDF (and if that doesn't > come through, I'll send along a plaintext version and post it to the > course website). Thanks for the invite! I'll be there. (I'm stunned, but that .pdf will not render on my Mac. Works fine in Windows. Wow, that's a first. -grin-) > Actually, we also have about three or four open talk slots if > anyone is interested in doing something on December 6th. Just drop me > a line and let me know and we'll see what we can work out. I could probably whip up something interesting. The trick for me, lightning talk virgin, will be limiting my long winded self to 5m. I witnessed and enjoyed the phenomenon at O'Reilly's Open Source Convention 2003. It's a great format, especially when some of the presenters are totally looney. I'll try to come up with some proposals for your consideration. I'm impressed with your run-down already listed on the .pdf. Looks like some great material! Who's doing the bit on Perl in Bioinformatics? I just got involved with the bioperl.org people, and am fascinated by genetics research. j From jay at jays.net Mon Nov 21 22:43:55 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 22 Nov 2005 00:43:55 -0600 Subject: [Omaha.pm] Extracting overlayed text from an image In-Reply-To: <9A8B75E3985324438F1BFA08B160E82057B15C@suxsvr.willconsult.com> References: <9A8B75E3985324438F1BFA08B160E82057B15C@suxsvr.willconsult.com> Message-ID: <272f30177573206ed230c66295c5c633@jays.net> On Nov 21, 2005, at 10:03 AM, Ryan Stille wrote: > Have you guys come across anything that can extract text that is layed > over a jpeg image? The text is black on a white background. I will > already be processing this image data into a database, so if this can > be > done in Perl that would be ideal. http://search.cpan.org/~allenday/Image-Ocrad-0.01/lib/Image/Ocrad.pm ? HTH, j From jay at jays.net Tue Nov 22 17:23:01 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 22 Nov 2005 19:23:01 -0600 Subject: [Omaha.pm] Another 30s script In-Reply-To: <47610CDB-F6A7-4D33-9CDE-FBD40B298DE1@petdance.com> References: <47610CDB-F6A7-4D33-9CDE-FBD40B298DE1@petdance.com> Message-ID: <8f799c3fb8886c4fb9c09dad0e990e31@jays.net> On Nov 18, 2005, at 6:49 PM, Andy Lester wrote: > perl -n -a -F'\|' -e'print if $F[2] =~ /[^a-z0-9]/' j.unl > > This has the benefit of being able to operate on multiple files, not > just the one. The -n says "loop through the input files." The -a > says "automatically split $_, the input line, into @F". The -F says > what to do the split() on. The pipe in the -F parm has to be > backslashed because the -F parm is always a regex. Whoah, cool! While I was already hip to -n and -e I'd never used -a -F before. Thanks! Is there anything you can't do in a one-liner? -laugh- $ perl -2005_tax_return Unrecognized switch: -2005_tax_return (-h will show valid options). Damn. Laugh, j From jay at jays.net Tue Nov 22 17:35:36 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 22 Nov 2005 19:35:36 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: References: Message-ID: <7456c398f37fc36d795df9f92898576f@jays.net> On Nov 20, 2005, at 11:22 PM, Robert wrote: > Actually, we also have about three or four open talk slots if > anyone is interested in doing something on December 6th. Just drop me > a line and let me know and we'll see what we can work out. Robert: How about this for a lightning talk proposal? Perl Operator Overloading in Action: Class::Date 1st minute: What is operator overloading? 2nd minute: What is Class::Date? 3rd-5th minutes: magic ensues Thoughts? If not I could do any of this stuff: http://omaha.pm.org/presentations/volunteer_list.txt Cheers, j Omaha.pm From raflists at gmail.com Wed Nov 23 11:28:35 2005 From: raflists at gmail.com (Robert) Date: Wed, 23 Nov 2005 13:28:35 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: <1475e69163f1c7a8d42468ffcc5b7186@jays.net> References: <1475e69163f1c7a8d42468ffcc5b7186@jays.net> Message-ID: Jay, > Thanks for the invite! I'll be there. Great! I can go from Omaha PM lurker to actually having met someone ... by inviting them to come to me. :) > (I'm stunned, but that .pdf will not render on my Mac. Works fine in > Windows. Wow, that's a first. -grin-) That _is_ odd. I created the PDF using pdfcreator (http://sourceforge.net/projects/pdfcreator/). I create handouts for my classes and post them using this, also, and haven't had any of my Mac people say they couldn't open the documents. Interesting. > Who's doing the bit on Perl in Bioinformatics? I just got involved with > the bioperl.org people, and am fascinated by genetics research. A student by the name of Brandon Suponchick. I'm not sure of his background, but it's the topic he chose, so I'm assuming he knows something about it. I guess we'll find out next week. :) -- b From raflists at gmail.com Wed Nov 23 11:32:55 2005 From: raflists at gmail.com (Robert) Date: Wed, 23 Nov 2005 13:32:55 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: <7456c398f37fc36d795df9f92898576f@jays.net> References: <7456c398f37fc36d795df9f92898576f@jays.net> Message-ID: Jay, > Perl Operator Overloading in Action: Class::Date > 1st minute: What is operator overloading? > 2nd minute: What is Class::Date? > 3rd-5th minutes: magic ensues This sounds cool. We didn't get a chance to talk about OO-Perl this semester, but one of the pre-requisites of the course is two semesters of C++, so it shouldn't be too frightening to them. > Thoughts? If not I could do any of this stuff: What would _really_ be great, if not for a lightning talk this semester then maybe for something next semester, would be if some of the area's corporate Perl-heads could come convince my students that Perl is still an okay language to learn. :) They're all convinced that PHP, Python and Ruby are the only ways to go. I admit, they're cool ways to go (my websites are all written in PHP), but the class is about Perl, dangit! :) -- b From rps at willcomminc.com Wed Nov 23 11:54:43 2005 From: rps at willcomminc.com (Ryan Stille) Date: Wed, 23 Nov 2005 13:54:43 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) Message-ID: <9A8B75E3985324438F1BFA08B160E82057B191@suxsvr.willconsult.com> Is there a schedule available of what topics will be discussed on each night? I am in Sioux City but might be able to come down. Thanks, -Ryan From jay at jays.net Wed Nov 23 12:13:20 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 23 Nov 2005 14:13:20 -0600 Subject: [Omaha.pm] Echo server on 7 IPs in < 40 lines of code Message-ID: Project: You're trying to test some load balancing architecture. You need a program that will listen to port 443 on 7 different IPs simultaneously. It should accept multiple simultaneous TCP connections. For each connection it should echo the fist line of input back to the client and then disconnect (like the world's stupidest web server). Note: IO::Multiplex rules. Solution: ----------- use IO::Socket; use IO::Multiplex; my $mux = new IO::Multiplex; for (153..159) { # Create a listening socket my $sock = new IO::Socket::INET( Proto => 'tcp', LocalPort => 443, LocalAddr => "10.0.37.$_", Listen => 4 ) or die "socket: $@"; # We use the listen method instead of the add method. $mux->listen($sock); } $mux->set_callback_object(__PACKAGE__); $mux->loop; sub mux_input { my $package = shift; my $mux = shift; my $fh = shift; my $input = shift; $fh->send("$$input\n"); $$input = undef; $mux->shutdown($fh, 1); $mux->shutdown($fh, 0); $mux->shutdown($fh, 2); $mux->kill_output($fh); $mux->close($fh); } ----------- Run it (as root) and poof!: # lsof -n -i:443 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME perl 11508 root 3u IPv4 29046 TCP 10.0.37.153:https (LISTEN) perl 11508 root 4u IPv4 29047 TCP 10.0.37.154:https (LISTEN) perl 11508 root 5u IPv4 29048 TCP 10.0.37.155:https (LISTEN) perl 11508 root 6u IPv4 29049 TCP 10.0.37.156:https (LISTEN) perl 11508 root 7u IPv4 29050 TCP 10.0.37.157:https (LISTEN) perl 11508 root 8u IPv4 29051 TCP 10.0.37.158:https (LISTEN) perl 11508 root 9u IPv4 29052 TCP 10.0.37.159:https (LISTEN) Mwoo haha ahah aha, j From jay at jays.net Wed Nov 23 12:23:26 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 23 Nov 2005 14:23:26 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: <9A8B75E3985324438F1BFA08B160E82057B191@suxsvr.willconsult.com> References: <9A8B75E3985324438F1BFA08B160E82057B191@suxsvr.willconsult.com> Message-ID: <33f3152bce72f785d86e40e2a542c51d@jays.net> On Nov 23, 2005, at 1:54 PM, Ryan Stille wrote: > Is there a schedule available of what topics will be discussed on each > night? I am in Sioux City but might be able to come down. Robert's 11/20 post had the .pdf attached. It also listed: > You can see the current slides for the > course at http://morpo.com/robert/uno/ under the "csci 2850" link. Which has a "PDF" link to that same overview. j From raflists at gmail.com Wed Nov 23 12:39:40 2005 From: raflists at gmail.com (Robert) Date: Wed, 23 Nov 2005 14:39:40 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: <33f3152bce72f785d86e40e2a542c51d@jays.net> References: <9A8B75E3985324438F1BFA08B160E82057B191@suxsvr.willconsult.com> <33f3152bce72f785d86e40e2a542c51d@jays.net> Message-ID: In case folks are having a hard time reading the PDF (again, that's odd), here is a list of the topics for each night: Tuesday, November 29th, 2005, 6:00 - 7:30 PM, PKI 252 Greasemonkey Firefox extension GDGraph Perl module slimserver perl program BugMeNot Firefox extension Using Perl on a Gumstick PC Konfabulator JavaScript form validation Perl in Bioinformatics Perl/Jsp for CGI Perl CGI Mad Libs ColdFusion Multiple Style Sheets Acme::Drunk Perl C and Java modules Virtual Hosts / Apache Mods Tuesday, December 6th, 2005, 6:00 - 7:30 PM, PKI 252 Obfuscated Perl Perl Google API StumbleUpon Firefox extension Go Home, Ook, GMail Firefox extensions Finance::Quote Perl SMS toolhaus.org movietickets.com scraping and IMDB::Film Perl vs. C++ SSL/SSH and Perl Perl vs. other languages, speed/efficiency Operator Overloading in Class::Date The topics are mostly Perl-oriented, but I let them pick any internet/programming-related topic that interested them, so that's why there are a few Firefox extensions and Konfabulator/JavaScript talks. -- b From jay at jays.net Wed Nov 23 13:23:53 2005 From: jay at jays.net (Jay Hannah) Date: Wed, 23 Nov 2005 15:23:53 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: References: <7456c398f37fc36d795df9f92898576f@jays.net> Message-ID: <7179bd1132f2babcff8e1c09457a418d@jays.net> On Nov 23, 2005, at 1:32 PM, Robert wrote: >> Perl Operator Overloading in Action: Class::Date >> 1st minute: What is operator overloading? >> 2nd minute: What is Class::Date? >> 3rd-5th minutes: magic ensues > > This sounds cool. We didn't get a chance to talk about OO-Perl > this semester, but one of the pre-requisites of the course is two > semesters of C++, so it shouldn't be too frightening to them. Does that mean I should plan on doing that talk on Dec 6? I'll bring my own laptop slideshow (prob. HTML). > What would _really_ be great, if not for a lightning talk this > semester then maybe for something next semester, would be if some of > the area's corporate Perl-heads could come convince my students that > Perl is still an okay language to learn. :) They're all convinced > that PHP, Python and Ruby are the only ways to go. I admit, they're > cool ways to go (my websites are all written in PHP), but the class is > about Perl, dangit! :) I'd be willing to attempt that whenever. I'm not opposed to other languages, I just happen to like Perl. I can give a behind-the-scenes demo of www.omnihotels.com if you like (Perl, Template Toolkit, Apache, Linux). If you're sharp languages are just syntax. If you know one really well you'll be fine in the others. j From jhannah at omnihotels.com Thu Nov 24 06:28:21 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 24 Nov 2005 08:28:21 -0600 Subject: [Omaha.pm] blogging w/ blosxom Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFA9A@exchange2k3.omnihotels.net> http://www.blosxom.com/ Blosxom is sweet. I'm using it to drive my website now (http://jays.net) and a blog at work. Gotta love the simplest thing that could possibly work. 1 perl script, extensible plugin architecture. Neato. j From jay at jays.net Sat Nov 26 06:43:31 2005 From: jay at jays.net (Jay Hannah) Date: Sat, 26 Nov 2005 08:43:31 -0600 Subject: [Omaha.pm] gedcomToHTML Message-ID: <684d870927eb51ba320b22f1b746e415@jays.net> I've got 4000+ of my relatives online now thanks to gedcomToHTML, a Perl script. http://jays.net/genealogy/ j From jay at jays.net Sat Nov 26 10:52:27 2005 From: jay at jays.net (Jay Hannah) Date: Sat, 26 Nov 2005 12:52:27 -0600 Subject: [Omaha.pm] Gedcom.pm - searching for a path from person A to person X? Message-ID: Hi Paul -- I've got a little over 4000 people in my GEDCOM http://jays.net/genealogy/ I'm also a Perl hacker, and was playing with your Gedcom.pm and wondering if you have any logic to find paths from arbitrary points in GEDCOMs to other arbitrary points. Something like The path from INDI 0012 to INDI 1077: Start: INDI 0012 Father: INDI 0078 Mother: INDI 1032 Married: INDI 1999 Daughter: INDI 1066 Married: INDI 0887 Son: INDI 1077 Once you found the path, of course, you could make it as pretty as you wanted to, Names, dates, etc. Does such a thing exist? If not, do you have any thoughts about how I might right it? Any interest in this being a plugin to Gedcom.pm? Gedcom::Search or something? Thanks, j From jay at jays.net Sat Nov 26 10:54:03 2005 From: jay at jays.net (Jay Hannah) Date: Sat, 26 Nov 2005 12:54:03 -0600 Subject: [Omaha.pm] Gedcom.pm - searching for a path from person A to person X? In-Reply-To: References: Message-ID: <0a99a2cac48c7230683796276dae2cb0@jays.net> On Nov 26, 2005, at 12:52 PM, Jay Hannah wrote: > any thoughts about how I might right it? Or write it? Laugh, j From jhannah at omnihotels.com Mon Nov 28 07:54:50 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 28 Nov 2005 09:54:50 -0600 Subject: [Omaha.pm] Automating Windows (DNS) with Perl Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFAA2@exchange2k3.omnihotels.net> If anyone has any experience with this it would be great if they'd present it at one of our meetings! j Begin forwarded message: > ***Automating Windows (DNS) with Perl > Perl is a fantastic tool for system administrators--even on Windows. > Though the shiny GUI is astonishingly useless (or at least too > mouse-friendly) for all but the simplest changes, there's plenty to > automate under the shell. Thomas Herchenroeder explains how he > wrapped dnscmd with Perl to make changes easily. > http://www.perl.com/pub/a/2005/03/24/perl_dns.html From jay at jays.net Tue Nov 29 19:00:16 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 29 Nov 2005 21:00:16 -0600 Subject: [Omaha.pm] Lightning Talks from UNO on Perl! :) In-Reply-To: <6cb6eebc0511271805n109fd207l95b127cb5367319d@mail.gmail.com> References: <7456c398f37fc36d795df9f92898576f@jays.net> <7179bd1132f2babcff8e1c09457a418d@jays.net> <6cb6eebc0511271805n109fd207l95b127cb5367319d@mail.gmail.com> Message-ID: Thanks again, Robert, for the invite! It's great to hear other people talking about Perl stuff without flying to OSCON (which I highly recommend). If anyone's coming next week and didn't come tonight this might help: - "Where: PKI 252" means the Peter Kiewit Institute, which is here: http://www.pki.nebraska.edu/whatispki/map.php Room 252: Go in the main entrance, up the stairs, around to triangular atrium, and room 252 is on your right. There will already be students in there, you can just wander in and sit anywhere at 6pm. - All the parking lots say you need a permit, but they're not busy and I didn't get a ticket so I guess I'd just recommend you park away from other cars anywhere and you'll probably be fine. (Ahh... memories of Iowa State parking nazis are flooding back to me.) My misc $0.02 about the presentations tonight, for discussion if anyone is biting: - It would be cool to know how to write a Firefox extension, though the tour of the hundreds you can download was pretty slick. - I talked briefly to Patrick about his GD::Graph stuff. I showed him our GD::Graph / RRD stuff quick and he said that "we use it a lot at work." A tour of that would be slick. Is Patrick on this list? - "Using Perl on a Gumstick PC" was way cool. If Nicholas would show one of those tiny things booting at a Perl Monger meeting that would be awesome! Is Nicholas on this list? - Javascript form validation - Yes, Javascript is a great tool for a ton of client side control stuff. One of the times you wouldn't (solely) use it for validation is when you're validating data entry against a database. You can JS that a field entry is one of 3 or 5 or even 100 possible values, but you can't use it when you've got a database of 1/2M possible entries on the backend. - Perl in Bioinformatics - If you want the full detail that talk brushed over simply read here: http://www.bioperl.org/GetStarted/tpj_ls_bio.html - Perl/Jsp for CGI - To paraphrase the presenter, "Perl is too fat/inefficient. Use JSP instead." - AFAIK J2EE JSP is fatter than mod_perl. I'd gladly benchmark that if anyone wants to pick a fight with me and take the JSP side. -grin- - "Perl doesn't do threading." - Perl does do threading (perldoc perlthrtut). I've never needed/wanted to use threads (in production), but you certainly can. Is someone wants to pick a fight with someone smarter than me then I'll buy the beers for the winner. -grin- - Language holy wars are fine (and sometimes fun!), but they should really begin from someone stating one or more facts, not just their opinion. And there should be a war, not just someone talking for 5m and then sitting down. I was soooo well behaved tonight. I even clapped. -grin- - Perl CGI Mad Libs - Maybe it'd be fun to tie that thing to a dictionary and see what happens? - ColdFusion costs $1500-$3000, but it's worth it. - Perl is free. It's definately worth it. Maybe it's worth more. -grin- - Multiple Style Sheets - That's pretty slick, I didn't know Firefox did that. Can I declare my own stylesheet on my client and tell Firefox to use MY stylesheet for every page on the Internet? I could add my photo as a bgimage for the entire Net? - Acme::Drunk - -laugh- I love Acme::* lightning talks. Philip should definately get lots of extra credit if he WAP enables that thing, and should get an honorary degree if he codes a VRU onto the front of it. - Perl C and Java modules. "There are probably a thousand modules on CPAN!" - CPAN's 9,126 module distributions: http://www.cpan.org/modules/01modules.index.html - "Don't reinvent the wheel. Just download it from CPAN." - Or if you do, at least try to re-invent a better one. -grin- - mod_perl I agree: mod_perl rules! j From jay at jays.net Tue Nov 29 19:59:23 2005 From: jay at jays.net (Jay Hannah) Date: Tue, 29 Nov 2005 21:59:23 -0600 Subject: [Omaha.pm] TEST please ignore. (line wrapping) Message-ID: <438D239B.7030903@jays.net> Hmm... Mail.app format:flowered doesn't work on pm.org MailMan anymore. Lets see if this freshly downloaded Thunderbird.app will do groovy, non line-wrapped sorts of things.... This isn't wrapped at all, you see, and I 've told T.app not to wrap it period,. Which, if it works, will probably mean this will be totally unreadable in the email arhice (1 big line)...? From jhannah at omnihotels.com Wed Nov 30 09:52:21 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 30 Nov 2005 11:52:21 -0600 Subject: [Omaha.pm] quickie: GMT time via Date::Calc Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B037AFAD6@exchange2k3.omnihotels.net> $ cat j.pl use Date::Calc qw( Today_and_Now ); printf("Local: %4d-%2d-%2d %2d:%2d:%2d\n", Today_and_Now); printf("GMT: %4d-%2d-%2d %2d:%2d:%2d\n", Today_and_Now(1)); $ perl j.pl Local: 2005-11-30 11:49:26 GMT: 2005-11-30 17:49:26 I tried to figure out how to do that w/ Class::Date and couldn't in 60 seconds so fell back to Date::Calc. Date::Calc is great, it's just not as slick as Class::Date objects for comparing/manipulating datetimes. j From dan at linder.org Wed Nov 30 14:59:23 2005 From: dan at linder.org (Daniel Linder) Date: Wed, 30 Nov 2005 16:59:23 -0600 (CST) Subject: [Omaha.pm] Perl security flaw? Message-ID: <3829.68.13.86.85.1133391563.squirrel@mail.linder.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Saw this on NetworkWorld... http://www.networkworld.com/news/2005/113005-perl-flaw.html It's too vaigue to help any, but it sounds like the classic use of un-checked user input being executed directly by the interperter (Perl or otherwise).? Anyone heard anything more? 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) iD8DBQFDji7LsrDMR0/em2gRAgjSAKC1RFU6ndhXc5iZNq4YrcpA5r0ERwCggn/3 Q3mwX13lUtqkRMepSk1DT6M= =ogxg -----END PGP SIGNATURE----- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051130/f941e330/attachment.html From sidney.omaha.pm at gmail.com Wed Nov 30 15:20:44 2005 From: sidney.omaha.pm at gmail.com (Sidney B) Date: Wed, 30 Nov 2005 17:20:44 -0600 Subject: [Omaha.pm] Perl security flaw? In-Reply-To: <3829.68.13.86.85.1133391563.squirrel@mail.linder.org> References: <3829.68.13.86.85.1133391563.squirrel@mail.linder.org> Message-ID: <69817ffa0511301520m49e53560md2ee3724514fb21c@mail.gmail.com> On 11/30/05, Daniel Linder wrote: > > http://www.networkworld.com/news/2005/113005-perl-flaw.html > > It's too vaigue to help any, but it sounds like the classic use of > un-checked user input being executed directly by the interperter (Perl or > otherwise). > > Anyone heard anything more? > http://news.zdnet.co.uk/internet/security/0,39020375,39239125,00.htm says the vunerability is in a web based server admininstration application called Webmin. It's not Perl. It's that one (actually, I think there are two) application. I understand it's a problem with a formatting string. I don't use web based administration applications for my web servers, so I'm not going to get overheated and damp about it. Anybody who uses Webmin might want to go see if that application has been updated, or learn to write a few basic scripts and how to add users at the command line. It's not like it's hard. -Sidney -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20051130/3df9c4d6/attachment.html From andy at petdance.com Wed Nov 30 15:45:02 2005 From: andy at petdance.com (Andy Lester) Date: Wed, 30 Nov 2005 17:45:02 -0600 Subject: [Omaha.pm] Perl security flaw? In-Reply-To: <3829.68.13.86.85.1133391563.squirrel@mail.linder.org> References: <3829.68.13.86.85.1133391563.squirrel@mail.linder.org> Message-ID: <20051130234501.GA6477@petdance.com> On Wed, Nov 30, 2005 at 04:59:23PM -0600, Daniel Linder (dan at linder.org) wrote: > http://www.networkworld.com/news/2005/113005-perl-flaw.html > > > > It's too vaigue to help any, but it sounds like the classic use of > un-checked user input being executed directly by the interperter (Perl or > otherwise).? Exactly. Watch perlfoundation.org for an article I'm going to post later tonight. xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance