It would be easier to incorporate everything into the SQL database, but if that's not what you want then try this.
First off, you might want to use strict and declare your variables. I doubt that would fix your problem, but it might help.
I don't know what you are wanting
$status to equal, but in the way perl runs status will either equal
1 or
null if I remember right. If you are wanting
$status to equal
$pointer->{'status'} then you need to fix your if statement to be:
if ((my $status = $pointer->{'status'}) eq '1') {
Also, I am assuming that status in your sql database is a
int so you should change the
eq '1' and
eq '2' to
== 1 and
== 2. I don't know if that's the exact problem, but It might fix it.
if ((my $status = $pointer->{'status'}) == 1) {
#yada yada
}
if ((my $status = $pointer->{'status'}) == 2) {
#yada yada yada
}