Re: Templating Solutions
At 08:36 AM 6/19/01 +0100, Leo wrote: >Have a look at this, TT2 based solution, it's a bit >bloated (as it includes page numbering and various other >functions): > >http://test.cuckoo.org/script_template.txt, >the key line is: >my $results = Emap::HolidayFinder::Tod::do_search(\%form_input,$dbh); [snip] Hope that's not copyrighted Emap code you have there :-) Rob
Re: Templating Solutions
At 04:36 PM 6/18/01 +0100, Greg wrote: >In a moment of stupidity[1] I agreed to write an article for lathos on >templating solutions for Perl. This was an attempt to finally break my >writing block/issues/mindset problems. It is going to be a compare and >contrast article and so far I've looked at, [list of CPAN templating modules] I'm sure many of us have written and used home grown templating systems such a simple regex over a basic template. It may be a good idea to compare the templating systems available on CPAN to a home grown one. What advantages they give and what are the disadvantages etc Rob
RE: Politics (was RE: BOFHs requiring license)
At 12:27 PM 5/14/01 +0100, you wrote: >> Hospital waiting lists are up, >> so are class sizes in schools. > >No, class sizes are down in primary schools (were primaries specified on the >pledge card?). Secondary school classes are level or *slightly* up, IIRC. Are they in reality, or is it due to the current lot being in lower birth years than the lot 4 years ago, and hence the secondary school numbers being up now? Rob
Re: Bah!
At 01:22 PM 5/10/01 +0100, David Cantrell wrote: >On Thu, May 10, 2001 at 01:05:19PM +0100, Steve Keay wrote: >> On Wed, May 09, 2001 at 05:04:23PM +0100, David Cantrell wrote: >> > I've been made redundant. Anyone want an Evil Programmer? >> > >> > http://www.cantrell.org.uk/david/cv >> >> funky server set up: >> >> [steve@webcache steve]$ telnet www.cantrell.org.uk 80 >> Trying 195.149.50.61... >> Connected to plough.barnyard.co.uk. >> Escape character is '^]'. >> GET /david/cv/cv.pdf HTTP/1.0 >> >> HTTP/1.1 404 Complete fuckup > >Yes, you did fuck up :-) > >It's cv20010510.pdf. I s'pose I should update my funky-skillo redirection >thing. I must remember to start calling symlinks that. It sounds far more impressive. Rob
Re: Native Code Experts
At 05:07 PM 5/4/01 +0100, Dave Cross wrote: >Thought you might be interested in this post from our frind the Hereford >Killer. Someone posted some code that used for(;;) loops. And this was bk's >response: [snipped excellent advice] >Remember, for loops are for JS, not perl. You cant use semicolons in perl, >unless theyre before a carriage return. > > >And this from someone who describes himself as a "PERL Master". Maybe we should send him the London pm review copy of the new Learning Perl when it arrives. I'm sure he'll appreciate this goodwill jesture, especially if a certain few take the trouble to autograph it for him. Rob
Re: Am I going nutts ? - read before answering!
[snipped my numbers formated as 0207 XX] >Shouldn't these numbers be formatted 020 7XXX Sh, it's designed to try to fool the sales bunnies. Rob
Re: Am I going nutts ? - read before answering!
At 03:03 PM 3/8/01 +, you wrote: >Oh, actually do you mean it is the same at: > >pageage LTest; > >BEGIN {require Test2} >BEGIN { warn "." } > >print "Here\n" > >1; [snip] Yup, that's right. So to get it to only have the one call, change your "use" to a require and put it in the BEGIN block. Rob -- Robert Price - Technical Manager - EMAP Digital Travel | Tel: 0207 3092711 Priory Court, 30-32 Farringdon Lane, London, EC1R 3AW | Fax: 0207 3092718
Re: Am I going nutts ? - read before answering!
At 02:52 PM 3/8/01 +, you wrote: >On Thu, Mar 08, 2001 at 02:59:27PM +0000, Robert Price wrote: >> I think the answer is that both the modules where the BEGINS are called >> twice have "use" in them. "use" means "BEGIN {require Module}", so BEGIN is >> being called once when the module is entered, and once when it is used. >> >> Rob >> >- SNIP - > >Fraid not.. tried moving the use out of the BEGIN before and it >made no difference: > >package LTest; > >use Test2; > >BEGIN { >warn "Test is beginning\n"; >} [snip] But you are still calling "use", and as I said earlier, that means there are still 2 BEGIN blocks, so both are being called. Test2 only has the one BEGIN call because it doesn't try to use. For example, your code is roughly the same as... package LTest; BEGIN {require Test2}; BEGIN { warn "Test is beginning\n"; } So you can see there are two BEGIN blocks that are being called. Or am I talking out of my arse? :-) Rob -- Robert Price - Technical Manager - EMAP Digital Travel | Tel: 0207 3092711 Priory Court, 30-32 Farringdon Lane, London, EC1R 3AW | Fax: 0207 3092718
Re: Am I going nutts ? - read before answering!
I think the answer is that both the modules where the BEGINS are called twice have "use" in them. "use" means "BEGIN {require Module}", so BEGIN is being called once when the module is entered, and once when it is used. Rob At 02:39 PM 3/8/01 +, Leo wrote: >Hi folks, got an odd one for you: > >Why is Dprof saying my LTest::BEGIN and mail::BEGIN >are running twice ? > >%Time ExclSec CumulS #Calls sec/call Csec/c Name > 33.4 0.010 0.010 2 0.0050 0.0050 main::BEGIN<- ? > 0.00 0.000 -0.000 1 0. - strict::import > 0.00 0.000 -0.000 1 0. - strict::bits > 0.00 0.000 -0.000 2 0. - LTest::BEGIN <- ? > 0.00 0.000 -0.000 1 0. - Test2::BEGIN > >I've actually got this problem but magnified in a larger >project which I'm trying to find a memory leak in.. I don't now >if this is related (BEGIN being run 4 to 17 times! in different >packages). > >Is this my code, my not understanding Dprof or something else ? > >perl -v >This is perl, v5.6.0 built for i386-linux > >test.pl >--- >#!/usr/bin/perl >use strict; >use LTest; > >package LTest; > >BEGIN { > use Test2; >warn "Test is beginning\n"; >} > >print "Here\n"; > >1; > >package Test2; > >BEGIN { >warn "Test2 is beginning\n"; >} > >1; > > >Oh, running this code gives: > >>./test.pl >Test2 is beginning >Test is beginning >Here > >Making is even wierder! As 'Test is..' only >prints once. > >Any help is much appreciated. > >Cheers > >Leo > > -- Robert Price - Technical Manager - EMAP Digital Travel | Tel: 0207 3092711 Priory Court, 30-32 Farringdon Lane, London, EC1R 3AW | Fax: 0207 3092718
Re: Perl Books
At 12:34 PM 2/1/01 +, jp wrote: [snip] >Totally unrelated, I wish they'd open a PC Bookshop in Farringdon. But it's only a 10-15 minute stroll to the one in Southampton Row from Farringdon. Rob