paulu has asked for the wisdom of the Perl Monks concerning the following question:

I need to append a character and need it to come out with _a _b as opposed to a b. Am I missing something small here?
%names; if ($names{$title}++) { $title .= chr(95+$names{$title}); }

Replies are listed 'Best First'.
Re: appending
by dragonchild (Archbishop) on Feb 25, 2005 at 13:48 UTC
    Yeah, you are. $title .= '_' . chr( 95 + $names{$title} );

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      Thanks very much. I caught it and posted after walking away for a moment.
Re: appending
by RazorbladeBidet (Friar) on Feb 25, 2005 at 14:20 UTC
    Please don't delete the original text, even if you messed up, just put <strike> tags around it. That way, others can learn, even if you make a mistake! (and trust me, we all have :)
    --------------
    It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs
      Sorry about that, I have reverted the best I remember the question as of this morning. My apologies.