walktree('d:/perl'); sub walktree { print "$_[0]\n"; # or real-world stuff here for ( glob("$_[0]/*") ) { -d && walktree($_); } }