This piece of code is a way of providing default values for $hostand $port. It is usually located at the beginning of a script or routine and takes values from @ARGVand, @_respectively.
This should return localhost and port 10.
, || OR, , LHS , RHS . ( ): " , , ".
shift ARRAY ARRAY :
ARRAY , @_ @ARGV , eval STRING, BEGIN {}, INIT {}, CHECK {}, UNITCHECK {} END {} .
http://perldoc.perl.org/functions/shift.html
, , shift . shift , , .