#!/usr/bin/perl -l use strict; use warnings; my $dirname = shift @ARGV; opendir( DIR, $dirname ); my(@files) = readdir(DIR); print "File path: "; foreach my $file (@files) { my $file_path = "$dirname/$file"; $file_path =~ s/\\|\//\\\\/g; print $file_path; } closedir DIR;