in reply to DBI using Hashes To Create

Update: Well, I learned something new today. @array = qw(...) actually works. Nevermind this post...

The first issue I noticed was that your @DEPARTMENTS array creation was not right. It should read:
my @DEPARTMENTS = (qw( editor@lsweb.org.uk webamster@lsweb.org.uk news@lsweb.org.uk ls2@lsweb.org.uk sport@lsweb.org.uk comment@lsweb.org.uk extra@lsweb.org.uk ));
Also, I can't find any reference to LSweb::Database::Email - is that an in-house custom module? If so, I don't know if your method call is correct or not. Have you tried setting the hash values inside the create statement to regular scalars (ex: $to) instead of references (\$to)?

---
It's all fine and dandy until someone has to look at the code.

Replies are listed 'Best First'.
Re^2: DBI using Hashes To Create
by jdporter (Paladin) on Apr 28, 2006 at 23:35 UTC

    kwaping, you are mistaken. The way he has it works just fine. The outer parens are not necessary.

    We're building the house of the future together.

      Especially considering that i got his comparing solution from perl monks.org anyway I forget which node number, but its the previous one that I wrote/started

      Barry Carlyon barry@barrycarlyon.co.uk
Re^2: DBI using Hashes To Create
by barrycarlyon (Beadle) on Apr 28, 2006 at 23:04 UTC

    package LSweb::Database::Email; use strict; use base qw(LSweb::DBI); use Apache::Reload; __PACKAGE__->table('email'); __PACKAGE__->columns(All => qw/id from to name subject content datetim +e/); __PACKAGE__->set_sql(all => 'SELECT __ESSENTIAL__ FROM __TABLE__'); 1;
    Barry Carlyon barry@barrycarlyon.co.uk