print "Enter a directory´s path to work with all files in a folder or a single file path\n\n"; chomp(my $input = ); if ($input =~ /./){ ### attempt of recognizing a file extention ... process file }elsif ($input =~ /[^.]/){ #### attempt of recognizing just a folder but i know it wont work always ... process folder }