in reply to hereto doc

my $string = <<`EOC`; -x exclude=$_ foreach (@excludes); EOC

Not really sure I understand, but maybe you want something like this (?)

my @excludes = qw(/usrb /cache /journal); my $string = join " ", map "-x exclude=$_", @excludes; print $string; __END__ -x exclude=/usrb -x exclude=/cache -x exclude=/journal