DBIx::Cookbook::Recipe::Searching::fetch_single - fetch a single record
Select a single record from the actor table
actor
Sample Usage:
shell> ${orm}_cmd fetch_single # where orm is dbic, skinny, rose, etc.
package DBIx::Cookbook::DBIC::Command::fetch_single; use Moose; extends qw(MooseX::App::Cmd::Command); use Data::Dump; sub execute { my ($self, $opt, $args) = @_; my $where = {}; my $attr = {}; my $rs = $self->app->schema->resultset('Actor')->search($where, $attr); my $row = $rs->single; my %data = $row->get_columns; warn Data::Dump::dump(\%data); } 1;
To install DBIx::Cookbook, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Cookbook
CPAN shell
perl -MCPAN -e shell install DBIx::Cookbook
For more information on module installation, please visit the detailed CPAN module installation guide.