On Wed, 5 Dec 2001, Purshottam Chandak wrote:

> $fred[1] .= "whatsis";
>
> Playing with this I have not found any difference between
> the .= (which I would expect to do concatenation),
> and the = (which I expect would do normal assignment.)
>
> Can someone explain what the .= is for?

It's the equivalent of

$fred[1] = $fred[1] . "whatsis";

It's shorthand notation.  There's also +=, -=, *=, and so on.  In other
words:

var1 <op>= var2;

var1 = var1 <op> var2;

Perl inherited this from C.  Java and C++ also share this shorthand
notation.

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
Class: when they're running you out of town, to look like you're
leading the parade.
                -- Bill Battie


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to