my $aux=0; foreach my $pos (@files){ $files[$aux] = qq '\t"$path\\$files[$aux]" $esquema\n'; $aux++; }