perl-DBIx-Class-ResultSet-SetControl-0.001-alt1.noarch.rpm


Advertisement

Description

perl-DBIx-Class-ResultSet-SetControl - Easier Looping over resultsets

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-DBIx-Class-ResultSet-SetControl
Package version 0.001
Package release alt1
Package architecture noarch
Package type rpm
Installed size 39.52 KB
Download size 39.52 KB
Official Mirror ftp.altlinux.org
There are times where Perl's procedural syntax for control flow and looping
leads to excessively verbose code.  For those times we present this helper
which is designed to encapsulate some very common control flow and loop patterns
for the DBIx::Class manpage users.
The methods are OO in nature and designed to be compact and concise.
Additionally, we have tried to write these methods to allow for a 'chaining'
approach that you can't replicate with traditional Perl control and looping
structures.  Each control flow method returns the original resultset so you
can proceed as though it is unaltered (unless of course you alter it somehow
like with an insert or update).
The goal it to help avoid excessive conditional logic and to allow one to write
more compact and neat code.  For example, you could replace:
my $has_rows;
while(my $row = $rs->next) {
$has_rows = 1;
}
unless($has_rows) {
warn 'no rows!';
}
With something like
$rs->each(sub {
my ($each, $row) = @_;
}, sub {
warn 'no rows!';
});
The second version has less overall lines and characters, and it also carefully
encapsulates a very common pattern, which is to loop over all the rows in a
resultset and do something should no rows exist.  Also, the the each entry elsewhere in this document method
returns the original `$rs' so you could chain commands:
$rs->each(sub {
my ($each, $row) = @_;
}, sub {
warn 'no rows!';
})->tap(sub {
my $rs = shift;
});
There may be cases in your logical flow where this type of programming is more
clear and simple; in other cases traditional Perl control and looping might be
better.  These methods give you an option.  On the other hand you might think
this is all pointless line noise.  As you wish :)

Alternatives

Package Version Architecture Repository
perl-DBIx-Class-ResultSet-SetControl - - -

Requires

Name Value
/usr/share/perl5 -
perl(Moo.pm) >= 2.003.001
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(DBIx/Class/ResultSet/SetControl.pm) -
perl(DBIx/Class/Util/ResultSet/Iterator.pm) -
perl-DBIx-Class-ResultSet-SetControl = 0.001-alt1

Download

Type URL
Binary Package perl-DBIx-Class-ResultSet-SetControl-0.001-alt1.noarch.rpm
Source Package perl-DBIx-Class-ResultSet-SetControl-0.001-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-DBIx-Class-ResultSet-SetControl rpm package:
    # sudo apt-get install perl-DBIx-Class-ResultSet-SetControl

Files

Path
/usr/share/doc/perl-DBIx-Class-ResultSet-SetControl-0.001/Changes
/usr/share/doc/perl-DBIx-Class-ResultSet-SetControl-0.001/LICENSE
/usr/share/doc/perl-DBIx-Class-ResultSet-SetControl-0.001/README
/usr/share/doc/perl-DBIx-Class-ResultSet-SetControl-0.001/README.mkdn
/usr/share/perl5/DBIx/
/usr/share/perl5/DBIx/Class/
/usr/share/perl5/DBIx/Class/ResultSet/SetControl.pm
/usr/share/perl5/DBIx/Class/Util/
/usr/share/perl5/DBIx/Class/Util/ResultSet/Iterator.pm

See Also

Package Description
perl-DBIx-Class-ResultSet-Void-0.07-alt1.noarch.rpm perl module DBIx-Class-ResultSet-Void
perl-DBIx-Class-ResultSet-WithMetaData-1.001000-alt1.noarch.rpm >_with_meta_key(
perl-DBIx-Class-ResultSource-MultipleTableInheritance-0.03-alt1.noarch.rpm >table_class(MTI);
perl-DBIx-Class-Row-Delta-0.0.5-alt1.noarch.rpm Keep track of and report on changes to a DBIC row object
perl-DBIx-Class-SaltedPasswords-0.03001-alt1.noarch.rpm perl module DBIx-Class-SaltedPasswords
perl-DBIx-Class-Schema-Diff-1.07-alt1.noarch.rpm Simple Diffing of DBIC Schemas
perl-DBIx-Class-Schema-Loader-DBI-RelPatterns-0.01043-alt1.noarch.rpm Relationship patterns for DBIx::Class::Schema::Loader
perl-DBIx-Class-Schema-Loader-Dynamic-1.05-alt1.noarch.rpm Really Dynamic Schema Generation for DBIx::Class
perl-DBIx-Class-Schema-PopulateMore-0.19-alt1.noarch.rpm An enhanced populate method
perl-DBIx-Class-Schema-RestrictWithObject-0.0002-alt1.noarch.rpm Restrict ResultSets
perl-DBIx-Class-Schema-ResultSetAccessors-0.001005-alt1.noarch.rpm Short hand ResultSet Accessors
perl-DBIx-Class-Schema-Slave-0.02400-alt1.noarch.rpm the DBIx::Class::Schema manpage for slave (EXPERIMENTAL)
perl-DBIx-Class-Schema-Versioned-Inline-0.204-alt1.noarch.rpm Schema versioning for DBIx::Class with version information embedded inline in the schema definition
perl-DBIx-Class-Service-0.02-alt1.noarch.rpm Aggregate DBIC processes between multiple tables
perl-DBIx-Class-Snowflake-0.10-alt1.noarch.rpm Easily use DBIC with snowflake schemas
Advertisement
Advertisement