#!/usr/bin/perl -l use strict; use warnings; use File::Find::Rule; my $osmolt_filter = $ARGV[0]; my @files = File::Find::Rule->file( '*.txt' ) ->maxdepth( 1 ) ->in( $osmolt_filter ); print $_ for @files;