You needed to change "=" to "==".
Oh yeah and get that "my" out of your "if" statement. That's legal, but not what you want.
You also need to "use warnings" and "use strict", please. Trust us, you'll love it.
if ( $status == $on_commercial )
{
print "The ups is normal\n";
}
if ( $status == $on_battery )
{
print "The ups is on battery\n";
}