In addition to what roboticus says,
- Unless you know the difference and intend it, you should use my in place of local.
- You should probably use or in place of || - check out operator precedence to see why.
- You should probably use the three argument version of open in place of the two, since there are significant security implications.
- You probably mean chomp in place of chop.