sub getline { my $self = shift; my $line = $self->SUPER::getline() || return undef; #the _parse function check if the line is well formed and #returns a hash references filled with informations from #the line. _parse() returns undef if there is a format #error in the line my $result = _parse($line); if (defined $result) { return $result; } else { #this is the tricky part... #what should I do? } }