Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Validation::Class::LisUser(Contributed Perl DocumValidation::Class::Listing(3)

NAME
       Validation::Class::Listing - Generic Container Class for	an Array
       Reference

VERSION
       version 7.900056

SYNOPSIS
	   use Validation::Class::Listing;

	   my $foos = Validation::Class::Listing->new;

	   $foos->add('foo');
	   $foos->add('bar', 'baz');

	   print $foos->count; # 3 objects

DESCRIPTION
       Validation::Class::Listing is a container class that provides general-
       purpose functionality for arrayref objects.

METHODS
   new
	   my $self = Validation::Class::Listing->new;

   add
	   $self = $self->add('foo', 'bar');

   clear
	   $self = $self->clear;

   count
	   my $count = $self->count;

   delete
	   $value = $self->delete($index);

   defined
	   $true if $self->defined($name) # defined

   each
	   $self = $self->each(sub{

	       my ($index, $value) = @_;

	   });

   first
	   my $value = $self->first;

   get
	   my $value = $self->get($index); # i.e. $self->[$index]

   grep
	   $new_list = $self->grep(qr/update_/);

   has
	   $true if $self->has($name) #	defined

   iterator
	   my $next = $self->iterator();

	   # defaults to iterating by keys but accepts sort, rsort, nsort, or rnsort
	   # e.g. $self->iterator('sort', sub{ (shift) cmp (shift) });

	   while (my $item = $next->())	{
	       # do something with $item
	   }

   join
	   my $string =	$self->join($delimiter);

   last
	   my $value = $self->last;

   list
	   my @list = $self->list;

   nsort
	   my @list = $self->nsort;

   pairs
	   my @pairs = $self->pairs;
	   # or	filter using $self->pairs('grep', $regexp);

	   foreach my $pair (@pairs) {
	       # $pair->{index}	is $pair->{value};
	   }

   rnsort
	   my @list = $self->rnsort;

   rsort
	   my @list = $self->rsort;

   sort
	   my @list = $self->sort(sub{...});

   unique
	   my @list = $self->unique();

AUTHOR
       Al Newkirk <anewkirk@ana.io>

COPYRIGHT AND LICENSE
       This software is	copyright (c) 2011 by Al Newkirk.

       This is free software; you can redistribute it and/or modify it under
       the same	terms as the Perl 5 programming	language system	itself.

perl v5.32.0			  2014-05-29	 Validation::Class::Listing(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | METHODS | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Validation::Class::Listing&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help