What\'s the purpose of the following two lines of perl??
my $host = shift || \'localhost\';
my $port = shift || 200;
That should return loc
If no argument is provided, shift will shift @ARGV outside a subroutine and @_ inside a subroutine – that is the argument array passed to either the main program or the subroutine.
In your case, $host is assigned the first element of @ARGV (or @_, if the code is inside a sub) or 'localhost', if the element is false.
This is a very common Perl idiom.