7 ms·
For those still interested in Perl 5: I've added a translation of the functional example from this article to the functional-perl project(1) here: https://gith
by pflanze 11y ago
For those still interested in Perl 5: I've added a translation of the functional example from this article to the functional-perl project(1) here:
https://github.com/pflanze/functional-perl/blob/master/examples/existing_files https://github.com/pflanze/functional-perl/blob/master/examp...
(1) http://functional-perl.org http://functional-perl.org
i.e.
my $paths = stream(qw< /tmp /var/tmp >);
my $filename = 'temp123';
my $ext = list(qw<pod pm pl>);
my $existing_files =
$paths->cartesian_product(list("/$filename."), $ext)
->map(*list_to_string)
->filter(unary_operator "-e");