title: How do I assign the result of a regex match to a new variable, in a single line?
body: <p>I want to match and assign to a variable in just one line:</p>
  
  <pre><code>my $abspath='/var/ftp/path/to/file.txt';
  
  $abspath =~ #/var/ftp/(.*)$#;
  my $relpath=$1;
  </code></pre>
  
  <p>I'm sure it must be easy.</p>