use warnings; while (defined(my $line = )) { print "\n"; chomp($line); my ($k, $v) = split /\s*=\s*/, $line; print "The $k key has $v value\n"; output_flush(); } sub output_flush { # Keep our STDOUT and STDERR in sync with each other, and in iteration order: $_->flush for *STDERR, *STDOUT; } __DATA__ [main] foo=bar baz=buzz [config] bingo=42 #### Use of uninitialized value $v in concatenation (.) or string at mytest.pl line 12, line 1. The [main] key has value The foo key has bar value The baz key has buzz value Use of uninitialized value $k in concatenation (.) or string at mytest.pl line 12, line 4. Use of uninitialized value $v in concatenation (.) or string at mytest.pl line 12, line 4. The key has value Use of uninitialized value $v in concatenation (.) or string at mytest.pl line 12, line 5. The [config] key has value The bingo key has 42 value #### my $c; while ($c++ < 10) { print "$c\n"; }