#!/usr/bin/perl -w $dir = "some_dir"; @file_list = glob ("$dir/*"); GetOptions ( "f=s" => \@file_list, ); foreach (@file_list) { print { $_\n"; }