The first line shifts from either @_ or @ARGV (depending on where you are in the code), or in the absence of any contents in @_/@ARGV, assigns localhost to $host.
The second one should be self-explanatory now.
Have a look at the shift documentation for details.