\X fixes the utf8 problem, but there's still a problem with this regex...
#!/usr/bin/perl -w
use strict;
use utf8;
my($a,$b,$c);
$a=$b=$c="123\n456\n";
print chop $a; # prints "\n"
print $b =~ s/\X$//; # prints "1"
print $a; # prints "123\n456"
print $b; # prints "123\n45\n" ## OOPS!!!
i believe s/\X\z// will do what you want, although it still won't return the character removed. instead, use substr EXPR,OFFSET,LEN,REPLACEMENT (i.e. substr $_,-1,1,'').
~Particle *accelerates*
| [reply] [d/l] [select] |