in reply to Use of uninitialized value $site in concatenation (.) when excute the perl script

Have you read the error message? It tells you to look at line 13. It tells you that the variable $site in line 13 is undefined.

Maybe you should look at where $site gets set, and find out why it doesn't seem to have the value you expect.