Your code and comments are confusing. If you want to obtain comments for a known mac address, why dont you use the database to do the appropriate query:
in reply to MySQL hashes with same key
Also, Using fetchrow_arrayref instead of fetchrow_hashref will not make any difference to the resulting rows, as you seem to think it might.
where operation = 'filter' AND MAC='$mac_t'"
"By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."