From rob.townley at gmail.com Thu Mar 1 06:22:35 2007 From: rob.townley at gmail.com (Rob Townley) Date: Thu, 1 Mar 2007 08:22:35 -0600 Subject: [Omaha.pm] Perl, Python, Ruby or PHP ... In-Reply-To: References: <6cb6eebc0702241208o31a3a2dcvac27cc4f2e11a492@mail.gmail.com> <200702281325.23179.dthacker9@cox.net> Message-ID: <7e84ed60703010622v40c550afuab2186b84b8e6a74@mail.gmail.com> On 2/28/07, Jake Churchill wrote: > Having also taken Bob's Programming on the Internet course, I would like to > post my vote for the continued use of Perl. I think once you learn Perl, > all other scripting languages are pretty easy to learn. Similar to how > after learning C/C++, Java is a breeze. > > -Jake ditto From jay at jays.net Fri Mar 2 14:57:19 2007 From: jay at jays.net (Jay Hannah) Date: Fri, 2 Mar 2007 16:57:19 -0600 (CST) Subject: [Omaha.pm] Split Apache conf file into separate files Message-ID: By request today... j #!/usr/bin/perl my $read_this_file = "./vhosts.conf"; # Read an Apache conf file w/ multiple VirtualHost directives and # split each VirtualHost into a separate file. # # This'd be cleaner w/ an XML parser (*cough* XML::Twig), but I don't # know if the user has any XML libraries installed. # # 2007-03-02 | Omaha Perl Mongers | http://omaha.pm.org $/ = ''; open (IN, $read_this_file) or die "Unable to open $read_this_file"; while () { s/.*($server_name.conf") or die "Unable to write to $server_name.conf"; print OUT $_; close OUT; } close IN; From georgen at neillnet.com Fri Mar 2 14:49:14 2007 From: georgen at neillnet.com (George Neill) Date: Fri, 02 Mar 2007 16:49:14 -0600 Subject: [Omaha.pm] Split Apache conf file into separate files In-Reply-To: References: Message-ID: <20070302164914.u2cbnuyf4wo408ok@www.neillnet.com> Jay, If you didn't already know ... apache ships with a log splitter perl script. Might be interesting to compare with what you have. http://httpd.apache.org/docs/2.2/programs/other.html Later, George. Quoting Jay Hannah : > > By request today... > > j > > > #!/usr/bin/perl > > my $read_this_file = "./vhosts.conf"; > > # Read an Apache conf file w/ multiple VirtualHost directives and > # split each VirtualHost into a separate file. > # > # This'd be cleaner w/ an XML parser (*cough* XML::Twig), but I don't > # know if the user has any XML libraries installed. > # > # 2007-03-02 | Omaha Perl Mongers | http://omaha.pm.org > > $/ = ''; > open (IN, $read_this_file) or die "Unable to open $read_this_file"; > while () { > s/.*( my ($server_name) = /ServerName (.*)/; > next unless $server_name; > open (OUT, ">$server_name.conf") or die "Unable to write to > $server_name.conf"; > print OUT $_; > close OUT; > } > close IN; > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > > !DSPAM:45e8a296243457785049143! > > From jay at jays.net Fri Mar 2 19:18:28 2007 From: jay at jays.net (Jay Hannah) Date: Fri, 2 Mar 2007 21:18:28 -0600 Subject: [Omaha.pm] Perl, Python, Ruby or PHP ... In-Reply-To: <16F8D15756891C4EA961565331A3B350066CDFB1@JDHEXC01.heiskell.com> References: <16F8D15756891C4EA961565331A3B350066CDFB1@JDHEXC01.heiskell.com> Message-ID: <1a663c338eec72b5f67ef040fbb2879f@jays.net> On Feb 28, 2007, at 2:27 PM, Thompson, Kenn wrote: > Here's food for thought... Given it's an "Internet" programming > course, with no previous experience needed (meaning it would be > unlikely that the student would know/understand concepts such as OO, > typecasting/etc), wouldn't it be better to start the series with a > crash course in JavaScript, then follow up with a strong language like > Perl? I've only ever talked to one person that enjoys programming JavaScript. The general sentiment (even among Java programmers) I've heard is dislike to hatred of JavaScript. I've often heard it has no relation to Java and "not a real language"...? $0.02, j From jay at jays.net Fri Mar 2 19:21:03 2007 From: jay at jays.net (Jay Hannah) Date: Fri, 2 Mar 2007 21:21:03 -0600 Subject: [Omaha.pm] Split Apache conf file into separate files In-Reply-To: <20070302164914.u2cbnuyf4wo408ok@www.neillnet.com> References: <20070302164914.u2cbnuyf4wo408ok@www.neillnet.com> Message-ID: <37a0667a9cfaf7c1d194ee15fdc3af98@jays.net> On Mar 2, 2007, at 4:49 PM, George Neill wrote: > If you didn't already know ... apache ships with a log splitter perl > script. Might be interesting to compare with what you have. > > http://httpd.apache.org/docs/2.2/programs/other.html Thanks! My program, however, was a configuration file splitter not a log splitter. :) j From KThompson at heiskell.com Sat Mar 3 07:32:00 2007 From: KThompson at heiskell.com (Thompson, Kenn) Date: Sat, 3 Mar 2007 07:32:00 -0800 Subject: [Omaha.pm] Perl, Python, Ruby or PHP ... Message-ID: <16F8D15756891C4EA961565331A3B35006758F96@JDHEXC01.heiskell.com> > Here's food for thought... Given it's an "Internet" programming > course, with no previous experience needed (meaning it would be > unlikely that the student would know/understand concepts such as OO, > typecasting/etc), wouldn't it be better to start the series with a > crash course in JavaScript, then follow up with a strong language like > Perl? -I've only ever talked to one person that enjoys programming JavaScript. -The general sentiment (even among Java programmers) I've heard is -dislike to hatred of JavaScript. I've often heard it has no relation to -Java and "not a real language"...? I would have to agree that it's not exactly pleasant to code in, but given the venue it's probably one of the few languages that is used for web based apps that's mostly available in all browsers. I'd even go so far as to say that if you're writing for the web it should be a requirement to not only to be somewhat proficient in Javascript but also in the most popular browser DOMs. Javascript does have most of the programming constructs available (IF-THEN-ELSE, CASE, etc), and can be used on most platforms for learning purposes, even without a server component. I wouldn't use it for production level code unless absolutely necessary, but even big business is still tied to it because of the browser. Also, as long as AJAX-like/Web 2.0 is in play, it'd be tough to not be exposed at some point. < side note... I kind of like Javascript, but I'm a masochist ;) > From jay at jays.net Sat Mar 3 08:21:57 2007 From: jay at jays.net (Jay Hannah) Date: Sat, 3 Mar 2007 10:21:57 -0600 Subject: [Omaha.pm] Perl, Python, Ruby or PHP ... In-Reply-To: <16F8D15756891C4EA961565331A3B35006758F96@JDHEXC01.heiskell.com> References: <16F8D15756891C4EA961565331A3B35006758F96@JDHEXC01.heiskell.com> Message-ID: <28d936064c25afcdd9d0d01c782dd16d@jays.net> On Mar 3, 2007, at 9:32 AM, Thompson, Kenn wrote: > I wouldn't use it for production level code unless absolutely > necessary, but even big business is still tied to it because of the > browser. Also, as long as AJAX-like/Web 2.0 is in play, it'd be tough > to not be exposed at some point. > > < side note... I kind of like Javascript, but I'm a masochist ;) > Agreed. It's certainly ubiquitously unavoidable for web warriors. I just don't know that I'd spend a lot of time trying to teach it if students might not yet be proficient coders in any language. Any other language first... Another trend I've noticed is people trying like hell to spare others the pain of Javascript by releasing toolkits that hide the glitch-fest: Google Web Toolkit (GWT) http://code.google.com/webtoolkit/ "Writing dynamic web applications today is a tedious and error-prone process; you spend 90% of your time working around subtle incompatibilities between web browsers and platforms, and JavaScript's lack of modularity makes sharing, testing, and reusing AJAX components difficult and fragile. GWT lets you avoid many of these headaches..." No point making coding neophytes miserable. Not at least until they're getting paid to suffer. :) But what do I know? While I consider myself an e-commerce developer I've never claimed to be a browser-side pretty stuff ninja. j From georgen at neillnet.com Sat Mar 3 18:36:57 2007 From: georgen at neillnet.com (George Neill) Date: Sat, 03 Mar 2007 20:36:57 -0600 Subject: [Omaha.pm] Split Apache conf file into separate files In-Reply-To: <37a0667a9cfaf7c1d194ee15fdc3af98@jays.net> References: <20070302164914.u2cbnuyf4wo408ok@www.neillnet.com> <37a0667a9cfaf7c1d194ee15fdc3af98@jays.net> Message-ID: <20070303203657.mhumdlt2as48ooko@www.neillnet.com> Quoting Jay Hannah : > Thanks! My program, however, was a configuration file splitter not a > log splitter. :) Man ... sorry, apparently I can't read. I'd post the awk script I wrote which does the same thing ... but probably not the right place for that :) Later, George. From jay at jays.net Sun Mar 4 07:13:13 2007 From: jay at jays.net (Jay Hannah) Date: Sun, 4 Mar 2007 09:13:13 -0600 Subject: [Omaha.pm] Split Apache conf file into separate files In-Reply-To: <20070303203657.mhumdlt2as48ooko@www.neillnet.com> References: <20070302164914.u2cbnuyf4wo408ok@www.neillnet.com> <37a0667a9cfaf7c1d194ee15fdc3af98@jays.net> <20070303203657.mhumdlt2as48ooko@www.neillnet.com> Message-ID: <0D619C6A-1916-43E4-B976-266E353826FC@jays.net> On Mar 3, 2007, at 8:36 PM, George Neill wrote: > Man ... sorry, apparently I can't read. I'd post the awk script I > wrote which does the same thing ... but probably not the right place > for that :) No worries. Have you found yourself needing to split Apache logs before? I assume my friend's Apache conf grew and grew over the years until he couldn't stand it any more and that's why he wanted that script from me... -shrug- j From jay at jays.net Sun Mar 4 07:24:23 2007 From: jay at jays.net (Jay Hannah) Date: Sun, 4 Mar 2007 09:24:23 -0600 Subject: [Omaha.pm] Meeting reminder: Tue, 13 Mar 2007 @ 7pm! Message-ID: [Weird. I remembered to send this email. So I guess this month isn't a secret meeting. -grin-] http://omaha.pm.org/ Tue, 13 Mar 2007 @ 7pm! Topic suggestions and guest speakers welcome. Some things I've been mucking with lately: - seqlab.net: BioPerl: Kiran and I have been QA'ing GenBank sequence data w/ various open reading frames. Given a dataset like this: 70987046 found in BC-I.Organism2.seq .seq ORF 0: MNQKNPKDTQNFITSKKHVKEILNHTNISKQDNVIEIGSGKGHFTX .seq ORF 1: *TRKTLKTRKILLLLKSM*KKY*ITRISVNKTT**KSDQEKDILP .seq ORF 2: EPEKP*RHAKFYYF*KACKRNIESHEYQ*TRQRNRNRIRKRTFYQ GenBank: MNQKNPKDTQNFITSKKHVKEILNHTNISKQDNVIEIGSGKGHFT Can you detect that that ORF 0 is "close enough" to GenBank? :) - DBI::Profile - Profile your DBI database interaction by writing 0 lines of additional code. :) - Nobody is interested in hold a Perl Quiz Night? http://mail.pm.org/pipermail/omaha-pm/2007-February/001326.html - Nobody else uses Perl? You fibbers. :) http://omaha.pm.org/kwiki/index.cgi?LocalOrganizationsWhoUsePerl Our meetings are sponsored by Paragon IT Professionals. Thanks for the pizza Jimmy Smith! See ya there! j From georgen at neillnet.com Tue Mar 6 10:39:55 2007 From: georgen at neillnet.com (George Neill) Date: Tue, 06 Mar 2007 12:39:55 -0600 Subject: [Omaha.pm] Split Apache conf file into separate files In-Reply-To: <0D619C6A-1916-43E4-B976-266E353826FC@jays.net> References: <20070302164914.u2cbnuyf4wo408ok@www.neillnet.com> <37a0667a9cfaf7c1d194ee15fdc3af98@jays.net> <20070303203657.mhumdlt2as48ooko@www.neillnet.com> <0D619C6A-1916-43E4-B976-266E353826FC@jays.net> Message-ID: <20070306123955.wp1a2r5008484k00@www.neillnet.com> > No worries. Have you found yourself needing to split Apache logs before? Yes, apache -- mod_vhost_alias only captures to one log file. Later, George. From jay at jays.net Tue Mar 6 21:31:51 2007 From: jay at jays.net (Jay Hannah) Date: Tue, 6 Mar 2007 23:31:51 -0600 Subject: [Omaha.pm] Split Apache conf file into separate files In-Reply-To: <20070306125125.tx2hao4328s4g4k8@www.neillnet.com> References: <20070302164914.u2cbnuyf4wo408ok@www.neillnet.com> <37a0667a9cfaf7c1d194ee15fdc3af98@jays.net> <20070303203657.mhumdlt2as48ooko@www.neillnet.com> <0D619C6A-1916-43E4-B976-266E353826FC@jays.net> <20070306125125.tx2hao4328s4g4k8@www.neillnet.com> Message-ID: <622596e125b4063c33c7443cb2c1e7f2@jays.net> On Mar 6, 2007, at 12:51 PM, George Neill wrote: > Here's that quick little awk script I wrote to pull virtuals from > apache conf, probably not the best looking script but it has worked > out well for me. > > [gneill at blackfoot ~]$ cat parse.awk > / /ServerName/ { host = $2 } > > { save = sprintf("%s%s\n", save, $0); } > > /<\/VirtualHost>/ { print save > "tmp/"host".conf"; } > > > [gneill at blackfoot ~]$ awk -f parse.awk < some_apache_conf_file Thanks! I think it's perfectly legit to post things like this to the list for the sake of comparison to Perl. :) j From dthacker9 at cox.net Fri Mar 9 05:20:27 2007 From: dthacker9 at cox.net (Dave Thacker) Date: Fri, 9 Mar 2007 07:20:27 -0600 Subject: [Omaha.pm] Bleadperl? Message-ID: <200703090720.27896.dthacker9@cox.net> What is Bleadperl? GTFI gets me many diary entries, but no actual project. This popped up on the TT list in a discussion about TT and OSX.... Dave From andy at petdance.com Fri Mar 9 05:51:23 2007 From: andy at petdance.com (Andy Lester) Date: Fri, 9 Mar 2007 07:51:23 -0600 Subject: [Omaha.pm] Bleadperl In-Reply-To: <200703090720.27896.dthacker9@cox.net> References: <200703090720.27896.dthacker9@cox.net> Message-ID: <9C2A0C97-118E-4354-892F-4ADB7638AFC7@petdance.com> On Mar 9, 2007, at 7:20 AM, Dave Thacker wrote: > What is Bleadperl? GTFI gets me many diary entries, but no actual > project. > This popped up on the TT list in a discussion about TT and OSX.... It's a development version that the perl5-porters work on. xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jhannah at omnihotels.com Fri Mar 9 08:44:31 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 9 Mar 2007 10:44:31 -0600 Subject: [Omaha.pm] Oldies but goodies! In-Reply-To: <1173453751.9536.4.camel@sjedwards.omnihotels.com> References: <1173453751.9536.4.camel@sjedwards.omnihotels.com> Message-ID: Not to mention: Programmer Adam Back managed to squeeze the RSA algorithm into just two lines of Perl: http://world.std.com/~franl/crypto/rsa-guts.html :) j -----Original Message----- From: Sean J. Edwards Sent: Friday, March 09, 2007 9:23 AM Subject: Oldies but goodies! Perl "Too Good" > Originally posted on www.perl.org in 1997: > > Perl "Too Good" > > > This is a true story. Names have not been changed. > > UCLA's Computer Science Undergraduate Association regularly hosts its > programming competition. Contestants are given six complex problems > and have three hours to write programs to solve as many of the problems > as possible. In 1997, the rules stated that any programming language > could be used so long as you solved the problem, so then-undergraduate > Keith Chiem entered and used Perl. > > Keith did not merely win, he conquered. He solved five of the six > problems in the three hours allotted. The second-place two-person > team solved only three problems. They, needless to say, were not using > Perl. > > But if you're a UCLA undergraduate contemplating entering the contest > and using Perl, don't bother. After Keith's conquest, Perl was banned > from the contest. > > You've got to admire a language that is banned because it makes > problems too easy to solve. > > These days, Keith is reportedly a sysadmin at Yahoo! Inc., and is > wondering what to do with the copy of Visual C++ that was his prize. Decode DVD's with 7 lines of PERL (from 2001): http://www.wired.com/news/culture/0,1284,42259,00.html From jay at jays.net Mon Mar 12 17:52:43 2007 From: jay at jays.net (Jay Hannah) Date: Mon, 12 Mar 2007 19:52:43 -0500 Subject: [Omaha.pm] Fwd: Friends Of Randall Schwartz... References: <934f64a20703070910n2cd069deua5b28ea115ec65f9@mail.gmail.com> Message-ID: 13 years later... http://news.com.com/2102-7350_3-6164113.html?tag=st.util.print Intel 'hacker' sentence expunged j From jhannah at omnihotels.com Fri Mar 16 10:29:22 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 16 Mar 2007 12:29:22 -0500 Subject: [Omaha.pm] pushing arrays onto arrays? In-Reply-To: References: Message-ID: Nope. :) What you expected would happen if you did "push @a, \@b". j ________________________________ From: Sean Baker Sent: Thursday, March 15, 2007 8:51 AM To: Programmers Subject: pushing arrays onto arrays? Wow. I always thought that if you "push @a, @b", the @b would end up as some type of reference in the @a array. I guess not. #!/usr/bin/perl use strict; # Push @b stuff onto @a separately. # my @a = qw(1 2 3); my @b = qw(4 5 6); foreach (@b) { push @a, $_; } print join " ", @a; print "\n"; # push @b onto @a. # my @a = qw(1 2 3); my @b = qw(4 5 6); push @a, @b; print join " ", @a; exit; From jhannah at omnihotels.com Tue Mar 20 14:55:46 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 20 Mar 2007 16:55:46 -0500 Subject: [Omaha.pm] source code from 1992 Message-ID: Wow. Don't you love Perl? Below is Informix 4GL from 1992 I'm in today. The perl version of the script below is: /^\d{7}$/ What's my code reduction ratio there? :) j ######################### FUNCTION valid_iata(ptxt) ######################### # This Function determines whether the string passed in (ptxt) is all Numbers# DEFINE ptxt char(8), tchar char(1), i_flg integer, i integer LET i_flg = TRUE FOR i = 1 to 7 LET tchar = ptxt[i,i] IF tchar is NULL THEN LET i_flg = FALSE EXIT FOR END IF IF tchar NOT MATCHES "[1234567890]" THEN LET i_flg = FALSE EXIT FOR END IF END FOR RETURN i_flg END FUNCTION From andy at petdance.com Tue Mar 20 14:57:45 2007 From: andy at petdance.com (Andy Lester) Date: Tue, 20 Mar 2007 16:57:45 -0500 Subject: [Omaha.pm] source code from 1992 In-Reply-To: References: Message-ID: On Mar 20, 2007, at 4:55 PM, Jay Hannah wrote: > The perl version of the script below is: > > /^\d{7}$/ > > What's my code reduction ratio there? If you feel guilty, change it to /^\d\d\d\d\d\d\d$/ so it's longer. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jay at jays.net Tue Mar 27 02:47:38 2007 From: jay at jays.net (Jay Hannah) Date: Tue, 27 Mar 2007 04:47:38 -0500 Subject: [Omaha.pm] Fwd: YAPC-NA CFP deadline approaching References: <7f7c2d5e0703261342g96b2e5cj3f18b5228ea38d@mail.gmail.com> Message-ID: Ooo... Houston, June 25-27... I wonder if I can swing that? Not sure what date I get back from Australia. :) j -------- Two weeks remain in the Call For Participation! Visit http:// conferences.mongueurs.net/yn2007 to register as a new user (or login with your existing account) and submit a talk proposal. If possible, please indicate (in the comments section) if you consider this talk to be suitable for a beginner, intermediate, or advanced Perl user. Some of the comments from last year indicated a desire to know the level of knowledge expected of talk attendees. Official CFP posting at http://conferences.mongueurs.net/yn2007/cfp.html Jeremy Fluhmann http://www.yapc.org/America From jay at jays.net Tue Mar 27 03:30:17 2007 From: jay at jays.net (Jay Hannah) Date: Tue, 27 Mar 2007 05:30:17 -0500 Subject: [Omaha.pm] Fwd: brian d foy References: <20070302182251.GA16257@panix.com> Message-ID: -laugh- In case you have absolutely nothing better to do... :) j Begin forwarded message: > From: "David H. Adler" > Date: March 2, 2007 12:22:51 PM CST > > Our illustrious founder has wikipedia issues. As you may know, his > preferred (and published) rendering of his name is 'brian d foy'. > There's even a style guide. > > If you feel like it, you might forward those in your groups to > http://en.wikipedia.org/wiki/Talk:Brian_D._Foy and join the fight to > render him correctly on wikipedia. > > thanks, > > dha, unofficial sgt-at-arms > > -- > David H. Adler - - http://www.panix.com/~dha/ > I'd redesign my program to something less absurd. > - Abigail, in comp.lang.perl.misc From jay at jays.net Tue Mar 27 04:39:14 2007 From: jay at jays.net (Jay Hannah) Date: Tue, 27 Mar 2007 06:39:14 -0500 Subject: [Omaha.pm] Devel::Cover & BioPerl Message-ID: <7AEEDFCC-EC50-42DF-8DD2-9EB267F7E3D1@jays.net> Devel::Cover tells you statistics about whether or not your POD and tests are covering all of your source code. Here's the results of Devel::Cover run against the BioPerl project: http://bix.sendu.me.uk/bioperl_live_cover/coverage.html Neat, huh? Anyone brave enough to run Devel::Cover against their own Perl and post the results to the list? :) About Devel::Cover: http://search.cpan.org/dist/Devel-Cover/lib/Devel/Cover.pm http://search.cpan.org/dist/Devel-Cover/lib/Devel/Cover/Tutorial.pod j From dan at linder.org Tue Mar 27 06:19:30 2007 From: dan at linder.org (Daniel Linder) Date: Tue, 27 Mar 2007 08:19:30 -0500 (CDT) Subject: [Omaha.pm] Devel::Cover & BioPerl In-Reply-To: <7AEEDFCC-EC50-42DF-8DD2-9EB267F7E3D1@jays.net> References: <7AEEDFCC-EC50-42DF-8DD2-9EB267F7E3D1@jays.net> Message-ID: <44199.68.13.153.38.1175001570.squirrel@www.linder.org> On Tue, March 27, 2007 06:39, Jay Hannah wrote: > Devel::Cover tells you statistics about whether or not your POD and > tests are covering all of your source code. ... > Neat, huh? Anyone brave enough to run Devel::Cover against their own > Perl and post the results to the list? :) Eh, so what is this concept of "POD" and "tests" you speak of? I think my code would cause the Devel::Cover module to run away screaming! Dan - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computers, I fear the lack of them." -- Isaac Asimov From KThompson at heiskell.com Tue Mar 27 06:59:08 2007 From: KThompson at heiskell.com (Thompson, Kenn) Date: Tue, 27 Mar 2007 06:59:08 -0700 Subject: [Omaha.pm] Devel::Cover & BioPerl Message-ID: <16F8D15756891C4EA961565331A3B350066CE099@JDHEXC01.heiskell.com> -->> -->> Eh, so what is this concept of "POD" and "tests" you speak -->> of? -->> -->> I think my code would cause the Devel::Cover module to run -->> away screaming! -->> So would that make it Devel::duck_and_cover ?