my @dirs = ('/path/to/dir1', '/some/other/path/to/dir2', '/dir3'); for my $dir (@dirs) { ... }