• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ferki / Rex / 15240232617

28 Feb 2025 09:08AM UTC coverage: 50.961% (+10.2%) from 40.73%
15240232617

push

github

ferki
Use placeholders for template hints

10072 of 19764 relevant lines covered (50.96%)

101.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.77
/lib/Rex/Helper/Array.pm
1
#
2
# (c) Jan Gehring <jan.gehring@gmail.com>
3
#
4

5
package Rex::Helper::Array;
6

7
use v5.12.5;
112✔
8
use warnings;
112✔
9

10
our $VERSION = '9999.99.99_99'; # VERSION
11

12
require Exporter;
13
use base qw(Exporter);
112✔
14
use vars qw(@EXPORT);
112✔
15

16
@EXPORT = qw(array_uniq in_array);
17

18
sub array_uniq {
19
  my (@array) = @_;
×
20

21
  my %all = ();
×
22
  @all{@array} = 1;
×
23
  return keys %all;
×
24
}
25

26
sub in_array {
27
  my ( $needle, @haystack ) = @_;
×
28

29
  my ($ret) = grep {
30
    if ( ref $needle eq "RegExp" && $_ =~ $needle ) {
×
31
      return $_;
×
32
    }
33
    elsif ( $_ eq $needle ) {
34
      return $_;
×
35
    }
36
  } @haystack;
37

38
  return $ret;
×
39
}
40

41
1;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc