[Tutor] Perl Symbology (was: Are you allowed to shoot camels?)

Alan Gauld alan.gauld at freenet.co.uk
Thu Feb 10 20:28:26 CET 2005


> Although it's worse with:
> newstr = s + ' ' + str(n) + ' ' + str(r)

You could try:

newstr = s + ' ' + `n` + ' ' + `r`

if you think thats better.
But `` is different to str() for some types.

Personally I prefer the formatting approach.

> But in my mind nothing beats the Perl statement:
> newstr = "$s $n $r";

Perl is king of string processing in modern scripting, 
without a doubt. But even here the $ prefix could have 
been used for that specific purpose without insisting 
it be used everywhere else!

BTW Anyone recall how Ruby does this?

Alan G.
Too lazy to look it up!


More information about the Tutor mailing list