I've just given you a solution, I really don't know what else you are expecting. Larry Wall didn't make a special perl function to check if Links SQL is being run from admin.cgi or not.
As for hacking, I don't know what you mean there either.....what exactly is this code going to be doing?
As for hacking, I don't know what you mean there either.....what exactly is this code going to be doing?