From chrisb at jesmond.demon.co.uk Sun Dec 1 05:11:39 2002 From: chrisb at jesmond.demon.co.uk (Chris Benson) Date: Wed Aug 4 00:10:58 2004 Subject: [robin@rszemeti.demon.co.uk: Perl advocacy opportunity ...] Message-ID: <20021201111139.B3147@gamma.home> ----- Forwarded message from robin szemeti ----- From: robin szemeti Date: Sun, 1 Dec 2002 10:42:54 +0000 To: london.pm@london.pm.org Subject: Perl advocacy opportunity ... hmmm ... http://www.news.jobserve.com/NewsStory.asp?SID=SID1259 Precis: the British Computer Society (http://www.bcs.org) run a programming competition every year (solve as many problems as possible in a given time) .. the languages on offer are C, C++ Java ... and new this year .. Visual Basic .. they hope to include C# next year :( So ... probably a bit of a non starter this year, how about we do the advocacy thing, try and first get Perl included, and then win the thing? Getting Perl onto the list would be the first challenge, but surely not that hard. Perhaps even if we could just get a place in one of the regional heats as a 'demonstration sport' sort of thing .... whupping the competition (and you know we can ) would be a feather in our caps. Sadly, their site is down right now so I can't see the precise rules ... AFAICT its a 'real life' thing where you actually have to turn up and do stuff so would involve coming into the outside world, probably whilst the daystar is shining brightly too ... but .. it could be worth it :) .. certainly raising the profile of Perl would be worthwhile, winning the competition wouldn't do your job prospects any harm either. Thoughts ... ? -- Robin Szemeti ----- End forwarded message ----- -- Chris Benson From chrisb at jesmond.demon.co.uk Mon Dec 2 04:37:45 2002 From: chrisb at jesmond.demon.co.uk (Chris Benson) Date: Wed Aug 4 00:10:58 2004 Subject: [mark@twoshortplanks.com: The 2002 Perl Advent Calendar] Message-ID: <20021202103745.B13167@gamma.home> More goodies from London.pm members ... ----- Forwarded message from Mark Fowler ----- From: Mark Fowler Date: Sun, 1 Dec 2002 19:50:55 +0000 (GMT) To: london.pm@london.pm.org Subject: The 2002 Perl Advent Calendar Doesn't December come round quickly? http://www.perladvent.org/2002/ Announcing the third Perl Advent Calendar, the Advent calendar that features a different Perl module each day of Advent, and a bonus module on Christmas day. This year's improvements include each day having it's own mini-tutorial attached, and much better html. Other features may be phased in during the Advent period. Hope everyone enjoys it. -- Mark Fowler http://www.twoshortplanks.com/ The 2002 Perl Advent Calendar mark@twoshortplanks.com http://www.perladvent.org/2002/ a different perl module featured every day ----- End forwarded message ----- -- Chris Benson From chrisb at jesmond.demon.co.uk Tue Dec 3 13:16:06 2002 From: chrisb at jesmond.demon.co.uk (Chris Benson) Date: Wed Aug 4 00:10:58 2004 Subject: Will swap book for review Message-ID: <20021203191606.A18725@gamma.home> Hi, As a Perl Mounger group we can get O'Reilly (and other publishers, but ORA are most accessible) to send sample books. Because of the low number of us, I've not bothered (and I have all the ORA books I want :-) But:- I have a spare copy of "Perl Database Programming" by Brent Michalski, J.Wiley & Sons 2002. This is available for free[1] to anyone who'll write a review of it. On London.pm they post reviews to the 'list which are collected on the website[2]: http://www.london.pm.org/reviews/ . The london.pm reviews also get sent to the DiverseBooks site http://news.diversebooks.com/ run by one of people on London.pm. I'd like to do the same ... If anyone is willing to commit to producing a review, please let me know off-list and I'll send it to the first respondee. [1] at zero monetary cost :-) [2] that reminds me that if anyone want to setup our website, you'll be most welcome! -- Chris Benson From alice at schiffwood.demon.co.uk Mon Dec 23 14:15:01 2002 From: alice at schiffwood.demon.co.uk (Alice Wood) Date: Wed Aug 4 00:10:58 2004 Subject: Help!!!! Message-ID: <200212232015.01739.alice@schiffwood.demon.co.uk> Ever had the feeling you've been doing too much! OK, for the first time ever I am attempting to install bits from CPAN (Is that groaning I hear). I am installing the Tk Bundle, so I follow all the bits from the Camel, the readme is useless. According to my listing I haveBundle::Tk installed, however, I am getting the following message. Can't locate Tk.pm in @INC (@INC contains: /usr/lib/perl5/i386-linux /usr/lib/perl5 /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl .) at test1 line 4. test1 is my program, so what do I do now. I think I need a mince pie, Crimble,crimble, Alice From David.Larkin at djl.co.uk Mon Dec 23 16:04:45 2002 From: David.Larkin at djl.co.uk (David Larkin) Date: Wed Aug 4 00:10:58 2004 Subject: Help!!!! References: <200212232015.01739.alice@schiffwood.demon.co.uk> Message-ID: <3E07887D.D12BF2AA@djl.co.uk> Alice Wood wrote: > Ever had the feeling you've been doing too much! > > OK, for the first time ever I am attempting to install bits from CPAN (Is that > groaning I hear). I am installing the Tk Bundle, so I follow all the bits > from the Camel, the readme is useless. According to my listing I > haveBundle::Tk installed, however, I am getting the following message. > > Can't locate Tk.pm in @INC (@INC contains: /usr/lib/perl5/i386-linux > /usr/lib/perl5 /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl > .) at test1 line 4. > > test1 is my program, so what do I do now. > > I think I need a mince pie, > > Crimble,crimble, > > Alice First thing to do is find out if you have it anywhere, and if you do, where ? find / -name Tk.pm -print should do the trick Once you've found it, either move to somewher in @INC or update @INC to include that directory From chrisb at jesmond.demon.co.uk Mon Dec 23 16:40:17 2002 From: chrisb at jesmond.demon.co.uk (Chris Benson) Date: Wed Aug 4 00:10:58 2004 Subject: Help!!!! In-Reply-To: <200212232015.01739.alice@schiffwood.demon.co.uk> References: <200212232015.01739.alice@schiffwood.demon.co.uk> Message-ID: <20021223224017.A21601@gamma.home> On Mon, Dec 23, 2002 at 08:15:01PM +0000, Alice Wood wrote: > Ever had the feeling you've been doing too much! All too frequently :-} > OK, for the first time ever I am attempting to install bits from CPAN (Is that > groaning I hear). I am installing the Tk Bundle, so I follow all the bits > from the Camel, the readme is useless. According to my listing I > haveBundle::Tk installed, however, I am getting the following message. You've not chosen the smallest module to install ... > Can't locate Tk.pm in @INC (@INC contains: /usr/lib/perl5/i386-linux > /usr/lib/perl5 /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl > .) at test1 line 4. Look for the file as Dave suggested. But be careful of copying it -- there's a bunch of related stuff:- (I was going to C+P the list is 180+ lines) including shared-libs built for your platform and version of Perl. One of the aggravations I have now is that gamma:~ $ /usr/bin/perl -v This is perl, v5.6.1 built for ppc-linux but gamma:~ $ perl -v This is perl, v5.8.0 built for ppc-linux gamma:~ $ type perl perl is hashed (/usr/local/bin/perl) So I have to make sure I build modules with the perl I intend to use them with. So: Q. Do you have multiple perl-s? Q. Do you have Tk.pm in the 'right' directory:- /usr/lib/perl5/site_perl/5.6.1/ppc-linux/Tk.pm /usr/local/lib/perl5/site_perl/5.8.0/ppc-linux/Tk.pm > test1 is my program, so what do I do now. > > I think I need a mince pie, Nothing but chocs and mince pies at work for two weeks ... I'm looking forward to the savoy cabbage, roast taties and parsnips :-) P.S. if you (can) add an Approved: pinkstuff line in the mailheaders to expedite your messages. -- Chris Benson From alice at schiffwood.demon.co.uk Wed Dec 25 11:59:29 2002 From: alice at schiffwood.demon.co.uk (Alice Wood) Date: Wed Aug 4 00:10:58 2004 Subject: Help Message-ID: <200212251759.30363.alice@schiffwood.demon.co.uk> Thanks for the hints guys, I am well on my way now, I hadn't thought of the version problem. A point to keep in mind I think. anyway, I hope you are all having a great time. Merry Xmas Alice From chrisb at jesmond.demon.co.uk Wed Dec 25 14:38:28 2002 From: chrisb at jesmond.demon.co.uk (Chris Benson) Date: Wed Aug 4 00:10:58 2004 Subject: trying out Tk.pm Message-ID: <20021225203828.A1590@gamma.home> I just came across these old demo scripts and since Alice is using Tk, I thought I'd forward them to the list just for info. tk1 two buttons, anonymous and named subs tk2 button + label + entry tk-grid using a grid to layout label + entry tk-query a database query app! Best wishes -- Chris Benson -------------- next part -------------- #!/usr/bin/perl -w use strict; use Tk; my $main = new MainWindow; my $b1 = $main->Button( -text => "Press me!", -command => sub {print "Ouch!\n"}); $b1->pack; my $b2 = $main->Button( -text => "Quit", -command => \&b2 ); $b2->pack; MainLoop; sub b2 { print "Done!\n"; exit } -------------- next part -------------- #!/usr/bin/perl -w use strict; use Tk; my $main = new MainWindow; $main->Button( -text => "Quit", -command => \&b2 )->pack(-side=>'bottom'); $main->Label( -text => "Message")->pack(-side=>'left'); my $e1 = $main->Entry( -width => 30 ); $e1->pack(-side => 'right', -fill => 'x'); MainLoop; sub b2 { print $e1->get ? $e1->get : 'Bye!'; exit } -------------- next part -------------- #!/usr/bin/perl -w use Tk; use strict; my($r, $c) = (0, 0); my $main = new MainWindow; $main->Label(-text => 'Entry1')->grid(-row => $r, -column => $c++); $main->Entry(-width => 20)->grid(-row => $r, -column => $c); ++$r; $c = 0; $main->Label(-text => 'Entry2')->grid(-row => $r, -column => $c++); $main->Entry(-width => 10)->grid(-row => $r, -column => $c); MainLoop; -------------- next part -------------- #!/usr/bin/perl -w use Tk; use DBI; use strict; use diagnostics; # open the database my $db = 'DBI:mysql:ipp'; $main::dbh = DBI->connect($db, $ENV{USER}) or die "$0: can't connect to database: $DBI::errstr\n"; # draw the screen my $main = new MainWindow; my $out = $main->Frame( -borderwidth => 2, -relief => 'groove'); $out->pack( -side => 'bottom', -fill => 'both'); my $msg = $main->Label( -width => 60, -anchor => 'w'); $msg->pack( -side => 'bottom', -fill => 'x'); $main->Label( -text => 'SQL Query')->pack( -side => 'left'); $main->Button( -text => 'Run Query', -command => \&run_query)->pack( -side => 'right'); my $e = $main->Entry( -width => 30); $e->pack( -fill => 'x', -expand => 1); # start! MainLoop; ####################################### # utility/callback functions sub run_query { # clear anything in the listbox my $x; foreach $x ( $out->gridSlaves ) { $x->destroy; } # run the query unless ( $e->get ) { $msg->configure(-text => 'Please enter a query first!'); return; } my $sth; unless ( $sth = $main::dbh->prepare( $e->get ) ) { $msg->configure(-text => "Prepare failed!: $DBI::errstr"); return; } unless ( $sth->execute ) { $msg->configure(-text => "Execute failed!: $DBI::errstr"); return; } # get results and push into listbox $msg->configure(-text => "Running ..."); $main->idletasks; # so we can see the message ## get column names and display my ($r, $c) = (0,0); foreach $x ( @{$sth->{NAME}} ) { $out->Label(-text => $x)->grid(-row=>$r, -column=>$c++); } ++$r; $c = 0; my @x; while ( @x = $sth->fetchrow_array ) { foreach $x (@x) { $out->Label(-text => $x)->grid(-row=>$r, -column=>$c++, -sticky => ($x =~ /^\d+$/) ? 'e' : 'w'); } ++$r; $c = 0; } # done $msg->configure(-text => "Selected ".$sth->rows." rows."); $sth->finish; }