Usage of $$ and @_ in perl

Hi I have some doubts with below perl script sub program .

In the below code what are below lines do ?

  1. ($user, $server, $os, $version, $ref_path, $ref_line, $ref_ftp) = @_;

  2. if ( -e "/usr/kerberos/bin/krsh" )

  3. $$ref_path = "/usr/kerberos/bin" unless ($$ref_path);why we are using double $ here?

 
sub get_rsh_cmd {
  ($user, $server, $os, $version, $ref_path, $ref_line, $ref_ftp) = @_;
  # Linux man: rsh -l login host command - KEEP CURRENT COMMAND
  if ( -e "/usr/kerberos/bin/krsh" ) {
    $$ref_path = "/usr/kerberos/bin" unless ($$ref_path);
    $$ref_ftp  = "/usr/kerberos/bin/ftp" unless ($$ref_ftp);  
    $$ref_line = $$ref_path . "/krsh -l $user $server";
  }
  elsif ( $os =~ /SunOS/ ) {
    # Solaris 8,9 man: rsh host -l username command
    #   or : rsh -l username host command - KEEP CURRENT COMMAND
    if ( $version =~ /5\.[89]/ ) {
      $$ref_path = "/usr/local/bin" unless ($$ref_path);
      $$ref_ftp  = "/usr/local/bin/kftp" unless ($$ref_ftp);
      $$ref_line = "/usr/local/bin/krsh -l $user $server -x";
    }
    # Solaris 10+: rsh -a -l username hostname command - KEEP CURRENT COMMAND
    #   or : rsh hostname -a -l username command
    #      -a flag explisitly enables Kerberos authentication
    else {
      $$ref_path = "/usr/bin" unless ($$ref_path);
      $$ref_ftp  = "/usr/bin/ftp -a" unless ($$ref_ftp);
      $$ref_line = "/usr/bin/rsh -a -l $user $server";
    }
  }
  # AIX 5.3 and 6.1: rsh RemoteHost -l User Command
  # and everything else
  elsif ( $os =~ /AIX/ ) {
    # AIX 5.X
    if ( $version =~ /5/ ) {
      $$ref_path = "/usr/local/bin" unless ($$ref_path);
      $$ref_ftp  = "/usr/local/bin/kftp" unless ($$ref_ftp);
      $$ref_line = "/usr/local/bin/krsh -l $user $server";
    }
    # AIX 6.X
    else {
       $$ref_path = "/usr/krb5/bin";
       $$ref_ftp  = "/usr/bin/ftp" unless ($$ref_ftp);
       $$ref_line = "/usr/bin/rsh $server -l $user";
    }
  }
  # unknown OS ( needs to be ported and tested)
  else {
    $msg_detail = "Unknown OS - exiting";
    $beep_counter = &alert( "Invalid_Run_Arguments", $msg_detail,
      $beep_threshold, $beep_counter, $beep );
    exit 1; 
  }
1
}