The length of the Yersinia injectisome needle is determined by the protein YscP, which could act as a molecular ruler. The analysis of the correlation between the size of YscP and the needle length in seven wild-type strains of Yersinia enterocolitica reinforced this hypothesis but hinted that the secondary structure of YscP might influence needle length. Hence, 11 variants of YscP515 were generated by multiple Pro or Gly substitutions. The needle length changed in inverse function of the helical content, indicating that not only the number of residues but also their structure controls length. Taking the secondary motifs into account, Pro/Gly-variants were subjected to in silico modelling to simulate the extension of YscP upon needle growth. The calculated lengths when the helical content is preserved correlated strikingly with the measured needle length, with a constant difference of ∼29 nm, which corresponds approximately to the size of the basal body. These data support the ruler model and show that the functional ruler has a helical structure.