From andrew.mcfarland at unite.net Fri Aug 3 04:36:18 2001 From: andrew.mcfarland at unite.net (Andrew McFarland) Date: Tue Aug 3 23:54:09 2004 Subject: Viewing HTTP headers Message-ID: <5.1.0.14.0.20010803103208.009e8b40@127.0.0.1> I'd like to use perl to view the HTTP headers that a web server sends out. ISTR seeing a very short (one liner?) way of doing this, but I can't find it again. Can anybody help? Andrew -- Andrew McFarland UNITE Solutions http://www.unite.net/ From mwk at stray-toaster.co.uk Fri Aug 3 04:43:30 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: Viewing HTTP headers In-Reply-To: <5.1.0.14.0.20010803103208.009e8b40@127.0.0.1>; from Andrew McFarland on Fri, Aug 03, 2001 at 10:36:18AM +0100 References: <5.1.0.14.0.20010803103208.009e8b40@127.0.0.1> Message-ID: <20010803104330.B32526@tux.blackstar.co.uk> On Fri, Aug 03, 2001 at 10:36:18AM +0100, Andrew McFarland wrote: > I'd like to use perl to view the HTTP headers that a web server sends out. > ISTR seeing a very short (one liner?) way of doing this, but I can't find > it again. Can anybody help? > > Andrew Hi Andrew, LWP::UserAgent is your friend. Or maybe LWP::Simple, but I don't think that that gives header info. Tho it is good for one-liners. m. From Paul_Marquess at yahoo.co.uk Fri Aug 3 04:55:07 2001 From: Paul_Marquess at yahoo.co.uk (Paul Marquess) Date: Tue Aug 3 23:54:09 2004 Subject: Viewing HTTP headers In-Reply-To: <5.1.0.14.0.20010803103208.009e8b40@127.0.0.1> Message-ID: From: owner-belfast-pm@pm.org [mailto:owner-belfast-pm@pm.org]On Behalf > I'd like to use perl to view the HTTP headers that a web server > sends out. > ISTR seeing a very short (one liner?) way of doing this, but I can't find > it again. Can anybody help? > > Andrew > > -- > Andrew McFarland > UNITE Solutions > http://www.unite.net/ > $ lwp-request -de http://www.unite.net/ Connection: close Date: Fri, 03 Aug 2001 09:54:32 GMT Accept-Ranges: bytes Server: Apache/1.3.11 (Unix) Content-Length: 645 Content-Type: text/html ETag: "1729-285-39b38ba7" Last-Modified: Mon, 04 Sep 2000 11:46:47 GMT Client-Date: Fri, 03 Aug 2001 09:55:32 GMT Client-Peer: 212.3.160.3:80 _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From tony at kasei.com Fri Aug 3 05:21:18 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: Viewing HTTP headers In-Reply-To: <5.1.0.14.0.20010803103208.009e8b40@127.0.0.1>; from andrew.mcfarland@unite.net on Fri, Aug 03, 2001 at 10:36:18AM +0100 References: <5.1.0.14.0.20010803103208.009e8b40@127.0.0.1> Message-ID: <20010803112118.B2459@blackstar.co.uk> On Fri, Aug 03, 2001 at 10:36:18AM +0100, Andrew McFarland wrote: > I'd like to use perl to view the HTTP headers that a web server sends out. > ISTR seeing a very short (one liner?) way of doing this, but I can't find > it again. Can anybody help? HEAD http://www.site.com/ Tony -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/belfast-pm/attachments/20010803/e561e2fa/attachment.bin From andrew.mcfarland at unite.net Fri Aug 3 05:43:07 2001 From: andrew.mcfarland at unite.net (Andrew McFarland) Date: Tue Aug 3 23:54:09 2004 Subject: Viewing HTTP headers In-Reply-To: References: <5.1.0.14.0.20010803103208.009e8b40@127.0.0.1> Message-ID: <5.1.0.14.0.20010803114226.009f8010@127.0.0.1> At 10:55 03/08/2001 +0100, Paul Marquess wrote: >$ lwp-request -de http://www.unite.net/ Thanks. From george_umia1 at yahoo.com Tue Aug 7 22:28:34 2001 From: george_umia1 at yahoo.com (George Umia) Date: Tue Aug 3 23:54:09 2004 Subject: VENTURE CAPITAL Message-ID: <200108071936.f77JaQC01505@gocho.pm.org> URGENT BUSINESS PROPOSAL This letter may come to you as a surprise since it is coming from someone you have not met before. However, we decided to contact you based on a satisfactory information we had about your business person as regard business information concerning your country and the safety of our funds in a steady economy such as that of your country compared to our country Nigeria Africa. I am a civil adviser currently working with the monitoring committee overseeing the winding up of the petroleum trust fund(PTF).Myself and my close and trusted colleagues need your assistance in the transfer of US$25 million into any reliable Account you may nominate overseas. This fund was generated from over-invoicing of contracts executed by the PTF under the administration of the past military government. These were discovered while we were reviewing the PTF accounts. From our discoveries, these contracts have been executed and the contractors in question were all paid. The difference of US$25,000,000 being the over-invoiced amount is the funds, we want your corporate entity to help us receive. What we want from you is a good and reliable company or personal Account into which we shall transfer this fund. Details should include the following: 1. Name of Bank 2. Address of Bank with Fax & Tel. 3. Account Number 4. Beneficiary/Signatory to Account (Account Name) Upon the Successful crediting of your account. The fund will be shared as follows: 1. 20% for you and your assistance 2. 75% for myself & my Colleagues 3. 5% for contingency expenses Please after your first reply through e-mail I will want us to continue further communication by fax and telephone for confidential purpose. We wish to assure you that your involvement should you decide to assist us, will be well protected, and also, this business, proposal is 100% risk free as we have put a whole lot into it. Thank you for your anticipated cooperation while we look forward to a mutually benefiting business relationship with you. Please when replying to my e-mail kindly include your telephone, fax number and mobile telephone numbers preferably extremely private numbers where we can reach you any time of the day. Please be aware that a high level of confidentiality and trust is required in this business. You can reach me on my confidential telephone number 234 1 7754093 and my fax number 234 9 2720239. Best Regards, George Umia. Tel No.: 234 1 7754093 Fax No.:234 9 2720239 Email:drgeorgeumia@eudoramail.com _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From russell at futureless.org Tue Aug 21 10:33:09 2001 From: russell at futureless.org (Russell Matbouli) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc Message-ID: <20010821163309.B27464@futureless.org> Hello again, I'm back from Egypt, been back a while actually, but had to catch up with everything back here (filling my drinking quota, etc). I didn't find any camel souvenirs, but saw some in the zoo so that will have to do. When is the next meeting, what's the topic and who is speaking? Any chance we could have it before the 5th of September, as I'll be away again after that... Who went to YAPC? Anything interesting to report back? What's happening about the website and the tshirts? Does anyone know of companies looking for a student to program for them part time, or that may be interested in sponsoring a student to do a project for them perhaps? Please contact me (preferably off-list) if you want more information or can put me in contact with someone who might need me. Thanks, Russell, apologetic after blatent job-seeking -- Computers are useless. They can only give you answers. -- Pablo Picasso From mwk at stray-toaster.co.uk Tue Aug 21 10:40:49 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821163309.B27464@futureless.org>; from Russell Matbouli on Tue, Aug 21, 2001 at 04:33:09PM +0100 References: <20010821163309.B27464@futureless.org> Message-ID: <20010821164049.D1529@tux.blackstar.co.uk> On Tue, Aug 21, 2001 at 04:33:09PM +0100, Russell Matbouli wrote: > Hello again, And could someone tell me how to use a mail client correctly? bah, sorry russell. so that great outburst of wit was only read by you. And if you forward it, don't forget to LEAVE THE FUNNY BITS in. As I can imagine it would arrive without them.... m. From mwk at stray-toaster.co.uk Tue Aug 21 10:44:46 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821164049.D1529@tux.blackstar.co.uk>; from Stray Toaster on Tue, Aug 21, 2001 at 04:40:49PM +0100 References: <20010821163309.B27464@futureless.org> <20010821164049.D1529@tux.blackstar.co.uk> Message-ID: <20010821164446.E1529@tux.blackstar.co.uk> On Tue, Aug 21, 2001 at 04:40:49PM +0100, Stray Toaster wrote: > On Tue, Aug 21, 2001 at 04:33:09PM +0100, Russell Matbouli wrote: > > Hello again, > > And could someone tell me how to use a mail client correctly? bah, sorry russell. > > so that great outburst of wit was only read by you. And if you forward it, don't forget > to LEAVE THE FUNNY BITS in. As I can imagine it would arrive without them.... My humour is too subtle. I'm off............. From mwk at stray-toaster.co.uk Tue Aug 21 10:44:46 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821164049.D1529@tux.blackstar.co.uk>; from Stray Toaster on Tue, Aug 21, 2001 at 04:40:49PM +0100 References: <20010821163309.B27464@futureless.org> <20010821164049.D1529@tux.blackstar.co.uk> Message-ID: <20010821164446.E1529@tux.blackstar.co.uk> On Tue, Aug 21, 2001 at 04:40:49PM +0100, Stray Toaster wrote: > On Tue, Aug 21, 2001 at 04:33:09PM +0100, Russell Matbouli wrote: > > Hello again, > > And could someone tell me how to use a mail client correctly? bah, sorry russell. > > so that great outburst of wit was only read by you. And if you forward it, don't forget > to LEAVE THE FUNNY BITS in. As I can imagine it would arrive without them.... My humour is too subtle. I'm off............. From steve at blackstar.co.uk Tue Aug 21 10:46:11 2001 From: steve at blackstar.co.uk (steve@blackstar.co.uk) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821164446.E1529@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Tue, Aug 21, 2001 at 04:44:46PM +0100 References: <20010821163309.B27464@futureless.org> <20010821164049.D1529@tux.blackstar.co.uk> <20010821164446.E1529@tux.blackstar.co.uk> Message-ID: <20010821164611.A8010@blackstar.co.uk> Might I suggest that you go and have a lie down Marc. It's obviously not your day. Steve From mwk at stray-toaster.co.uk Tue Aug 21 10:46:24 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821164446.E1529@tux.blackstar.co.uk>; from Stray Toaster on Tue, Aug 21, 2001 at 04:44:46PM +0100 References: <20010821163309.B27464@futureless.org> <20010821164049.D1529@tux.blackstar.co.uk> <20010821164446.E1529@tux.blackstar.co.uk> Message-ID: <20010821164624.F1529@tux.blackstar.co.uk> On Tue, Aug 21, 2001 at 04:44:46PM +0100, Stray Toaster wrote: > On Tue, Aug 21, 2001 at 04:40:49PM +0100, Stray Toaster wrote: > > On Tue, Aug 21, 2001 at 04:33:09PM +0100, Russell Matbouli wrote: > > > Hello again, > > > > And could someone tell me how to use a mail client correctly? bah, sorry russell. > > > > so that great outburst of wit was only read by you. And if you forward it, don't forget > > to LEAVE THE FUNNY BITS in. As I can imagine it would arrive without them.... > > My humour is too subtle. I'm off............. AAAAAAAAAAAAAAARRRRRRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH From duggie at blackstar.co.uk Tue Aug 21 10:50:17 2001 From: duggie at blackstar.co.uk (duggie@blackstar.co.uk) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821164446.E1529@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Tue, Aug 21, 2001 at 04:44:46PM +0100 References: <20010821163309.B27464@futureless.org> <20010821164049.D1529@tux.blackstar.co.uk> <20010821164446.E1529@tux.blackstar.co.uk> Message-ID: <20010821165017.A28751@blackstar.co.uk> Anyone see what Mark[sic] has done there? It's good that, the way Cc: would send it the same address as To: just in case it didn't go through? Yes.... Thanks Duggie On (21/08/01 16:44), Stray Toaster wrote: On Tue, Aug 21, 2001 at 04:40:49PM +0100, Stray Toaster wrote: > On Tue, Aug 21, 2001 at 04:33:09PM +0100, Russell Matbouli wrote: > > Hello again, > > And could someone tell me how to use a mail client correctly? bah, sorry russell. > > so that great outburst of wit was only read by you. And if you forward it, don't forget > to LEAVE THE FUNNY BITS in. As I can imagine it would arrive without them.... My humour is too subtle. I'm off............. From steve-pmbelfast at blackstar.co.uk Tue Aug 21 10:55:08 2001 From: steve-pmbelfast at blackstar.co.uk (Steve Rushe) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821163309.B27464@futureless.org>; from russell@futureless.org on Tue, Aug 21, 2001 at 04:33:09PM +0100 References: <20010821163309.B27464@futureless.org> Message-ID: <20010821165508.A9188@blackstar.co.uk> On Tue, Aug 21, 2001 at 04:33:09PM +0100, Russell Matbouli wrote: > Hello again, > > When is the next meeting, what's the topic and who is speaking? Any chance > we could have it before the 5th of September, as I'll be away again after > that... Who went to YAPC? Anything interesting to report back? What's > happening about the website and the tshirts? Well if we still want to have the meetings on a Tuesday (I don't know why we started like that), then next Tuesday is our best bet. This is because it's the only Tuesday before the 5th! We could go for another day if people fancy? Also do we want to meet in BlackStar or elsewhere (such as a pub)? Please note that I say this as a non-alcohol drinker! As for the website, I'll do it. Nothing much else seems to be happening so I'll run it up at the weekend and put it somewhere for people to ridicule. So if anyone has anything they think should go on it, such as slides, talks etc. email me at steve@blackstar.co.uk Steve From russell-belfast-pm at futureless.org Tue Aug 21 10:57:10 2001 From: russell-belfast-pm at futureless.org (Russell Matbouli) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821164049.D1529@tux.blackstar.co.uk> References: <20010821163309.B27464@futureless.org> <20010821164049.D1529@tux.blackstar.co.uk> Message-ID: <20010821165710.D27464@futureless.org> On Tue, Aug 21, 2001 at 04:40:49PM +0100, Stray Toaster wrote: > And could someone tell me how to use a mail client correctly? bah, sorry russell. > > so that great outburst of wit was only read by you. And if you forward it, don't forget > to LEAVE THE FUNNY BITS in. As I can imagine it would arrive without them.... I was laughing so hard at your infinitely witty and sophisticated email, that I fell on to my keyboard, accidentally deleting your email forever. It didn't even mention quota, nor any other unix tools. Russell -- Computers are useless. They can only give you answers. -- Pablo Picasso From mwk at stray-toaster.co.uk Tue Aug 21 10:58:50 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821165508.A9188@blackstar.co.uk>; from Steve Rushe on Tue, Aug 21, 2001 at 04:55:08PM +0100 References: <20010821163309.B27464@futureless.org> <20010821165508.A9188@blackstar.co.uk> Message-ID: <20010821165850.B3640@tux.blackstar.co.uk> On Tue, Aug 21, 2001 at 04:55:08PM +0100, Steve Rushe wrote: > Well if we still want to have the meetings on a Tuesday (I don't know > why we started like that), then next Tuesday is our best bet. This is > because it's the only Tuesday before the 5th! > > We could go for another day if people fancy? Considering I am off that week, could it be Thursday instead? Historic reasons.... > > Also do we want to meet in BlackStar or elsewhere (such as a pub)? > Please note that I say this as a non-alcohol drinker! > I am free and easy as to the venue. > As for the website, I'll do it. Nothing much else seems to be happening > so I'll run it up at the weekend and put it somewhere for people to > ridicule. So if anyone has anything they think should go on it, such as > slides, talks etc. email me at steve@blackstar.co.uk Oh, is that another cue for me to huff then? m. From russell-belfast-pm at futureless.org Tue Aug 21 11:43:00 2001 From: russell-belfast-pm at futureless.org (Russell Matbouli) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821165850.B3640@tux.blackstar.co.uk> References: <20010821163309.B27464@futureless.org> <20010821165508.A9188@blackstar.co.uk> <20010821165850.B3640@tux.blackstar.co.uk> Message-ID: <20010821174300.F27464@futureless.org> On Tue, Aug 21, 2001 at 04:58:50PM +0100, Stray Toaster wrote: > Considering I am off that week, could it be Thursday instead? Historic > reasons.... Is that the 23rd then? Suits me, what about everyone else? > > Also do we want to meet in BlackStar or elsewhere (such as a pub)? > > Please note that I say this as a non-alcohol drinker! > > I am free and easy as to the venue. If it's going to be a pub, are we going to decide on the night and meet up at Blackstar beforehand or just decide now? Please note that I say this as an alcohol drinker. =) > > As for the website, I'll do it. Nothing much else seems to be happening > > so I'll run it up at the weekend and put it somewhere for people to > > ridicule. So if anyone has anything they think should go on it, such as > > slides, talks etc. email me at steve@blackstar.co.uk > > Oh, is that another cue for me to huff then? Did we get Andrew and Marty's slides from the last meeting then? Are there any slides from before then? Marc: I think you can huff now, if you haven't exceeded your huffing quota Russell -- Computers are useless. They can only give you answers. -- Pablo Picasso From andrew at soto.kasei.com Tue Aug 21 11:27:51 2001 From: andrew at soto.kasei.com (Andrew Wilson) Date: Tue Aug 3 23:54:09 2004 Subject: Meetings etc In-Reply-To: <20010821165850.B3640@tux.blackstar.co.uk> Message-ID: <20010821172751.A22336@soto.kasei.com> On Tue, Aug 21, 2001 at 04:58:50PM +0100, Stray Toaster wrote: >On Tue, Aug 21, 2001 at 04:55:08PM +0100, Steve Rushe wrote: >> Well if we still want to have the meetings on a Tuesday (I don't know >> why we started like that), then next Tuesday is our best bet. This is >> because it's the only Tuesday before the 5th! >> >> We could go for another day if people fancy? > > Considering I am off that week, could it be Thursday instead? Historic > reasons.... Thursdays don't suit me, I'd prefer another day. Actually the latter half of the week doesn't really suit me. I actually think we started on Mondays. I don't know why either, probably because the latter half of the week didn't suit me. >> Also do we want to meet in BlackStar or elsewhere (such as a pub)? > Please note that I say this as a non-alcohol drinker! > > I am free and easy as to the venue. Yeah so am I. I'm reasonably happy to go whereever someone else has organised it to be :-) cheers Andrew From steve-pmbelfast at blackstar.co.uk Wed Aug 22 05:26:51 2001 From: steve-pmbelfast at blackstar.co.uk (Steve Rushe) Date: Tue Aug 3 23:54:09 2004 Subject: Next meeting Message-ID: <20010822112651.A31142@blackstar.co.uk> Right As far a I can gather this is the situation. 1. We want to have a meeting, preferably before the 5th of September. 2. The end of the week is out as Andrew can't make it. 3. Marc doesn't want it on Tuesday next week as he's busy. This would appear to leave us with next Monday as the only day nobody's objected to yet! That's the 27th. Any objections? Going once... Might I propose that after the next meeting we set up the first Monday or Tuesday of the month as the regular day for belfast.pm meetings? Steve From mwk at stray-toaster.co.uk Wed Aug 22 05:36:58 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: Next meeting In-Reply-To: <20010822112651.A31142@blackstar.co.uk>; from Steve Rushe on Wed, Aug 22, 2001 at 11:26:51AM +0100 References: <20010822112651.A31142@blackstar.co.uk> Message-ID: <20010822113658.D11265@tux.blackstar.co.uk> On Wed, Aug 22, 2001 at 11:26:51AM +0100, Steve Rushe wrote: > Right > > As far a I can gather this is the situation. > > 1. We want to have a meeting, preferably before the 5th of September. > > 2. The end of the week is out as Andrew can't make it. > > 3. Marc doesn't want it on Tuesday next week as he's busy. > > This would appear to leave us with next Monday as the only day nobody's > objected to yet! That's the 27th. Any objections? Going once... > > Might I propose that after the next meeting we set up the first Monday > or Tuesday of the month as the regular day for belfast.pm meetings? > > Steve this will be fine as long as you don't expect me to be there! :-( m. From steve-pmbelfast at blackstar.co.uk Wed Aug 22 05:46:31 2001 From: steve-pmbelfast at blackstar.co.uk (Steve Rushe) Date: Tue Aug 3 23:54:09 2004 Subject: Yet another stab at this Message-ID: <20010822114631.A11292@blackstar.co.uk> After much tooing and froing etc this is the plan. We'll have a meeting on the 4th of September and thereafter on the first Tuesday of the month. So that means the 2nd of October, 6th of November and 4th of December. If anyone has any objections to this I'll moan! Why did I try to sort this out? bye for now Steve From mwk at stray-toaster.co.uk Wed Aug 22 05:57:45 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: Yet another stab at this In-Reply-To: <20010822114631.A11292@blackstar.co.uk>; from Steve Rushe on Wed, Aug 22, 2001 at 11:46:31AM +0100 References: <20010822114631.A11292@blackstar.co.uk> Message-ID: <20010822115745.F11265@tux.blackstar.co.uk> On Wed, Aug 22, 2001 at 11:46:31AM +0100, Steve Rushe wrote: > After much tooing and froing etc this is the plan. > > We'll have a meeting on the 4th of September and thereafter on the first > Tuesday of the month. So that means the 2nd of October, 6th of November > and 4th of December. > Yes. Stick to the same plan. Makes it all easier. I agree. > If anyone has any objections to this I'll moan! > > Why did I try to sort this out? Because I moaned? m. From steve-pmbelfast at blackstar.co.uk Thu Aug 23 09:45:21 2001 From: steve-pmbelfast at blackstar.co.uk (Steve Rushe) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? Message-ID: <20010823154521.A12754@blackstar.co.uk> Afternoon all Now that we've sorted out when the next meeting is, yay, does anyone know what we're going to do? Does anyone want to volunteer to do a quick talk on something such as their favourite module, things they're working on in perl or "Inline::Webchat", for example? I'll probably parade a few possible candidates for the web site as I'm planning on doing little over the next weekend other that working on it. (This being down to my currently very sore shoulder stopping me from moving the furniture around. I've just moved, I don't move furniture for fun!). If not, we'll probably meet up and then end up staring at each other for a while before going to the pub. I'll also probably bug people on the best namespaces for a couple of modules I'm working on, all of which have strange temporary names because I can't make up my mind :( right, get talking... Steve ps. If Marc starts answering this, please try to answer one of the questions I've asked before the inevitable wind-up ;) From mwk at stray-toaster.co.uk Thu Aug 23 10:11:26 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823154521.A12754@blackstar.co.uk>; from Steve Rushe on Thu, Aug 23, 2001 at 03:45:21PM +0100 References: <20010823154521.A12754@blackstar.co.uk> Message-ID: <20010823161126.H29905@tux.blackstar.co.uk> On Thu, Aug 23, 2001 at 03:45:21PM +0100, Steve Rushe wrote: > Afternoon all > > Now that we've sorted out when the next meeting is, yay, does anyone > know what we're going to do? Does anyone want to volunteer to do a quick > talk on something such as their favourite module, things they're working > on in perl or "Inline::Webchat", for example? > An idea has been mooted to me, but I feel it better to let them speak for themselves!! (hint hint hint) As for me, errr, possibly, but I would like something suitable quirky to speak on. Howsabout a lightning talk idea? That way you can show scant knowledge, but impress over a short time, then melt into the (inevitable) crowd that will be there cheering you on.... > I'll probably parade a few possible candidates for the web site as I'm > planning on doing little over the next weekend other that working on it. > (This being down to my currently very sore shoulder stopping me from > moving the furniture around. I've just moved, I don't move furniture for > fun!). > go on, Steve.... > If not, we'll probably meet up and then end up staring at each other for > a while before going to the pub. I'll also probably bug people on the > best namespaces for a couple of modules I'm working on, all of which > have strange temporary names because I can't make up my mind :( Namespaces you say? Sounds serious.... > ps. If Marc starts answering this, please try to answer one of the > questions I've asked before the inevitable wind-up ;) damn! too late! I *was* going to ignore it and push my own agenda. Now that you (Steve) is in charge, I can be a subversive.... horray! (I must stop using that) m. From steve-pmbelfast at blackstar.co.uk Thu Aug 23 10:33:55 2001 From: steve-pmbelfast at blackstar.co.uk (Steve Rushe) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823161126.H29905@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Thu, Aug 23, 2001 at 04:11:26PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> Message-ID: <20010823163355.A18998@blackstar.co.uk> On Thu, Aug 23, 2001 at 04:11:26PM +0100, Stray Toaster wrote: > > > If not, we'll probably meet up and then end up staring at each other for > > a while before going to the pub. I'll also probably bug people on the > > best namespaces for a couple of modules I'm working on, all of which > > have strange temporary names because I can't make up my mind :( > > Namespaces you say? Sounds serious.... Nope I just don't know what to call them and I may gather opinions. > > ps. If Marc starts answering this, please try to answer one of the > > questions I've asked before the inevitable wind-up ;) > > damn! too late! I *was* going to ignore it and push my own agenda. Now > that you (Steve) is in charge, I can be a subversive.... In charge? Nope, I deny that. I'm not turning into Dave Cross or Greg McCarroll. I'm merely trying to prod you lot enough to overcome the inertia! Steve ps. This went to Marc direct by accident which may explain any comments he makes about me for the next while! From mwk at stray-toaster.co.uk Thu Aug 23 10:41:32 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823163355.A18998@blackstar.co.uk>; from Steve Rushe on Thu, Aug 23, 2001 at 04:33:55PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823163355.A18998@blackstar.co.uk> Message-ID: <20010823164132.J29905@tux.blackstar.co.uk> On Thu, Aug 23, 2001 at 04:33:55PM +0100, Steve Rushe wrote: > > ps. This went to Marc direct by accident which may explain any comments > he makes about me for the next while! Never let it be said that I am anything but petty! And I am still is a (partial) huff.... m. From mwk at stray-toaster.co.uk Thu Aug 23 10:46:17 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823164132.J29905@tux.blackstar.co.uk>; from Stray Toaster on Thu, Aug 23, 2001 at 04:41:32PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823163355.A18998@blackstar.co.uk> <20010823164132.J29905@tux.blackstar.co.uk> Message-ID: <20010823164617.K29905@tux.blackstar.co.uk> On Thu, Aug 23, 2001 at 04:41:32PM +0100, Stray Toaster wrote: > On Thu, Aug 23, 2001 at 04:33:55PM +0100, Steve Rushe wrote: > > > > ps. This went to Marc direct by accident which may explain any comments > > he makes about me for the next while! > > Never let it be said that I am anything but pretty! why thank you m, you are a gentleman. m. From tony at kasei.com Thu Aug 23 11:24:31 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823161126.H29905@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Thu, Aug 23, 2001 at 04:11:26PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> Message-ID: <20010823172431.A15943@blackstar.co.uk> On Thu, Aug 23, 2001 at 04:11:26PM +0100, Stray Toaster wrote: > I do not think that word means what you think it means.... Tony -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/belfast-pm/attachments/20010823/af7a9cf2/attachment.bin From tony at kasei.com Thu Aug 23 11:28:16 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823163355.A18998@blackstar.co.uk>; from steve-pmbelfast@blackstar.co.uk on Thu, Aug 23, 2001 at 04:33:55PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823163355.A18998@blackstar.co.uk> Message-ID: <20010823172816.A21153@blackstar.co.uk> On Thu, Aug 23, 2001 at 04:33:55PM +0100, Steve Rushe wrote: > > Namespaces you say? Sounds serious.... > Nope I just don't know what to call them and I may gather opinions. How about gathering opinions on the list? Tony -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/belfast-pm/attachments/20010823/0e3aafa4/attachment.bin From tony at kasei.com Thu Aug 23 11:29:25 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823154521.A12754@blackstar.co.uk>; from steve-pmbelfast@blackstar.co.uk on Thu, Aug 23, 2001 at 03:45:21PM +0100 References: <20010823154521.A12754@blackstar.co.uk> Message-ID: <20010823172925.B21153@blackstar.co.uk> On Thu, Aug 23, 2001 at 03:45:21PM +0100, Steve Rushe wrote: > Now that we've sorted out when the next meeting is, yay, does anyone > know what we're going to do? Does anyone want to volunteer to do a quick > talk on something such as their favourite module, things they're working > on in perl or "Inline::Webchat", for example? I vote that some people talk about different modules that they've found useful, but that other people may not know about. 15 mins tops each. Tony -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/belfast-pm/attachments/20010823/e0d290b8/attachment.bin From mwk at stray-toaster.co.uk Thu Aug 23 12:18:52 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823172431.A15943@blackstar.co.uk>; from Tony Bowden on Thu, Aug 23, 2001 at 05:24:31PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823172431.A15943@blackstar.co.uk> Message-ID: <20010823181852.N29905@tux.blackstar.co.uk> On Thu, Aug 23, 2001 at 05:24:31PM +0100, Tony Bowden wrote: > On Thu, Aug 23, 2001 at 04:11:26PM +0100, Stray Toaster wrote: > > > > I do not think that word means what you think it means.... Dman that not-sensible-reply-to header! I have sent the reply to this to Tony, and not the list. And damned if I am going to type it all again. Or recall it from wherever mutt put it. I am just going to go home, a tired, broken and bitter man. m. From mwk at stray-toaster.co.uk Thu Aug 23 12:16:07 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823172431.A15943@blackstar.co.uk>; from Tony Bowden on Thu, Aug 23, 2001 at 05:24:31PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823172431.A15943@blackstar.co.uk> Message-ID: <20010823181607.M29905@tux.blackstar.co.uk> On Thu, Aug 23, 2001 at 05:24:31PM +0100, Tony Bowden wrote: > On Thu, Aug 23, 2001 at 04:11:26PM +0100, Stray Toaster wrote: > > > > I do not think that word means what you think it means.... Ah, but I tried typing 'weedling' and it just didn't look right. 'weidling' neither. And I *could* be trying to get out of using responsibility, which would be wielding said responsibility, or rather, wielding the responsibility to get out of having any responsibility. Ah, but I still am stuck on 'weed-ling'. who knows? not I. Is it even a real word, the thing I am trying to spell? I give up round about now. m. From andrew at soto.kasei.com Thu Aug 23 12:22:30 2001 From: andrew at soto.kasei.com (Andrew Wilson) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823181852.N29905@tux.blackstar.co.uk> Message-ID: <20010823182230.F30799@soto.kasei.com> On Thu, Aug 23, 2001 at 06:18:52PM +0100, Stray Toaster wrote: > On Thu, Aug 23, 2001 at 05:24:31PM +0100, Tony Bowden wrote: > > On Thu, Aug 23, 2001 at 04:11:26PM +0100, Stray Toaster wrote: > > > > > > > I do not think that word means what you think it means.... > > Dman that not-sensible-reply-to header! I have sent the reply to this to > Tony, and not the list. And damned if I am going to type it all again. > Or recall it from wherever mutt put it. I am just going to go home, a > tired, broken and bitter man. I suspect my original reply also went to Tony. Anyway stop trying to wheedle[0] out of you don't know what that word means criticism. cheers Andrew [0] I think this was the word you probably wanted. From tony at kasei.com Thu Aug 23 12:25:15 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823181852.N29905@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Thu, Aug 23, 2001 at 06:18:52PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823172431.A15943@blackstar.co.uk> <20010823181852.N29905@tux.blackstar.co.uk> Message-ID: <20010823182515.A20383@blackstar.co.uk> On Thu, Aug 23, 2001 at 06:18:52PM +0100, Stray Toaster wrote: > Dman that not-sensible-reply-to header! Go D-Man! in .muttrc: subscribe belfast-pm@pm.org To reply use L instead of r. > Or recall it from wherever mutt put it. Do you have an Fcc? I tend to put my incoming and outgoing messages from the same person / list in the same folder... makes things much easier. (But I've bounced your reply on to the list anyway) Tony -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/belfast-pm/attachments/20010823/c603e110/attachment.bin From tony at kasei.com Thu Aug 23 12:26:33 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823181607.M29905@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Thu, Aug 23, 2001 at 06:16:07PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823172431.A15943@blackstar.co.uk> <20010823181607.M29905@tux.blackstar.co.uk> Message-ID: <20010823182633.A21088@blackstar.co.uk> On Thu, Aug 23, 2001 at 06:16:07PM +0100, Stray Toaster wrote: > And I *could* be trying to get out of using responsibility, which would > be wielding said responsibility, or rather, wielding the responsibility > to get out of having any responsibility. I do not think that grammar works how you think it works. Tony -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/belfast-pm/attachments/20010823/828cc00e/attachment.bin From mwk at stray-toaster.co.uk Thu Aug 23 12:31:07 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823182633.A21088@blackstar.co.uk>; from Tony Bowden on Thu, Aug 23, 2001 at 06:26:33PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823172431.A15943@blackstar.co.uk> <20010823181607.M29905@tux.blackstar.co.uk> <20010823182633.A21088@blackstar.co.uk> Message-ID: <20010823183107.P29905@tux.blackstar.co.uk> On Thu, Aug 23, 2001 at 06:26:33PM +0100, Tony Bowden wrote: > On Thu, Aug 23, 2001 at 06:16:07PM +0100, Stray Toaster wrote: > > And I *could* be trying to get out of using responsibility, which would > > be wielding said responsibility, or rather, wielding the responsibility > > to get out of having any responsibility. > > I do not think that grammar works how you think it works. It sounded alright to the grammar in my head. Right, now I am broken, and I *still* haven't gone home. And some decent show has already started on Radio4, which means that when I leave I will be stuck with The Archers....maybe I will wait until Front Row starts.... heave-ho. m. From wesley at yelsew.com Thu Aug 23 13:18:09 2001 From: wesley at yelsew.com (Wesley Darlington) Date: Tue Aug 3 23:54:09 2004 Subject: So anyone fancy doing a talk? In-Reply-To: <20010823181607.M29905@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Thu, Aug 23, 2001 at 06:16:07PM +0100 References: <20010823154521.A12754@blackstar.co.uk> <20010823161126.H29905@tux.blackstar.co.uk> <20010823172431.A15943@blackstar.co.uk> <20010823181607.M29905@tux.blackstar.co.uk> Message-ID: <20010823141809.A65134@paat.pair.com> On Thu, Aug 23, 2001 at 06:16:07PM +0100, Stray Toaster wrote: > On Thu, Aug 23, 2001 at 05:24:31PM +0100, Tony Bowden wrote: > > On Thu, Aug 23, 2001 at 04:11:26PM +0100, Stray Toaster wrote: > > > > > > > I do not think that word means what you think it means.... > > Ah, but I tried typing 'weedling' and it just didn't look right. > 'weidling' neither. > > And I *could* be trying to get out of using responsibility, which would > be wielding said responsibility, or rather, wielding the responsibility > to get out of having any responsibility. > > Ah, but I still am stuck on 'weed-ling'. > > who knows? not I. Is it even a real word, the thing I am trying to > spell? I give up round about now. May I suggest `weaseling'...? Perhaps with another ell. Of course, anybody who knows you will heap scorn upon the notion of applying such an epithet to one as unweasel-like as you, Marc. :-), Wesley. From sleepy_uk at hotmail.com Sat Aug 25 13:18:09 2001 From: sleepy_uk at hotmail.com (Scott McWhirter) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI Message-ID: hey all, this is more a 'what would you do' question than anything else. I'm wondering... What's the best way to get back multiple fields in muliple rows from a table. An example would be well appreciated. Also: blackstar peeps, if you have any spare mysql books that i used to use and would be willing to give/sell to me then please contact me offlist. Thanx! -- -Sco- _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp From andrew at rivendale.net Sat Aug 25 15:23:13 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI In-Reply-To: References: Message-ID: <20010825212313.A1213@gandalf.rivendale.net> On Sat, Aug 25, 2001 at 06:18:09PM +0000, Scott McWhirter wrote: > hey all, > > this is more a 'what would you do' question than anything else. I'm > wondering... What's the best way to get back multiple fields in muliple rows > from a table. An example would be well appreciated. There are lots of options, i'll give you my favourite. This sets up a statement handle, binds some variables to the values that will be returned and then does a little loop. Every time you call $sth->fetch it sets the three bound variables to the values of the next row. my $query = qq{ # Q-Some_identifier-001 SELECT foo bar baz FROM animal WHERE goes = ? }; my $sth = $dbi->prepare($query); $sth->execute('moo') or die "can't $query"; $sth->bind_columns(\my ($foo, $bar, $baz)) or dir "can't bind columns $query"; while ($sth->fetch) { print "Foo = $foo"; print "Bar = $bar"; print "Baz = $baz"; } Or you can do something like: my $query = qq{ # Q-Some_identifier-001 SELECT foo bar baz FROM animal WHERE goes = ? }; my @lol = @{ $dbh->selectall_arrayref($query, undef, 'moo') }; foreach my $row (@LOL) { my @row = @{ $row }; print "Foo = $row[0]"; print "Bar = $row[1]"; print "Baz = $row[1]"; } These two examples have showed how to set up a statement handle and then call a fetch method on that or just call select method directly on the database handle. You can do things to get back hashes where the keys of the hash are the column names in your table this is all pretty well covered in the DBI POD. DO perldoc DBI. cheers Andrew From tony at kasei.com Sat Aug 25 16:39:38 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI In-Reply-To: ; from sleepy_uk@hotmail.com on Sat, Aug 25, 2001 at 06:18:09PM +0000 References: Message-ID: <20010825223938.A7071@blackstar.co.uk> On Sat, Aug 25, 2001 at 06:18:09PM +0000, Scott McWhirter wrote: > this is more a 'what would you do' question than anything else. I'm > wondering... What's the best way to get back multiple fields in muliple rows > from a table. An example would be well appreciated. Use an abstraction layer, such as the wonderful Class::DBI::mysql - package Foo::Tablename; __PACKAGE__->set_db('Main', @dbi_connect_info); __PACKAGE__->set_up_table('tablename'); 1; package main; use Class::DBI::mysql; foreach my $row (Foo::Tablename->search(wibble => 'bar')) { print $row->wibble, $row->some_other_column, $row->etc; } Tony -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/belfast-pm/attachments/20010825/f2c4864e/attachment.bin From sleepy_uk at hotmail.com Sun Aug 26 13:56:23 2001 From: sleepy_uk at hotmail.com (Scott McWhirter) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI Message-ID: >Tony Blurted: >Use an abstraction layer, such as the wonderful Class::DBI::mysql - Is Class::DBI::mysql on cpan now? i can't seem to find it there. -- -Sco- _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp From mwk at stray-toaster.co.uk Sun Aug 26 14:13:35 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI In-Reply-To: ; from Scott McWhirter on Sun, Aug 26, 2001 at 06:56:23PM +0000 References: Message-ID: <20010826201335.B30339@tux.blackstar.co.uk> On Sun, Aug 26, 2001 at 06:56:23PM +0000, Scott McWhirter wrote: > >Tony Blurted: > >Use an abstraction layer, such as the wonderful Class::DBI::mysql - > > Is Class::DBI::mysql on cpan now? i can't seem to find it there. > It is on cpan afaik, but you will also find it on belfast.pm.org. As the author rightly points out, it is wonderful. ;-) m. From andrew at rivendale.net Sun Aug 26 17:35:50 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI In-Reply-To: <20010826201335.B30339@tux.blackstar.co.uk> References: <20010826201335.B30339@tux.blackstar.co.uk> Message-ID: <20010826233550.A2609@gandalf.rivendale.net> On Sun, Aug 26, 2001 at 08:13:35PM +0100, Stray Toaster wrote: > It is on cpan afaik, but you will also find it on belfast.pm.org. As the > author rightly points out, it is wonderful. ;-) For things you can use it for it's brilliant. Sometimes you still need to know how to do the SQL/DBI thing yourself. The DBI docs themselves are good, most of what you need is in them. They are much more useful than the MySQL book. cheers Andrew From tony at kasei.com Mon Aug 27 04:16:11 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI In-Reply-To: ; from sleepy_uk@hotmail.com on Sun, Aug 26, 2001 at 06:56:23PM +0000 References: Message-ID: <20010827101611.A23524@blackstar.co.uk> On Sun, Aug 26, 2001 at 06:56:23PM +0000, Scott McWhirter wrote: > Is Class::DBI::mysql on cpan now? i can't seem to find it there. How are you looking for it? http://search.cpan.org/search?mode=module&query=Class%3A%3ADBI%3A%3Amysql should get you what you want. Always use search.cpan.org. Tony From tony at kasei.com Mon Aug 27 04:19:34 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI In-Reply-To: <20010826233550.A2609@gandalf.rivendale.net>; from andrew@rivendale.net on Sun, Aug 26, 2001 at 11:35:50PM +0100 References: <20010826201335.B30339@tux.blackstar.co.uk> <20010826233550.A2609@gandalf.rivendale.net> Message-ID: <20010827101934.A24075@blackstar.co.uk> On Sun, Aug 26, 2001 at 11:35:50PM +0100, Andrew Wilson wrote: > For things you can use it for it's brilliant. Sometimes you still need > to know how to do the SQL/DBI thing yourself. Of course, I'd love to know what things you can't do with Class::DBI[::mysql], that you often need to, so I can consider adding it to one or the other ;) Tony From andrew at rivendale.net Mon Aug 27 04:42:32 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:09 2004 Subject: mysql DBI In-Reply-To: <20010827101934.A24075@blackstar.co.uk> References: <20010826201335.B30339@tux.blackstar.co.uk> <20010826233550.A2609@gandalf.rivendale.net> <20010827101934.A24075@blackstar.co.uk> Message-ID: <20010827104232.A560@gandalf.rivendale.net> On Mon, Aug 27, 2001 at 10:19:34AM +0100, Tony Bowden wrote: > On Sun, Aug 26, 2001 at 11:35:50PM +0100, Andrew Wilson wrote: > > For things you can use it for it's brilliant. Sometimes you still need > > to know how to do the SQL/DBI thing yourself. > > Of course, I'd love to know what things you can't do with > Class::DBI[::mysql], that you often need to, so I can consider adding > it to one or the other ;) I was thinking about joins across multiple tables with lots of filtering. If you just get back the objects and use perl to do the selection you could end up making tens or hundreds of thousands of obects to get the six or seven that you actually want. The other time you might need it is to add to or debug Class::DBI :-) cheers Andrew From paddy at earth.li Mon Aug 27 05:29:08 2001 From: paddy at earth.li (Patrick Moore) Date: Tue Aug 3 23:54:09 2004 Subject: 'lo Message-ID: <20010827112908.B9302@the.earth.li> hullo all, finally got around to joining the pm list, so I thought I'd say hello. "Hello!" paddy -- oOoOo Red ship crashes into blue ship - sailors marooned... oOoOo oOoOo oOoOo oOoOo oOoOo From mwk at stray-toaster.co.uk Mon Aug 27 05:31:39 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: 'lo In-Reply-To: <20010827112908.B9302@the.earth.li>; from Patrick Moore on Mon, Aug 27, 2001 at 11:29:08AM +0100 References: <20010827112908.B9302@the.earth.li> Message-ID: <20010827113139.C11457@tux.blackstar.co.uk> On Mon, Aug 27, 2001 at 11:29:08AM +0100, Patrick Moore wrote: > hullo all, > > finally got around to joining the pm list, so I thought I'd say hello. > > "Hello!" > > paddy > Hello then, and welcome to a noise free list! (Most times, it is a message free list as well, but we do try.) come along to the meeting, and say hello in person! m. From bazza at bazza.com Mon Aug 27 05:35:49 2001 From: bazza at bazza.com (barry) Date: Tue Aug 3 23:54:09 2004 Subject: 'lo In-Reply-To: <20010827112908.B9302@the.earth.li>; from paddy@earth.li on Mon, Aug 27, 2001 at 11:29:08AM +0100 References: <20010827112908.B9302@the.earth.li> Message-ID: <20010827113549.A15428@bazza.com> On Mon, Aug 27, 2001 at 11:29:08AM +0100, Patrick Moore mumbled: > hullo all, > finally got around to joining the pm list, so I thought I'd say hello. > "Hello!" hiya! of course this is my first post here too, amazing how many recognisable names you see around, anyway, to keep this at least a bit perl related, I got bored yesterday and ran code2html on a bunch of my really sloppily written code snippits and shoved them at http://bazza.com/code/ for people to go and poke fun and laugh at -- -Barry Hughes Veni, vidi, velcro... I came, I saw, I stuck around http://bazza.com/ From paddy at earth.li Mon Aug 27 05:38:19 2001 From: paddy at earth.li (Patrick Moore) Date: Tue Aug 3 23:54:09 2004 Subject: 'lo In-Reply-To: <20010827113139.C11457@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Mon, Aug 27, 2001 at 11:31:39AM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113139.C11457@tux.blackstar.co.uk> Message-ID: <20010827113819.C9302@the.earth.li> * On Mon, Aug 27, 2001 at 11:31:39AM +0100, Stray Toaster said: > Hello then, and welcome to a noise free list! (Most times, it is a > message free list as well, but we do try.) Oh, okey then :) * paddy plots, evilly > come along to the meeting, and say hello in person! Oh, maybe :) next tuesday isn't it? -- ----------( "I give it 4 stars, three bars, and a lemon, )---------- paddy ----( just because." - Dan Ceppa )---- yddap Htag.pl 0.0.19 From mwk at stray-toaster.co.uk Mon Aug 27 05:40:19 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:09 2004 Subject: 'lo In-Reply-To: <20010827113819.C9302@the.earth.li>; from Patrick Moore on Mon, Aug 27, 2001 at 11:38:19AM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113139.C11457@tux.blackstar.co.uk> <20010827113819.C9302@the.earth.li> Message-ID: <20010827114019.F11457@tux.blackstar.co.uk> On Mon, Aug 27, 2001 at 11:38:19AM +0100, Patrick Moore wrote: > * On Mon, Aug 27, 2001 at 11:31:39AM +0100, Stray Toaster said: > > Hello then, and welcome to a noise free list! (Most times, it is a > > message free list as well, but we do try.) > > Oh, okey then :) > > * paddy plots, evilly Go on, try your worstest. ;-) > > > come along to the meeting, and say hello in person! > > Oh, maybe :) > > next tuesday isn't it? errr............I should know this, right? Um, yeh. (After quick look at site.) From paddy at earth.li Mon Aug 27 05:46:51 2001 From: paddy at earth.li (Patrick Moore) Date: Tue Aug 3 23:54:09 2004 Subject: 'lo In-Reply-To: <20010827114019.F11457@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Mon, Aug 27, 2001 at 11:40:19AM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113139.C11457@tux.blackstar.co.uk> <20010827113819.C9302@the.earth.li> <20010827114019.F11457@tux.blackstar.co.uk> Message-ID: <20010827114651.E9302@the.earth.li> * On Mon, Aug 27, 2001 at 11:40:19AM +0100, Stray Toaster said: > > > Hello then, and welcome to a noise free list! (Most times, it is a > > > message free list as well, but we do try.) > > Oh, okey then :) > > * paddy plots, evilly > Go on, try your worstest. ;-) hrm.. given the level of traffic I generate on other lists I'm on, erm, nah.. :) > > > > > come along to the meeting, and say hello in person! > > Oh, maybe :) > > next tuesday isn't it? > errr............I should know this, right? Um, yeh. (After quick look at > site.) heh :) -- ----------( "Life lately has been one long doppler )---------- paddy ----( shift..." -- Cat )---- yddap Htag.pl 0.0.19 From andrew at rivendale.net Mon Aug 27 08:12:38 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:09 2004 Subject: 'lo In-Reply-To: <20010827113549.A15428@bazza.com> References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> Message-ID: <20010827141238.A2982@gandalf.rivendale.net> On Mon, Aug 27, 2001 at 11:35:49AM +0100, barry wrote: > On Mon, Aug 27, 2001 at 11:29:08AM +0100, Patrick Moore mumbled: > > hullo all, > > finally got around to joining the pm list, so I thought I'd say hello. > > "Hello!" > > hiya! of course this is my first post here too, amazing how many recognisable > names you see around, anyway, to keep this at least a bit perl related, I got > bored yesterday and ran code2html on a bunch of my really sloppily written > code snippits and shoved them at http://bazza.com/code/ for people to go and > poke fun and laugh at Hi bazza, Well, since you've asked ... I've had a look a photos.html #!/usr/bin/perl -w ################## &static; foreach(<*>) { next if($_ =~ /~/); next if($_ =~ /cgi/); if($_ =~ /jpg/) { print "\"\"  $_\n"; $commentfile = ".$_-comment"; if (-e $commentfile) { open(COMMENT, ".$_-comment"); $comment = ; print "$comment"; close(COMMENT); } } else { print "\"\"  $_/\n"; $commentfile = ".$_-comment"; if (-e $commentfile) { open(COMMENT, ".$_-comment"); $comment = ; print "$comment"; close(COMMENT); } } } &end; sub static { print < Photos \n END } sub end { print <
END } Some of these are minor niggles, this one isn't you havent used strict. that's almost always a mistake. You don't name the variable that you use to control the loop but then you dont take proper advantage of $_ either. either do foreach (<*>) { next if /~/; next if m#.cgi$#; if (m#.jpg#) { ... or do this foreach my $file (<*>) { next if $file =~ /~/; next if $file =~ m#.cgi$#; if ($file =~ m#.jpg#) { ... I don't like your regular expressions they match too much. For instance /cgi/ matches map_of_dirs_containg_cgi_files.jpg and lots of other things that you don't really want. /\.cgi$/ is a much tighter and hence much less likely to false match regexp. same with /jpg/, should be /\.jpg$/ or if you don't like /\ use m instead m#.cgi$# and m#.jpg$# This is a style thing and you can feel free to ignore it. I don't like long lines like the ones you have in your HTML. You can break the HTML on whitespace and I think that makes it easier to read. you aren't taking proper advantage of perls quoting operators either. You have a habit of doing "I want quotes in here so I'll do this \"" when what you should be doing is qq{I want quotes in here so I'll do this "} There is no real need for the subroutines unless you put them in some other file and import them. Much better to use a templating system have a look at Template toolkit, it's excellent. This is definitely a problem, you have identical code in both halves of the if/else statement. You should extract it. Also you weren't closing the
tag if there was no comment. I've refactored it a bit below including the comments I made. As you can see I've eliminated the if/else statement altogether, ther was only one word of difference in the two sections. For things like that you can use the ternary operator my $src = ($file =~ m#.jpg$#) ? "image2" : "folder"; if $file matches m#.jpg$# then $src is set to "image2" otherwise it's set to "folder". #!/usr/bin/perl -w ################## use strict; print < Photos
../Previous Dir
END foreach my $file (<*>) { next if $file =~ /~/; next if $file =~ m#.cgi$#; my $src = ($file =~ m#.jpg$#) ? "image2" : "folder"; print qq{ }; my $commentfile = ".$file-comment"; if (-e $commentfile) { open(COMMENT, ".$file-comment"); my $comment = ; close(COMMENT); print qq{ }; } print qq{\n}; } print <
END Hopefully you found that useful. cheers Andrew From bazza at bazza.com Mon Aug 27 08:31:00 2001 From: bazza at bazza.com (barry) Date: Tue Aug 3 23:54:09 2004 Subject: 'lo In-Reply-To: <20010827141238.A2982@gandalf.rivendale.net>; from andrew@rivendale.net on Mon, Aug 27, 2001 at 02:12:38PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> Message-ID: <20010827143100.A18077@bazza.com> On Mon, Aug 27, 2001 at 02:12:38PM +0100, Andrew Wilson mumbled: > Hi bazza, > > Well, since you've asked ... I've had a look a photos.html > Some of these are minor niggles, this one isn't you havent used > strict. that's almost always a mistake. that's generally a major failing of mine, it's not something I've ever managed to get into the habit of doing > You don't name the variable that you use to control the loop but then > you dont take proper advantage of $_ either. > either do > foreach (<*>) { > next if /~/; > next if m#.cgi$#; > if (m#.jpg#) { > ... this is the way I'd like to do things, but for some odd reason I seem to do somthing wrong and it never works if I don't directly use $_ > I don't like your regular expressions they match too much. For > instance /cgi/ matches map_of_dirs_containg_cgi_files.jpg and lots of > other things that you don't really want. > /\.cgi$/ is a much tighter and hence much less likely to false match > regexp. > same with /jpg/, should be /\.jpg$/ or if you don't like /\ use > m instead m#.cgi$# and m#.jpg$# again, sort of similar to above, it's sloppiness, never getting into habits of things, and not doing enough work with this stuff > This is a style thing and you can feel free to ignore it. I don't > like long lines like the ones you have in your HTML. You can break > the HTML on whitespace and I think that makes it easier to read. > you aren't taking proper advantage of perls quoting operators either. > You have a habit of doing "I want quotes in here so I'll do this \"" > when what you should be doing is > qq{I want quotes in here so I'll do this "} I didn't even know about that > There is no real need for the subroutines unless you put them in some > other file and import them. Much better to use a templating system > have a look at Template toolkit, it's excellent. > This is definitely a problem, you have identical code in both halves > of the if/else statement. You should extract it. Also you weren't > closing the
tag if there was no comment. Yeah, templating is something I need to poke around at a lot, even for my main page it'd come in a lot more useful than that stuff I'm doing now, another big part of the problem is that once I write stuff, I /very/ rarely go back to it to clean it up, or implement things I've learnt since that have improved coding, the webcam cgi is probably my latest of the things on there, which doesn't use subroutines, and does put different things in depending on how it's called or what it's meant to be doing, shall save this and have a pour over it .. thanks -- -Barry Hughes An unbreakable toy is useful for breaking other toys http://bazza.com/ From bazza at bazza.com Mon Aug 27 08:33:59 2001 From: bazza at bazza.com (barry) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827143100.A18077@bazza.com>; from bazza@bazza.com on Mon, Aug 27, 2001 at 02:31:00PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827143100.A18077@bazza.com> Message-ID: <20010827143359.A18285@bazza.com> (side note, doing a group reply to that in mutt made Andrew's email address just so it tried to go local .... wierd) -- -Barry Hughes "But you should keep in mind that we don't do windows" -- John Campbell, Hubble Program manager on using computers with 2 megabytes of memory on the telescope http://bazza.com/ From andrew at rivendale.net Mon Aug 27 08:42:13 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827143359.A18285@bazza.com> References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827143100.A18077@bazza.com> <20010827143359.A18285@bazza.com> Message-ID: <20010827144213.A3060@gandalf.rivendale.net> On Mon, Aug 27, 2001 at 02:33:59PM +0100, barry wrote: > (side note, doing a group reply to that in mutt made Andrew's email address > just so it tried to go local .... wierd) that would be my fault my reply-to header is getting set to Andrew Wilson I should probably go for a hoke about in .muttrc to see why. cheers Andrew From andrew at rivendale.net Mon Aug 27 10:04:47 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827141238.A2982@gandalf.rivendale.net> References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> Message-ID: <20010827160447.A3169@gandalf.rivendale.net> On Mon, Aug 27, 2001 at 02:12:38PM +0100, Andrew Wilson wrote: > #!/usr/bin/perl -w > ################## > > use strict; > > print < Content-Type: text/html > Photos > >
../ Previous Dir
   $file $comment
> > > > > END > > foreach my $file (<*>) { > next if $file =~ /~/; > next if $file =~ m#.cgi$#; > my $src = ($file =~ m#.jpg$#) ? "image2" : "folder"; > > print qq{ > > }; > > my $commentfile = ".$file-comment"; > if (-e $commentfile) { > open(COMMENT, ".$file-comment"); > my $comment = ; > close(COMMENT); > print qq{ > > }; > } > print qq{\n}; > } > > print <
> > ../ > > Previous Dir >
> > >    > $file > > $comment >
>
> > >
> > > END Hey Marc! are you asleep or pretending to have a life or something. I was expecting you to be all over this bemoaning the fact that I didn't recommend using the CGI object and generally pointing out the folly of my ways and things. cheers Andrew From tony at kasei.com Mon Aug 27 11:06:50 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827141238.A2982@gandalf.rivendale.net>; from andrew@rivendale.net on Mon, Aug 27, 2001 at 02:12:38PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> Message-ID: <20010827170650.A22319@blackstar.co.uk> On Mon, Aug 27, 2001 at 02:12:38PM +0100, Andrew Wilson wrote: > print < Content-Type: text/html Should there not be a \n after that content-type before anything else? > open(COMMENT, ".$file-comment"); Eeek. Always check your return values ... Tony From mwk at stray-toaster.co.uk Mon Aug 27 11:12:53 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827141238.A2982@gandalf.rivendale.net>; from Andrew Wilson on Mon, Aug 27, 2001 at 02:12:38PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> Message-ID: <20010827171253.B13788@tux.blackstar.co.uk> On Mon, Aug 27, 2001 at 02:12:38PM +0100, Andrew Wilson wrote: > On Mon, Aug 27, 2001 at 11:35:49AM +0100, barry wrote: > Well, since you've asked ... I've had a look a photos.html > > There is no real need for the subroutines unless you put them in some > other file and import them. Much better to use a templating system > have a look at Template toolkit, it's excellent. Another thing. This my be a bug bear of mine, but, godammit, get rid of all that html in the code!! Either put it all in a template file (T::T, HTML::Parser or one of their ilk) ot generate all the simple html via the CGI object! (In case you didn't know, I *like* the CGI object). I will refactor your (inc the bit by Andrew) later. Here is one I made earlier. (It took me 20 minutes to do, with a woman standing over my shoulder going 'you said you could knock that up in perl in 10 mins. Is it done yet?' Coding under (spouse) pressure. Focuses the mind.) #!/usr/bin/perl -w use Apache; use CGI qw(:standard); use strict; my $q = new CGI; my $r = Apache->request; (my $id = $r->path_info || 0) =~ s#^/##; my $PATH = $r->document_root . "/taz/pics"; chdir $PATH or warn "can't CHDIR to $PATH: $!"; my $addy = "http://www.thefamilykerr.co.uk/taz/"; my @pics = <*.jpg>; print $q->title("Taz - RIP"); print $q->h1("This was Taz, a very lovely (and loved) wee pussy cat"); my $next = $id + 4; $next = 1 if ($next > @pics); my $pic = $id ? $id : 1; $pic = 1 if ($pic > @pics); my $last_pic = $pic + 3; for ($pic .. $last_pic) { my $display = $_; my $base = $addy . "pics/$display.jpg"; my $img = qq{He was a menace
indeed!}; print $img; } my $url = $id ? $addy . "taz.cgi/$next" : $addy . "taz.cgi/5"; print $q->a({ -href => $url}, "Next pics"); OK, so not the best, but the links are generated with the cgi object. And the title, and the h1. See the pattern yet? Tables are easy too... I have code somewhere which, uselessly, generated a dropdown menu containing my exam results. But it is far nicer than having HTML mixed with your perl. Urgg. m. From nuance at blackstar.co.uk Mon Aug 27 11:13:37 2001 From: nuance at blackstar.co.uk (Andrew Wilson) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827170650.A22319@blackstar.co.uk>; from tony@kasei.com on Mon, Aug 27, 2001 at 05:06:50PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827170650.A22319@blackstar.co.uk> Message-ID: <20010827171337.D5204@blackstar.co.uk> On Mon, Aug 27, 2001 at 05:06:50PM +0100, Tony Bowden wrote: > On Mon, Aug 27, 2001 at 02:12:38PM +0100, Andrew Wilson wrote: > > print < > Content-Type: text/html > > Should there not be a \n after that content-type before anything else? > > > open(COMMENT, ".$file-comment"); > > Eeek. Always check your return values ... Both absolutely right, I'll consider my wrist slapped :-). I didn't completely go to town on the script anyway, I was trying for general pointers rather than the absolute best version of the script ever. cheers Andrew From tony at kasei.com Mon Aug 27 11:39:21 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827171253.B13788@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Mon, Aug 27, 2001 at 05:12:53PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> Message-ID: <20010827173921.A5747@blackstar.co.uk> On Mon, Aug 27, 2001 at 05:12:53PM +0100, Stray Toaster wrote: > my $next = $id + 4; > $next = 1 if ($next > @pics); > my $pic = $id ? $id : 1; > $pic = 1 if ($pic > @pics); > my $last_pic = $pic + 3; I really hate this bit of logic. I haven't a clue from looking at it what it does... and there are far too many magic numbers. Tony From mwk at stray-toaster.co.uk Mon Aug 27 11:52:33 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827173921.A5747@blackstar.co.uk>; from Tony Bowden on Mon, Aug 27, 2001 at 05:39:21PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> <20010827173921.A5747@blackstar.co.uk> Message-ID: <20010827175233.A14075@tux.blackstar.co.uk> On Mon, Aug 27, 2001 at 05:39:21PM +0100, Tony Bowden wrote: > On Mon, Aug 27, 2001 at 05:12:53PM +0100, Stray Toaster wrote: > > my $next = $id + 4; > > $next = 1 if ($next > @pics); > > my $pic = $id ? $id : 1; > > $pic = 1 if ($pic > @pics); > > my $last_pic = $pic + 3; > > I really hate this bit of logic. > > I haven't a clue from looking at it what it does... and there are far > too many magic numbers. The magic number is 20. As that is the number of pics my digicam holds, all of which are thumped onto a pics directory in my site. Then this will display four on a page. next being the next series of pics. (I have a script that names all the images files numerically, following on from the biggest one that exists already. Now *that* is a nasty piece of code.) So if we are going to try and display a picture which doesn't exist, bigger than the current biggest (which is the size of the array) then we just send 'em back to the first page. There is also a bit of simple anti-url hacking in there.... OK, I never said it was pretty, merely an example. And it does what I want it to do, without throwing errors, and to me, that was what mattered. (Pragmatist, from that test that we did when....errr...ignore that, it makes no sense.) perl, for all its fantastic-ness, allows cheap and nasty and quick coding. Which is what this is. m. who is no longer defensive over his code! From andrew at rivendale.net Mon Aug 27 12:19:34 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827175233.A14075@tux.blackstar.co.uk> References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> <20010827173921.A5747@blackstar.co.uk> <20010827175233.A14075@tux.blackstar.co.uk> Message-ID: <20010827181934.A3329@gandalf.rivendale.net> On Mon, Aug 27, 2001 at 05:52:33PM +0100, Stray Toaster wrote: > OK, I never said it was pretty, merely an example. And it does what I > want it to do, without throwing errors, and to me, that was what > mattered. (Pragmatist, from that test that we did when....errr...ignore > that, it makes no sense.) > > perl, for all its fantastic-ness, allows cheap and nasty and quick > coding. Which is what this is. > > m. who is no longer defensive over his code! I didn't really like it either ;-) I've done a slight refactoring (which I include below) again this isn't trying for the best ever version of Marc's digicam code, just a casual tidying. I gone with defining the number of pics per page and then I work in pages. I've assumed that your pictures start a 0 if they start at 1 then this doesn't work properly. Also if the number of pictures is not a multiple of pics per page then the last page shows how ever many are left. No doubt someone will point out some of the problems with my code here. cheers Andrew #!/usr/bin/perl -w use Apache; use CGI qw(:standard); use strict; # Some constants my $num_pics = 4 # pictures per page my $q = new CGI; my $r = Apache->request; (my $page = $r->path_info || 0) =~ s#^/##; my $PATH = $r->document_root . "/taz/pics"; chdir $PATH or warn "can't CHDIR to $PATH: $!"; my $addy = "http://www.thefamilykerr.co.uk/taz/"; my @pics = <*.jpg>; # Work out which pictures to show and what page is next my $pages = int(@pics / $num_pics); # If client playing silly buggers (looking for a page that isn't there) $page = 0 if ($page > $pages); my $begin = $page * $num_pics; my $end = $begin + $num_pics -1; $end = ($end > @pics) ? @pics : $end; my $next = $page + 1; # if it's the last page, wrap around $next = ($next > $pages) ? 1 : $next; print $q->title("Taz - RIP"); print $q->h1("This was Taz, a very lovely (and loved) wee pussy cat"); for my $display ($begin .. $end) { my $base = $addy . "pics/$display.jpg"; print qq{He was a menace indeed!}; } my $url = $page ? $addy . "taz.cgi/$next" : $addy . "taz.cgi/$num_pics"; print $q->a({ -href => $url}, "Next pics"); From tony at kasei.com Mon Aug 27 12:22:16 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827181934.A3329@gandalf.rivendale.net>; from andrew@rivendale.net on Mon, Aug 27, 2001 at 06:19:34PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> <20010827173921.A5747@blackstar.co.uk> <20010827175233.A14075@tux.blackstar.co.uk> <20010827181934.A3329@gandalf.rivendale.net> Message-ID: <20010827182216.A25499@blackstar.co.uk> On Mon, Aug 27, 2001 at 06:19:34PM +0100, Andrew Wilson wrote: > No doubt someone will point out some of the problems with my code > here. That comes later. For now, I'll point out the problems with your grammar, worth even of a Marc: > I gone with defining the number of pics per page and then I work in pages. ??? Tony From andrew at rivendale.net Mon Aug 27 12:24:05 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827181934.A3329@gandalf.rivendale.net> References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> <20010827173921.A5747@blackstar.co.uk> <20010827175233.A14075@tux.blackstar.co.uk> <20010827181934.A3329@gandalf.rivendale.net> Message-ID: <20010827182405.A3374@gandalf.rivendale.net> On Mon, Aug 27, 2001 at 06:19:34PM +0100, Andrew Wilson wrote: > #!/usr/bin/perl -w > > use Apache; > use CGI qw(:standard); > use strict; > > # Some constants > my $num_pics = 4 # pictures per page > > > my $q = new CGI; > my $r = Apache->request; > (my $page = $r->path_info || 0) =~ s#^/##; > > my $PATH = $r->document_root . "/taz/pics"; > chdir $PATH or warn "can't CHDIR to $PATH: $!"; > > my $addy = "http://www.thefamilykerr.co.uk/taz/"; > > my @pics = <*.jpg>; > > # Work out which pictures to show and what page is next > my $pages = int(@pics / $num_pics); > > # If client playing silly buggers (looking for a page that isn't there) > $page = 0 if ($page > $pages); > > my $begin = $page * $num_pics; > my $end = $begin + $num_pics -1; > $end = ($end > @pics) ? @pics : $end; > my $next = $page + 1; > > # if it's the last page, wrap around > $next = ($next > $pages) ? 1 : $next; > > > print $q->title("Taz - RIP"); > print $q->h1("This was Taz, a very lovely (and loved) wee pussy cat"); > > for my $display ($begin .. $end) { > my $base = $addy . "pics/$display.jpg"; > print qq{He was a menace indeed!}; > } > > my $url = $page ? $addy . "taz.cgi/$next" > : $addy . "taz.cgi/$num_pics"; > print $q->a({ -href => $url}, "Next pics"); Just spotted a bug, next should reinitialise to 0 not 1 :-( cheers Andrew From andrew at rivendale.net Mon Aug 27 12:29:56 2001 From: andrew at rivendale.net (Andrew Wilson) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827182216.A25499@blackstar.co.uk> References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> <20010827173921.A5747@blackstar.co.uk> <20010827175233.A14075@tux.blackstar.co.uk> <20010827181934.A3329@gandalf.rivendale.net> <20010827182216.A25499@blackstar.co.uk> Message-ID: <20010827182956.A3388@gandalf.rivendale.net> On Mon, Aug 27, 2001 at 06:22:16PM +0100, Tony Bowden wrote: > On Mon, Aug 27, 2001 at 06:19:34PM +0100, Andrew Wilson wrote: > > No doubt someone will point out some of the problems with my code > > here. > > That comes later. > > For now, I'll point out the problems with your grammar, worth even > of a Marc: > > > I gone with defining the number of pics per page and then I work in pages. Ah, grammar is it! Marc worked in pictures and had the concept of how many of these were on a page hard coded in his script. The whole code makes assumptions about how many pictures there are per page. I took a different tack, I defined a variable to hold the number of pictures per page. I then work in pages of pictures instead of just pictures. hopefully that's clearer. cheers Andrew From mwk at stray-toaster.co.uk Mon Aug 27 12:34:03 2001 From: mwk at stray-toaster.co.uk (Stray Toaster) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827182216.A25499@blackstar.co.uk>; from Tony Bowden on Mon, Aug 27, 2001 at 06:22:16PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> <20010827173921.A5747@blackstar.co.uk> <20010827175233.A14075@tux.blackstar.co.uk> <20010827181934.A3329@gandalf.rivendale.net> <20010827182216.A25499@blackstar.co.uk> Message-ID: <20010827183403.A14294@tux.blackstar.co.uk> On Mon, Aug 27, 2001 at 06:22:16PM +0100, Tony Bowden wrote: > On Mon, Aug 27, 2001 at 06:19:34PM +0100, Andrew Wilson wrote: > > No doubt someone will point out some of the problems with my code > > here. > > That comes later. > > For now, I'll point out the problems with your grammar, worth even > of a Marc: > > > I gone with defining the number of pics per page and then I work in pages. > > ??? Y'see, as this is worth(y) of me, I understand it!! I am involved (on another list) with people slagging of my grammar/turn of phrase. But English is a pretty elastic language, and if it wasn't, we would still be speaking Another thing, people, don't argue this sorta point with Tony, he will only win! m. From tony at kasei.com Mon Aug 27 12:49:38 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827183403.A14294@tux.blackstar.co.uk>; from mwk@stray-toaster.co.uk on Mon, Aug 27, 2001 at 06:34:03PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> <20010827173921.A5747@blackstar.co.uk> <20010827175233.A14075@tux.blackstar.co.uk> <20010827181934.A3329@gandalf.rivendale.net> <20010827182216.A25499@blackstar.co.uk> <20010827183403.A14294@tux.blackstar.co.uk> Message-ID: <20010827184938.A6737@blackstar.co.uk> On Mon, Aug 27, 2001 at 06:34:03PM +0100, Stray Toaster wrote: > English is a pretty elastic language, and if it wasn't, we would still > be speaking wrong!> German? Spanish? Hindi? Esperanto? Dog? Tony From tony at kasei.com Mon Aug 27 12:53:18 2001 From: tony at kasei.com (Tony Bowden) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827182956.A3388@gandalf.rivendale.net>; from andrew@rivendale.net on Mon, Aug 27, 2001 at 06:29:56PM +0100 References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827171253.B13788@tux.blackstar.co.uk> <20010827173921.A5747@blackstar.co.uk> <20010827175233.A14075@tux.blackstar.co.uk> <20010827181934.A3329@gandalf.rivendale.net> <20010827182216.A25499@blackstar.co.uk> <20010827182956.A3388@gandalf.rivendale.net> Message-ID: <20010827185318.B6737@blackstar.co.uk> On Mon, Aug 27, 2001 at 06:29:56PM +0100, Andrew Wilson wrote: > Ah, grammar is it! Ah, the great exclamative query! > hopefully that's clearer. Yes, it is. However it wasn't so much the clarity, as the wonderful use of "I gone with", with which I was finding much to compare to Marc. Tony From schwern at pobox.com Mon Aug 27 15:32:17 2001 From: schwern at pobox.com (Michael G Schwern) Date: Tue Aug 3 23:54:10 2004 Subject: 'lo In-Reply-To: <20010827170650.A22319@blackstar.co.uk> References: <20010827112908.B9302@the.earth.li> <20010827113549.A15428@bazza.com> <20010827141238.A2982@gandalf.rivendale.net> <20010827170650.A22319@blackstar.co.uk> Message-ID: <20010827163216.E9436@blackrider> On Mon, Aug 27, 2001 at 05:06:50PM +0100, Tony Bowden wrote: > > open(COMMENT, ".$file-comment"); > > Eeek. Always check your return values ... You can use Dunce::Files for that. -- Michael G. Schwern http://www.pobox.com/~schwern/ Perl6 Quality Assurance Kwalitee Is Job One Follow me to certain death! http://www.unamerican.com/