I want to use a scalar $string in a very C-like way,
that is I want to run through the @string character
by character, fiddling with chars along the way.
Try something like
my @chars = split //, $string;
Then @chars has each character in it. So:
foreach my $char (split //, $some_string)
{
if($char eq " ")
{
print "it was a space!";
# change all spaces to |s
$char = "|";
}
}
or something like that. Then of course you join them together when you're done...
$string = join("", @chars);
Hope it helps.
jarich