#!/usr/bin/perl -w @file=`find * -type d`; foreach (@file) { `cd $_;/somepath/foo`; } #### $foo=`ls -d *`; @file = split'',$foo;