title: Perl return if statement variable
body: <p>How can i do something like that:
  I want return IP server from if statment, where i sign if to variable. It is possible? </p>
  
  <pre><code>#!/usr/bin/env perl
  #
  
  use warnings;
  use strict;
  
  my $variable1 = "10.12.1.1";
  my $variable2 = "10.12.1.2";
  
  my $string = $ARGV[0];
  
  my $serveris=&gt;(if ($string =~ m/^[abcdefghijklm]/) {
              print " $variable1 \n"
  } else {
              print " $variable2 \n"
  })
  
  
  print $serveris
  </code></pre>