in reply to Matching lines between several other lines

  foreach (@{$data{$sid}})

If you use constant input, you'll get constant output:) Try:

  foreach ( @{ $data{ $key } } )

And don't a few spaces make things easier to read? Of course, where you put the spaces is a whole other debate:)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller