#! /usr/bin/perl use strict; use warnings; my @SERVERS = ('sneezy','sleepy','dopey','grumpy'); my $path = "/home/backup/"; foreach my $this_server ( @SERVERS ) { `cp $path/$this_server/etc/passwd .`; }