Net-Radio-oFono

 view release on metacpan or  search on metacpan

lib/Net/Radio/oFono/Helpers/Container.pm  view on Meta::CPAN

sub n_elements() { scalar( @{ $_[0]->{elements} } ); }

=head2 for_each

Calls given sub for each item once, with the item as only argument. It's not
recommended to use this method - it's here for compatibility reasons only.
A better way to do sth. for each item is to use the iterator operators.

=cut

sub for_each(&)
{
    my ( $self, $sub ) = @_;

    affirm { _CODELIKE($sub) } "Parameter at index 0 isn't coderef";

    foreach my $child ( @{ $self->{elements} } )
    {
        &{$sub}($child);
    }



( run in 0.235 second using v1.01-cache-2.11-cpan-49f99fa48dc )