Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: concat '\' with word

by arthas (Hermit)
on May 27, 2003 at 12:30 UTC ( [id://260976]=note: print w/replies, xml ) Need Help??


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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://260976]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (9)
As of 2024-03-28 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found