From amoore at mooresystems.com Fri Jun 2 14:27:34 2006 From: amoore at mooresystems.com (Andrew Moore) Date: Fri, 2 Jun 2006 16:27:34 -0500 Subject: [Kc] YAPC::NA In-Reply-To: <49d805d70605312111r364c211cg60d5aabd0e050efb@mail.gmail.com> References: <49d805d70605312111r364c211cg60d5aabd0e050efb@mail.gmail.com> Message-ID: <20060602212734.GA17372@mooresystems.com> On Wed, May 31, 2006 at 11:11:05PM -0500, Joshua McAdams wrote: > Hi there fellow Perl Mongers. I'm writing to remind you all that > YAPC::NA is only a few weeks away. The conference will be held in > Chicago June 26th through 28th ... I just got permission from The Man to go. Any other KC Mongers going? Perhaps this is reason enough to have a June meeting. I guess that would be the 13th? Any interest? -Andy From cscheppers at kc.rr.com Fri Jun 2 14:23:19 2006 From: cscheppers at kc.rr.com (C.J. Scheppers) Date: Fri, 2 Jun 2006 16:23:19 -0500 Subject: [Kc] perl on unix box is frustrating In-Reply-To: References: Message-ID: Hi, I'm writing perl for someone whose site is on a unix box. I spend an enormous amount of time just trying to debug some simple thing. I must delete sections of code until the script runs, then add the code back a line at a time to see what's going wrong. Unix doesn't seem to give any more hint as to what's wrong than The server encountered an internal error or misconfiguration and was unable to complete your request. Now the really frustrating part is that I cannot add the following line which is also commented out: #@file = ; so I have to delete the line a letter at a time until this allows the script to at least run: #fi This will not run: #fil I save the script as text only, ftp it to the site as text and set the permissions to run. The script runs with the #fi line but not the #fil line. Any ideas? Thanks, C.J. From amoore at mooresystems.com Fri Jun 2 14:57:36 2006 From: amoore at mooresystems.com (Andrew Moore) Date: Fri, 2 Jun 2006 16:57:36 -0500 Subject: [Kc] perl on unix box is frustrating In-Reply-To: References: Message-ID: <20060602215736.GA17521@mooresystems.com> On Fri, Jun 02, 2006 at 04:23:19PM -0500, C.J. Scheppers wrote: > I'm writing perl for someone whose site is on a unix box. I spend an > enormous amount of time just trying to debug some simple thing. I > must delete sections of code until the script runs, then add the code > back a line at a time to see what's going wrong. Unix doesn't seem > to give any more hint as to what's wrong than The server encountered > an internal error or misconfiguration and was unable to complete your > request. Hi C.J. - It sounds like this perl script is a CGI script being run by a webserver. Typically, in that case there are more informative error messages in the error logs of the webserver. If it's apache, that may be something like /var/log/apache/error.log. If you have shell acceess to the webserver, you can use SSH to login to it. Then you can use 'tail' to view the end of the log file. That's where the most recent entries are. If you use 'tail -f /var/log/apache/error.log' you may be able to see new log entries as they are added. You may also want to look into the CGI::Carp module which may help you get more informative messages in the error logs. You may find it informative to run 'perl -c' on the files on your local machine to syntax check them before you FTP them up there. Hope it helps, -Andy From amoore at mooresystems.com Fri Jun 2 15:06:30 2006 From: amoore at mooresystems.com (Andrew Moore) Date: Fri, 2 Jun 2006 17:06:30 -0500 Subject: [Kc] perl on unix box is frustrating In-Reply-To: References: Message-ID: <20060602220630.GB17521@mooresystems.com> On Fri, Jun 02, 2006 at 04:23:19PM -0500, C.J. Scheppers wrote: > Any ideas? Oh yeah, and take a look at these two FAQ entires: http://perldoc.perl.org/perlfaq9.html#My-CGI-script-runs-from-the-command-line-but-not-the-browser.--(500-Server-Error) and http://perldoc.perl.org/perlfaq9.html#How-can-I-get-better-error-messages-from-a-CGI-program%3f -Andy From davidnicol at gmail.com Fri Jun 2 15:30:56 2006 From: davidnicol at gmail.com (David Nicol) Date: Fri, 2 Jun 2006 17:30:56 -0500 Subject: [Kc] YAPC::NA In-Reply-To: <20060602212734.GA17372@mooresystems.com> References: <49d805d70605312111r364c211cg60d5aabd0e050efb@mail.gmail.com> <20060602212734.GA17372@mooresystems.com> Message-ID: <934f64a20606021530q26f7363dg9adf1e91aa62c795@mail.gmail.com> I have written it on my calendar :) On 6/2/06, Andrew Moore wrote: > Perhaps this is reason enough to have a June meeting. I guess that > would be the 13th? Any interest? From cscheppers at kc.rr.com Fri Jun 2 23:59:56 2006 From: cscheppers at kc.rr.com (C.J. Scheppers) Date: Sat, 3 Jun 2006 01:59:56 -0500 Subject: [Kc] perl on unix box is frustrating In-Reply-To: <4480AD63.4050108@earthlink.net> References: <4480AD63.4050108@earthlink.net> Message-ID: Many thanks so far for suggestions. Here are some more clues. I'm on a Mac G3 using BBedit, saving script with unix line feeds. FTP is by fetch, placing the file as text on the unix server. Full permission to read, write, execute. By deleting one character of this code, the script will run; by having that one extra character, the script will not run. Seems like a buffer is filling up and overflowing? As you can see from the script, everything is commented out, right? I'm just trying to get the script to run, it doesn't have to do anything right now except print an html page. If I can figure out the problem, I'll resume programming to open file, parse, print records, etc. #!/usr/local/bin/perl #require 'cgi-lib.pl'; #&ReadParse; #require 'lock.sub' || die "Require: $!\n"; #sub CgiDie { # local (@msg) = @_; # &CgiError (@msg); # die @msg; #} #item type|item subdivision|short name|alternate/full name|webpage|picture|product number|price|eol #chdir ("../drawer"); #$dir = "E:\\web\\dorenek\\quiet"; #$here = "list"; #open (READ,"$here") || die "Require: $!\n"; #fizz #close(READ); #my @fields = split(/\|/,$file[0]); #$a = $fields print "Content-type: text/html\n\n"; print< xxx etc. HTML exit; >C.J. Scheppers wrote: > >> Hi, >> I'm writing perl for someone whose site is on a unix box. I spend >>an enormous amount of time just trying to debug some simple thing. >>I must delete sections of code until the script runs, then add the >>code back a line at a time to see what's going wrong. Unix doesn't >>seem to give any more hint as to what's wrong than The server >>encountered an internal error or misconfiguration and was unable to >>complete your request. >> Now the really frustrating part is that I cannot add the following >>line which is also commented out: >> #@file = ; >> so I have to delete the line a letter at a time until this allows >>the script to at least run: >> #fi >> This will not run: >> #fil >> I save the script as text only, ftp it to the site as text and set >>the permissions to run. The script runs with the #fi line but not >>the #fil line. >> Any ideas? >> Thanks, >> C.J. >> _______________________________________________ >> kc mailing list >> kc at pm.org >> http://mail.pm.org/mailman/listinfo/kc >> > >Hi CJ, > >First comment, if you can, debug as much as possible on a local >machine. Even if you don't have a webserver environment, you can >test parts of the code. > >second comment, first use the !#path/to/perl -w switch. >and then add this to your script while debugging under the webserver > use CGI::Carp qw(fatalsToBrowser); > > >That should help. >Good luck CJ, >Teal >-- >Five minutes of Silence, >Meditate. Breathe. Be Alive. From cscheppers at kc.rr.com Sat Jun 3 10:13:07 2006 From: cscheppers at kc.rr.com (C.J. Scheppers) Date: Sat, 3 Jun 2006 12:13:07 -0500 Subject: [Kc] perl on unix box is frustrating In-Reply-To: <20060603111228.ckao408ow4wkgsck@www.webmail4.com> References: <4480AD63.4050108@earthlink.net> <20060603111228.ckao408ow4wkgsck@www.webmail4.com> Message-ID: WooHoo! I uploaded it as binary and it runs. Now I'll get back to actually programming. Thanks again to all! C.J. >Try uploading it as binary if you are saving it with unix line feeds >in it. Mac >pieces that end up our linux boxes frequently only have mac line feeds in them >(I know you are saving it as unix line feeds but double check) which >causes the >text once it gets to the unix box to be considered all one line and thus throw >errors after a certain length. > >Scott Kahler > >Quoting "C.J. Scheppers" : > From jay at jays.net Sat Jun 3 15:00:31 2006 From: jay at jays.net (Jay Hannah) Date: Sat, 03 Jun 2006 17:00:31 -0500 Subject: [Kc] perl on unix box is frustrating In-Reply-To: References: <4480AD63.4050108@earthlink.net> <20060603111228.ckao408ow4wkgsck@www.webmail4.com> Message-ID: <4482067F.7000102@jays.net> C.J. Scheppers wrote: > WooHoo! I uploaded it as binary and it runs. Now I'll get back to > actually programming. > > Thanks again to all! Yup, that would make sense. Your problem sounded way too weird to be Perl, Apache, or Linux misbehaving... :) If you can get ssh access to the Linux box you'll be far better off. The perl debugger is a great tool: "perldoc perldebug". HTH, j From davidnicol at gmail.com Tue Jun 6 22:29:03 2006 From: davidnicol at gmail.com (David Nicol) Date: Wed, 7 Jun 2006 00:29:03 -0500 Subject: [Kc] review of Statistics Hacks by Bruce Frey Message-ID: <934f64a20606062229x1e5f69e5sdfd734005c8c38b@mail.gmail.com> Review of Statistics Hacks by Bruce Frey I leafed through Statistics Hacks immediately on receiving it and found it to be an excellent and understandable presentation of applied statistics, such as how to understand any system given a mean and a standard deviation. The discussion of the Monty Hall problem in particular was enlightening. I wrote the following computer program to simulate the situation as described in the chapter on applying statistics hackery to game show situations: my @curtains; sub PlaceBuick{ @curtains = qw/zonk zonk zonk/; $curtains[rand 3] = 'buick'; }; my $choice1; sub Choose{ $choice1 = int rand 3; }; my $reveal; sub Reveal{ my $provisional_reveal = int rand 3; $provisional_reveal != $choice1 and $curtains[$provisional_reveal] ne 'buick' and return $reveal = $provisional_reveal; Reveal(); }; for(1..10000){ PlaceBuick(); Choose(); Reveal(); print "you chose $choice1 and there is no car behind curtain $reveal\n"; $curtains[$choice1] eq 'buick' and $buicks++; }; print "you won $buicks buicks\n"; __END__ About halfway through writing the Reveal() function I realized that I had been erroneous in my scepticism, as the revealing function, based on the game show host's knowledge of the situation, really does not affect the odds made in the first choice. Thank you for the explanation, Bruce Frey. You should always switch. Unless of course the host does not always reveal an empty curtain, in which case you're back to playing rock, paper, scissors under the fear that the host may have revealed a curtain in order to convince you to change your choice. Written with the clear and friendly prose one expects from the faculty of the University of Kansas, Frey presents his material as a series of secrets that he reveals, enabling the reader to do tricks. This is an entertaining conceit, and the willing reader will be amused enough to slog through the textbook-like material on the central limit theorem and the other things that you have to know to get a college degree. The book would make a very approachable textbook for anyone taking a statistics class, or a nice piece of additional reading for anyone having trouble with a statistics class, or a nice gift for someone with a gambling problem. -- David L Nicol "fans of liza minelli should always be disconnected immediately" -- Matthew Henry From davidnicol at gmail.com Wed Jun 7 14:43:36 2006 From: davidnicol at gmail.com (David Nicol) Date: Wed, 7 Jun 2006 16:43:36 -0500 Subject: [Kc] tuesday the 13th at 7, planet sub Message-ID: <934f64a20606071443q2af39002ke09c4fbb52206b8b@mail.gmail.com> Although the web page is not updated and should IMO merely link to the mailing list archive, wherever that is, next tuesday we will meet. I'm willing to talk about the monty hall problem, and what aspect about it -- the nonrandom revealing of the bad choice -- makes it work, but hopefully that will not take up much time and I am not going to introduce the topic unless asked. I can also talk about what it took to write a perl interface to the SEE ecmascript engine and why the work isn't on CPAN yet Outside of me, there should be discussion of preparations for YAPC::NA in Chicago, discussion of what to expect at a YAPC, and of course sandwiches and beer. -- David L Nicol From amoore at mooresystems.com Wed Jun 7 17:06:19 2006 From: amoore at mooresystems.com (Andrew Moore) Date: Wed, 7 Jun 2006 19:06:19 -0500 Subject: [Kc] tuesday the 13th at 7, planet sub In-Reply-To: <934f64a20606071443q2af39002ke09c4fbb52206b8b@mail.gmail.com> References: <934f64a20606071443q2af39002ke09c4fbb52206b8b@mail.gmail.com> Message-ID: <20060608000619.GA1395@mooresystems.com> David (and other mongers) - Sounds great. See you there! (if I remember) -Andy From calendar-notification at google.com Mon Jun 12 17:00:20 2006 From: calendar-notification at google.com (Google Calendar) Date: Mon, 12 Jun 2006 17:00:20 -0700 (PDT) Subject: [Kc] [Reminder] Perl Mongers Meeting @ Tue, Jun 13 7pm - 9pm (2 hrs) Message-ID: <14971073.109001150156820664.JavaMail.doozer@qbin9.prod.google.com> kc at pm.org, this is a reminder for Title: Perl Mongers Meeting Time: Tue, Jun 13 7pm - 9pm (2 hrs) (Central Standard Time) Where: Planet Sub, 4936 Main St, Kansas City, MO Description: Semi-regular meeting of the Kansas City Perl Mongers. Subs, beer and the world's greatest programming language; what more could you ask for? You can view this event at http://www.google.com/calendar/event?action=VIEW&eid=bDliYzNwZGhiazFvanQxZDJuZjlpZDJ1NWcga2NAcG0ub3Jn&tok=MTkjdG1jaGVzc2VyQGdtYWlsLmNvbTk1ZDhhYzQ3OWZiODc5ZTY4ZWRiNzUwMWI1MzBmZjc5ZGIzYjhkNmQ&ctz=America%2FChicago&lcl=en_US Sign up for Google Calendar at http://www.google.com/calendar/render?eid=bDliYzNwZGhiazFvanQxZDJuZjlpZDJ1NWcga2NAcG0ub3Jn&tok=MTkjdG1jaGVzc2VyQGdtYWlsLmNvbTk1ZDhhYzQ3OWZiODc5ZTY4ZWRiNzUwMWI1MzBmZjc5ZGIzYjhkNmQ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/kc/attachments/20060612/fddd2ff6/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/calendar Size: 1197 bytes Desc: not available Url : http://mail.pm.org/pipermail/kc/attachments/20060612/fddd2ff6/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ics Size: 1197 bytes Desc: not available Url : http://mail.pm.org/pipermail/kc/attachments/20060612/fddd2ff6/attachment-0001.bin From amoore at mooresystems.com Wed Jun 14 08:09:07 2006 From: amoore at mooresystems.com (Andrew Moore) Date: Wed, 14 Jun 2006 10:09:07 -0500 Subject: [Kc] [Reminder] Perl Mongers Meeting @ Tue, Jun 13 7pm - 9pm (2 hrs) In-Reply-To: <14971073.109001150156820664.JavaMail.doozer@qbin9.prod.google.com> References: <14971073.109001150156820664.JavaMail.doozer@qbin9.prod.google.com> Message-ID: <20060614150907.GB13381@mooresystems.com> On Mon, Jun 12, 2006 at 05:00:20PM -0700, Google Calendar wrote: > Title: Perl Mongers Meeting > Time: Tue, Jun 13 7pm - 9pm (2 hrs) (Central Standard Time) > Where: Planet Sub, 4936 Main St, Kansas City, MO > Description: Semi-regular meeting of the Kansas City Perl Mongers. Subs, beer and the world's greatest programming language; what more could you ask for? It was good seeing the gang again last night. I'll try to bring back some news or something from YAPC. David - Thanks for the tip on SEE. I'll probably try to make it test my javascript code. -A From davidnicol at gmail.com Wed Jun 14 10:17:12 2006 From: davidnicol at gmail.com (David Nicol) Date: Wed, 14 Jun 2006 12:17:12 -0500 Subject: [Kc] last night went pretty well did it not? Message-ID: <934f64a20606141017i7f1a65e1k87cc87d6022b4046@mail.gmail.com> so we're on for next month too, to have our intrepid voyagers Doug and Andrew discuss their adventures in Chicago. Who's for setting up a domain registry? There are enough commercial static IP addresses between kcpm and kclug that we could easily do reliable name service. -- David L Nicol "Daggy music is one way to make the hoons leave an area"