--package User; # read the docs for why not to sub-class exactly like this use base Class::DBI::mysql; __PACKAGE__->set_db('Main', 'dbi:mysql:dbname', 'user', 'password'); __PACKAGE__->set_up_table( 'USERINFORMATION'); 1; # In your program package main; use User; my $howmany = User->count; my $user = User->search(username => $_[0]); print $user->userid; print $user->username; #update username $user->username('Biff'); $user->update;
In reply to Re: Writing Better Objects
by clscott
in thread Writing Better Objects
by Angel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |