I am taking arguments from the command line to test if they exist print out their names if they do. In this code directories are printed out if they exist. How do I exclude directories?
#!/usr/bin/perl
use strict;
use warnings;
foreach my $x (@ARGV) {
if (-e $x){
print "$x ";
else {
print "'$x' does not exist"
}
}
exit;