For thinks like these, often times a good debugger/IDE can save you hours of frustration without having to add print. (Personally i use Komodo IDE, but probably there are a few other out there that are also very good).
If you don't want to spend money or have some other reasons not to use an IDE, you can do
print 'Record is of class: ', ref($l_record), "\n";
which will result in
Record is of class: Net::DNS::RR::PTR
"For me, programming in Perl is like my cooking. The result may not always taste nice, but it's quick, painless and it get's food on the table."