#!usr/bin/perl my ($name, $vorname, $plz, $tel, $tel49); my %vars; while () { print; chomp; ($name, $vorname, $plz, $tel, $tel49) = split /\s*,\s*/, $_, -1; @vars{qw/name vorname plz tel tel49/} = ($name, $vorname, $plz, $tel, $tel49); my @good = grep {$vars{$_}} keys %vars; printf " %s %s good\n", @good ? join ", ", @good : "No variables", @good == 1 ? "is" : "are"; } __DATA__ john, stuart, some_plz, 123456, 234557 john, stuart, some_plz, 123456, john, stuart, some_plz,, 234557 , stuart, , 123456, 234557 , , , , 234557 ,,,,