in reply to regex problem

Data::Dumper is sometimes your very best friend.

use Data::Dumper; use Carp; unless(defined($name)){ print STDERR Data::Dumper->Dump( [$input, $name,$num,$addr,$date,$n], ["input", "name", "num", "addr", "date", "n"]); croak"Now let's stop and have a look at this..."; }

The first time the program encounters what you have determined to be the error-condition, it will now print out the line of data and the variables extracted from it, and then conveniently fall-dead.