in reply to defined array question

I don't get the meaning of this: if( defined @user_geg[0..$#user_geg] ) { }

Now lets see what it means.

What you probably mean is "if there are any elements in the array 'user_egg' then ..." which can be expressed as
if (@user_geg) { }
See - much simpler.

Your original question as to why you have to add the -1 is probably answered by the meaninglessness of defined @user_geg.