You just need to declare my $cl and my %data before you use them (and in the smallest scope possible, read this article if you're not sure about scope) :)
----------
My cow-orkers were talking in punctuation the other day. What disturbed me most was that I understood it.