my %big_hash; my %big_array; ... if ($x) { # fülle %big_hash und %big_array und mache was damit ... } if ($y) { # mach was ganz anderes } # usw usf # %big_hash und @big_array verbrauchen bis zum scriptende platz