Perforations in a web material can be used to determine the position of the material in the machine. The perforation can be the “tear-off perforations” of bags or a deliberate perforation made to determine a position. Perforation detection with the use of high voltage is not depending on the material surface and can also be used with transparent materials. When a perforation passes between the high voltage electrode and a ground electrode, a spark is generated. This spark will be detected and a pulse signal will be available for use by the machine control system.