Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ukma!sean From: sean@ms.uky.edu (Sean Casey) Newsgroups: comp.lang.perl Subject: Changing the first character of a string. Message-ID: Date: 30 Jun 90 00:45:30 GMT Organization: The Leaning Tower of Patterson Office @ The Univ. of KY Lines: 19 How can I change an arbitrary character of a string? I've got a fixed length string, $flags, that is used in a printf. I need to be able to do something like: $flags = " "; if ($mb_flags[$num] && $FL_UNREAD) { set first character of $flags to 'U'; } if ($mb_flags[$num] && $FL_SENT) { set second character of $flags to 'S'; } and so on That's why we need a perl book. I've written 40 or so odd perl scripts, and something this simple evades me. Sean