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