in reply to localhost IP in a dollar sign
None of them. Check perlvar.
Of course, you could just do:my $localhost = '127.0.0.1';