in reply to Looping Database
Sounds like you want to do some SQL:
select * from items where subcategory = "Christmas" order by id desc l +imit 2 [download]
Not really a Perl question, but whatever.
psI highly recommend HyperSnapDX. Buy a license!