Skip to content

Commit

Permalink
Rewrite List::MoreUtils::any to my any() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-josef-spacek committed Aug 7, 2014
1 parent 02d4658 commit 6f8ac15
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scraper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ package Dicom::IOD::Module::Handler;
use strict;
use warnings;

# Modules.
use List::MoreUtils qw(any);

# Constructor.
sub new {
my ($type, %params) = @_;
Expand Down Expand Up @@ -131,7 +128,7 @@ sub characters {
if ($module =~ m/^(.*?)\s*(\(Retired\))$/ms) {
$module = $1;
$retired = 1;
} elsif (any { $_ eq $module } @{$self->{'xxx_retired_modules'}}) {
} elsif ($self->_any($module)) {
$retired = 1;
}
$self->{'dt'}->insert({
Expand All @@ -144,6 +141,17 @@ sub characters {
return;
}

# Search in retired modules.
sub _any {
my ($self, $module) = @_;
foreach my $xxx_retired_module (@{$self->{'xxx_retired_modules'}}) {
if ($xxx_retired_module eq $module) {
return 1;
}
}
return 0;
}

package main;

# Pragmas.
Expand Down

0 comments on commit 6f8ac15

Please sign in to comment.