#!/usr/local/bin/perl use strict; use warnings; my @bundle = ("Datei_1", "Datei2"); for my $datei (@bundle){ print "at begining: @bundle\n"; read_my_file($datei); } sub read_my_file{ my ($file) = @_; open(MODULES, '<', $file) or die "Can't open $file: $!\n"; print "in subroutine: @bundle","\n"x2; while(my $line = ){print "In file: $line","My files: @bundle\n"; } close(MODULES); print "at end of sr: @bundle\n$#bundle\n"; } print "@bundle\n";