What a shame we can't write functions and what-not. I'd say the best way is to write an XS module that increments the SV's IV value, sets the OOK flag, and decrements its CUR value:
% perl -MDevel::Peek
$x = "japhy";
Dump($x);
$x =~ s/\C//;
Dump($x);
__END__
SV = PV(0x814ce90) at 0x81603ac
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x815d008 "japhy"\0
CUR = 5
LEN = 6
SV = PVIV(0x814d2a0) at 0x81603ac
REFCNT = 1
FLAGS = (POK,OOK,pPOK)
IV = 1 (OFFSET)
PV = 0x815d009 ( "j" . ) "aphy"\0
CUR = 4
LEN = 5
_____________________________________________________
Jeff
japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and
perl
hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart