in reply to Re: Why Perl
in thread Why Perl
In Perl + is always addition, and concatenation has a different operatorExcept when it isn't. Blessed types can overload operators - and then it's the type of the operand(s) that determine what's going to happen.
the symbol determines the operation, not the typeExcept when it doesn't. | and & do behave differently depending on their operands - and it's more complicated than whether it's a number or a string; it'll depend on some internal flag. But more important is the context. Some operators behave wildly different in scalar and list context - but they have the same symbol(s).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Why Perl
by moritz (Cardinal) on Feb 01, 2010 at 13:35 UTC |