view filter.pm @ 101:2bec541ef58f laserkard

made it HTML 4.1 strict
author Robert McIntyre <rlm@mit.edu>
date Tue, 27 Jul 2010 08:39:43 -0400
parents 599d0315537d
children
line wrap: on
line source
1 package Filter;
2 use base 'Exporter';
3 our @EXPORT = ('filter');
6 sub filter
7 {
9 $ref = shift;
10 @list = @_;
11 my @ret = ();
13 for $element(@list)
14 {
15 if ($ref->($element))
16 {
17 push @ret, $element;
18 }
19 }
21 return @ret
23 }
26 1;