My poor little brain is having trouble wrapping itself around things to do with OO Perl specifically where it concerns Class::DBI.
My task:
But this seems rather left handed and backwards if I am to do this every time I want a hash! If I need to do this then why am I using Class::DBI at all, it is actually costing me code in many cases. Surely there must be a better way?my %data; my $obj = App::User->search( username => 'fred' ); while ( my $usr = $obj->next ) { foreach ( $user->columns ) { $data{$_} = $usr->$_; } }
In reply to Getting HASHES out of Class::DBI by jdtoronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |