I've just discovered a very interesting command in Python. The 'is' command. It is not the same as '==' because 'is' does not check for equality. Instead it checks whether the same memory reference is used in each case. The theoretical basis for using the 'is' command is quite nice in many circumstances (particularly in relation to object orientated programming). I am assuming that you can do exactly the same in Perl using a ref command in conjunction with '=='. It is a classic case of where the theory overrides the non requirement at the code level. It is worth being aware of as a Perl programmer. Personally I think Python has it right on that one, although I do think that Python has too many commands. Are there any other examples like this that I can follow? It might make me a better Perl programmer.
In reply to Python 'is' command by betmatt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |