title: (3 lines) from bash to perl?
body: <p>I have these three lines in bash that work really nicely. I want to add them to some existing perl script but I have never used perl before ....</p>
  
  <p>could somebody rewrite them for me? I tried to use them as they are and it didn't work</p>
  
  <p>note that <code>$SSH_CLIENT</code> is a run-time parameter you get if you type set in bash (linux)</p>
  
  <pre><code>users[210]=radek       #where 210 is tha last octet from my mac's IP
  octet=($SSH_CLIENT)    # split the value on spaces 
  somevariable=$users[${octet[0]##*.}]        # extract the last octet from the ip address
  </code></pre>