in reply to concat '\' with word

You just need to use . (dot) instead of + (plus sign): while the latter is just for numbers, the first works with strings.
$string = '\'.$string;
You can find more information here.

Michele.

Replies are listed 'Best First'.
Re: Re: concat '\' with word
by cciulla (Friar) on May 27, 2003 at 15:44 UTC

    It's good that you pointed out the . (dot) operator, and I realize I'm being a tad pedantic, but...

    $string = '\'.$string;
    Will result in:
    Can't find string terminator "'" anywhere before EOF
    

    As teabag mentioned above, you need to escape the backslash thusly:

    $string = '\\'.$string;