3 ms·
From Iterative to Functional Perl 6 Code (2012)
- deleted 11y ago[deleted]
- pflanze 11y agoFor 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");