Algorithm-Dependency
view release on metacpan or search on metacpan
lib/Algorithm/Dependency.pm view on Meta::CPAN
#pod 'selected', acted upon, installed, or whatever. If another item depends on one
#pod in this list, we don't have to include it in the output of the C<schedule> or
#pod C<depends> methods.
#pod
#pod =item ignore_orphans => 1
#pod
#pod Normally, the item source is expected to be largely perfect and error free.
#pod An 'orphan' is an item name that appears as a dependency of another item, but
#pod doesn't exist, or has been deleted.
#pod
#pod By providing the C<ignore_orphans> flag, orphans are simply ignored. Without
#pod the C<ignore_orphans> flag, an error will be returned if an orphan is found.
#pod
#pod =back
#pod
#pod The C<new> constructor returns a new Algorithm::Dependency object on success,
#pod or C<undef> on error.
#pod
#pod =cut
sub new {
my $class = shift;
my %args = @_;
my $source = _INSTANCE($args{source}, 'Algorithm::Dependency::Source')
or return undef;
# Create the object
my $self = bless {
source => $source, # Source object
selected => {},
}, $class;
# Were we given the 'ignore_orphans' flag?
if ( $args{ignore_orphans} ) {
$self->{ignore_orphans} = 1;
}
# Done, unless we have been given some selected items
_ARRAY($args{selected}) or return $self;
# Make sure each of the selected ids exists
my %selected = ();
foreach my $id ( @{ $args{selected} } ) {
lib/Algorithm/Dependency.pm view on Meta::CPAN
'selected', acted upon, installed, or whatever. If another item depends on one
in this list, we don't have to include it in the output of the C<schedule> or
C<depends> methods.
=item ignore_orphans => 1
Normally, the item source is expected to be largely perfect and error free.
An 'orphan' is an item name that appears as a dependency of another item, but
doesn't exist, or has been deleted.
By providing the C<ignore_orphans> flag, orphans are simply ignored. Without
the C<ignore_orphans> flag, an error will be returned if an orphan is found.
=back
The C<new> constructor returns a new Algorithm::Dependency object on success,
or C<undef> on error.
=head2 source
The C<source> method retrieves the L<Algorithm::Dependency::Source> object
for the algorithm context.
( run in 1.784 second using v1.01-cache-2.11-cpan-94b05bcf43c )