soonix already pointed out the issue around . and .. directory traversals. You'll need to keep track of visited directories to avoid looping over them again. There's also one more path that you can look into:
$searchfile =~ /^\.svn$/; print "$searchfile\n"; rmdir $searchfile; if ( -d $searchfile) { &traversedir($searchfile); } else { last; }
Now, this is not necessarily a problem - but you are not really checking for .svn folders, merely matching and overwriting the $searchfile variable. What do you think would happen if there were no match? :-)
That said, what's wrong with just doing svn export $srcFolder $targetFolder? It doesn't look like you're doing it as an exercise (those vhdl, rtl, sim folders?) If you have svn installed, you already have this tool at your disposal. Why reinvent the wheel? :-)
In reply to Re^3: how to copy source folder excluding specific set of sub folder from parent folder
by robby_dobby
in thread how to copy source folder excluding specific set of sub folder from parent folder
by mrityunjaynath
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |