1 #! /usr/bin/perl -w 2 3 my @test_files = glob "*.txt"; 4 5 foreach (@test_files) { 6 print "Starting processing of file, $_.\n"; 7 open TEST_FILE, "< $_" or die "Couldn't open test file, '${_}', for reading: ($!)"; 8 9 while () { 10 print; 11 } 12 13 print "Ending processing of file, $_.\n"; 14 } #### Starting processing of file, test1.txt. Line 1 from 'test1.txt' Line 2 from 'test1.txt' Line 3 from 'test1.txt' Use of uninitialized value in concatenation (.) or string at ./test.pl line 13, line 3. Ending processing of file, . Starting processing of file, test2.txt. Line 1 from 'test2.txt' Line 2 from 'test2.txt' Line 3 from 'test2.txt' Use of uninitialized value in concatenation (.) or string at ./test.pl line 13, line 6. Ending processing of file, . #### Line 1 from 'test1.txt' Line 2 from 'test1.txt' Line 3 from 'test1.txt' #### Line 1 from 'test2.txt' Line 2 from 'test2.txt' Line 3 from 'test2.txt'