#!/usr/bin/perl use strict; use warnings; use Path::Class::Iterator; use Carp; use Data::Dump qw/ dump /; $| = 1; my $root = shift @ARGV || ''; my $walker = Path::Class::Iterator->new(root => $root); while (my $f = $walker->next) { #$f = $f->absolute; if (-l $f) { carp "$f is a symlink"; } elsif (-d $f) { carp "$f is a dir"; } elsif (-f $f) { carp "$f is a file"; } else { carp "no idea what $f is"; } last if $walker->done; }