open (INP, "<", "$filename") or die "cannot open input file";