foreach (@bilder) { $j = ($i<10) ? "0$i" : $i; rename "$_", "Daenemark$j.jpg"; print "$_ --> Daenemark$j.jpg\n"; $i++; }