[ create a new paste ] login | about

Link: http://codepad.org/fX7gTqoa    [ raw code | output | fork ]

skeletonkey - Perl, pasted on Oct 21:
1
2
3
4
5
6
7
8
my @x = qw(1 two 3 four 5 six 7 eight 9 ten);
@x = grep { p($_) } @x;
print join(' :: ', @x) . "\n";

sub p {
    my $arg = shift;
    return $arg =~ /^\d+$/ ? 1 : 0;
}


Output:
1
1 :: 3 :: 5 :: 7 :: 9


Create a new paste based on this one


Comments: