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 } #### 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 (-f $input){ # $input is the name of an existing file ... process file }elsif (-d $input){ # $input is the name of an existing folder ... process folder }