in reply to Re: String concatenation function
in thread String concatenation function

You probably shouldn't assign to $1, $2, or so on.

You can't. This is indeed lowercase L.

You might avoid single letter variables too, especially ones that look like 0 O 1 l...

And you might want to use a font that doesn't render different things characters the same.

Pick your syntax: either &concat or concat(...). Combining them is redundant and may confuse someone maintaining your code.

&foo without parens and arguments is scary (implicitly passes @_). This is *exactly* why you shouldn't use the &-form unless you know what you are doing. Style is not important here.

This leaves us with the following code (assuming there was no such 'abc' x 5 operation):

One direct access of an @_ element is okay, but once you start using more, in my opinion you should assign the arguments to variables. And still, $i .= $foo is clearer and less work than $i = $i . $foo;

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Replies are listed 'Best First'.
Re: Re: Re: String concatenation function
by jonnyr9 (Initiate) on Jun 10, 2003 at 09:32 UTC
    Thanks for all your help! Learning fast...