You've just found out that =~ is not a symmetrical relation, while == is. Other asymmetrical relations are <, >, <=, >=. Other symmetrical relations are != and eq. If you want to learn more on (symmetric) relations, see Symmetric relation.
Would it surprise you if a program that used $a < $b had output different from an otherwise identical program that used $b < $a?
In reply to Re: same program different output
by Corion
in thread same program different output
by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |