in reply to where is the error ??

dude, it's simple. you have your args the wrong way round in your sub.

ie: change the arg pick up code in the sub to:
my $eventchoice = pop @_; my @records = @_;
or something.
...wufnik

-- in the world of the mules there are no rules --