Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

barbie (2653)

barbie
  reversethis-{ku. ... m} {ta} {eibrab}
http://barbie.missbarbell.co.uk/

Leader of Birmingham.pm [pm.org] and a CPAN author [cpan.org]. Co-organised YAPC::Europe in 2006 and the 2009 QA Hackathon, responsible for the YAPC Conference Surveys [yapc-surveys.org] and the QA Hackathon [qa-hackathon.org] websites. Also the current caretaker for the CPAN Testers websites and data stores.

If you really want to find out more, buy me a Guinness ;)

Links:
Memoirs of a Roadie [missbarbell.co.uk]
[pm.org]
CPAN Testers Reports [cpantesters.org]
YAPC Conference Surveys [yapc-surveys.org]
QA Hackathon [qa-hackathon.org]

Journal of barbie (2653)

Friday April 04, 2003
11:42 AM

Funky Chickens

[ #11448 ]
Had a good play around with Class::Phrasebook and Log::LogLite today. As a consequence I've re-evaluated my Devel::Trace module and now use Log::LogLite to handle all the file accessing. Will have to change the log template though, as it looks a bit messy.

Class::Phrasebook now holds all my SQL statements and makes life alot easier. I wish I'd know about this while at QIIS, the intranet was littered with SQL all over the place. One of the reasons it needs a big evaluation of the database.

Had a quick look at Regexp::Common, and may start using that too. Though from the docs it looks like there is limited support for UK codes. Might see if I can write a patch for some of the missing items. Mind you thats always assuming I get time.

I've ended up learning quite a few modules over the last year. Thanks in part to Mark's Perl Advent Calendar. I'm slowly looking up modules Acme has mention in various talks. I keep finding lists of modules that I really ought to take a look at, from notes taken at various talks over the last couple of years. I've made some headway, but CPAN is BIIIIIG :)

I have finally started to take a look at Damian Conway's book on Object Orientated Programming. Though with the way my free time is going at the moment, I might finish it before Christmas. My initial observations are really good. Like his talks, Damian knows just the right way to demystify the confusing, and explain things so you end up saying "Ah right. Now why didn't anyone explain it like that before?". I promised London.pm I'd send them a review back last year. Thankfully I didn't say when I'd submit it ;) Hopefully this year though.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Class::Phrasebook now holds all my SQL statements and makes life alot easier. I wish I'd know about this while at QIIS, the intranet was littered with SQL all over the place. One of the reasons it needs a big evaluation of the database.

    Did you end up finding a solution for using placeholders versus interpolated statements with Class::PHrasebook? After reading the perl.com article and reading the docs, I didn't see anything obvious.

    • It depends how you are using them. In the majority of cases I've been letting the DBD driver/database handle the placeholders. However, there are a few SQL statements that lend themselves to letting Class::Phrasebook handle them.

      For example I have a standard look up of all items in a table, "SELECT * FROM $table", the phrase is named "lookup". Another search allows for multi-column ordering (ascending and descending), and again I just add the columns in order depending on what the user selects.

      I've trie

      • No, I mean "SELECT * FROM $table" is not the same as "SELECT * FROM ?". The former is going to create a new execution plan every time you run it, the latter does not.

        Mind you, if you only run the query once, it makes no difference. I'm just wondering how you deal with and unnamed placeholder (i.e. "?"), if at all.

        Am I making sense?

        • I tend to use unnamed placeholders purely for statements that are likely to be prepared once and executed many times, and use named for statements I tend to execute once only.

          My primary goal is to make the code readable. In some phrases I mix and match between named and unnamed, and in cases where there are several optional values in an UPDATE statement, I use Class::Phrasebook::SQL to handle any undefined named values. I try and let the DBI do as much of the work as possible, so I can rely on caching. Pa

  • That book rocks. I've read it a couple of times. It's also pretty good to dive into.

    In fact, today, I've written my first class that uses blessed coderefs. Damn that's a neat idea!

    -Dom

  • There were a couple of lengthy discussions about UK post code regexps on the london.pm mailing list last week. Since they were over a couple of separate threads, it's probably best if you start at the mailing list archive index [pm.org] and browse from there.

    N

    • I'm already a London.pm'er :)

      I rewrote the Netscape javascript validation file a few years ago, for UK postcodes and telephone numbers, among other things, so already have a couple of regexs ready.

      I did read with interest the thread on postcodes, as I'd already got m/[a-z]{1,2}\d{1,2}[a-z]?\s+\d{1,2}[a-z]{1,2}/i for the cases I knew about, and we certainly haven't had any problems from clients. I think the thread highlighted a couple of expections that break my version, so will probably rework it to fit