Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
more useful options
 
PerlMonks  

krisahoch's scratchpad

by krisahoch (Deacon)
on Jun 05, 2004 at 12:42 UTC ( #361571=scratchpad: print w/ replies, xml ) Need Help??

==={ In Hoch/Database/Base.pm }========================
package Hoch::Database::Base; { use strict; use Class::DBI; __PACKAGE__->connection(<your connection data here>) } 1;
==={ In Hoch/Database/Journal.pm }======================
package Hoch::Database::Journal; { use strict; use base 'Hoch::Database::Base'; __PACKAGE__->table('journal'); __PACKAGE__->columns(Primary => 'entry_id'); __PACKAGE__->columns(Essential => qw(entry_text date)); __PACKAGE__->has_a('date' => 'Class::Date'); } 1;
==={ In some script }=============================
use strict; use Class::Date 'now'; use Hoch::Database::Journal; my $date = Class::Date->now(); my $journal = Hoch::Database::Journal->create ({ date => $date, entry_text => 'I ate all of my beans, and you can guess what happene +d next', }); my $entry_date = $journal->date(); print $entry_date->strftime("%A, %B %d, %Y");
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2013-05-23 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (473 votes), past polls