I guess a global variable would be ok for player data, unless you have some kind of main function where it could be local and then passed only to functions that need it.
I would probably make a table for all player data instead of separate variables, be it global or local. And for global variables I've started to have "g" in their names to see clearly the type of the variable later when you have lots of code in the program.
Like:
Global g_player = {name="", age=33, stamina=10}
Now you could init the name field of the player data like this:
g_player.name = p_GetName()
And to print something about the player:
Print(g_player.name, g_player.age)
I don't know what's your final goal, but if you plan to replace the random name generation by entering a name on keyboard, then you probably would like to print questions with p_CharName() and make it to ask a name with p_GetName(), and return the name$ from p_CharName() too. Then it could be g_player.name = p_CharName() in the main level of the code, and so on.