Perl does something similar;
use v5.24
at start of the file will make it work as if the version of Perl was 5.24, and it works on per-file basics, not only per module