use File::Spec; my @args = ('bzip2', '-d'); my @paths = ('H:','pmi_daten','pmi','aix0021a'); foreach(@filename){ my $path = File::Spec->catfile( @paths, $_); system(@args,$path); }