in reply to Re^2: Range File Open
in thread Range File Open

Edit: amarquis idea is better than the following, I didn't look through your code to notice what he saw....

you could use

my @files; if (-d $x_file) { # $x_file is a directory, not a file @files = glob "$x_file/*xml"; } elsif ($x_file =~ /xml$/ and -e $x_file){ # $x_file is an xml-file, and we have access to it push @files, $x_file; } else { die("can't make sense out xml-directory or xml-file $x_file"); }
Or File::Glob, File::Find, ...

Replies are listed 'Best First'.