Same module for different Drupal versions I've just started developing Drupal module and have completed the simple "Hello "World" module. The module is working fine on both Drupal 6 and 7.

How can I use the same module on both Drupal 6 and 7, instead of packaging it as 2 separate modules?
Sorry, you can't without hacking Drupal's core. By the documentation for Drupal 7 you need to set:

core = 7.x


in module's info file. At the same time documentation for Drupal 6 requires you to set:

core = 6.x


Values without [] may appear only once, so you cannot write:

core = 6.x
core = 7.x


And you cannot make a value to be an array, so following also would not be recognized and accepted:

core[] = 6.x
core[] = 7.x


Safest way to solve it is to keep modules separate, and move common PHP code to a PHP library. With Libraries API it should be pretty easy to do.