in reply to How to push and print at the same time?

You want to have two times the same condition:

if -d $File::Find::name && !$seen{$_}++;
However you are changing the things you check due to the post-increment (++). Suspicious, isn't it? ;-)

Hint: remove the ++ in the first line ...

HTH, Rata