If you're running it as a CGI you don't necessarily know what the current directory is. Try doing a print `pwd`; to see where the script actually is.
Usually, with things like file paths, it can be useful to make a configuration variable that holds this stuff in, so when you open you do something more like open (INPUTFILE, "<$root/postcode.txt");. $root can be a variable set at the top of the file, read in from a configuration file, etc.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |