Help for this page

Select Code to Download


  1. or download this
      my $newposition = $oldposition =~
        s/\+\K([-\d]+)\+([-\d]+)$/ ($1 + $deltax) . '+' . ($2 + $deltay) /
    +er;
    
  2. or download this
      $oldposition =~ /^(\d+)x(\d+)\+?([-\d]+)\+?([-\d]+)/;
      my ($newx, $newy) = ($3 + $deltax, $4 + $deltay);
      my $newposition = "${1}x${2}+${newx}+${newy}"