how to set a variable in module and get it in theme i want set a variable in module and use it in my theme,
(except variable_set and variable_get way.)

for instance . in module file

      if(in_array(arg(1),$ex))
      {
//      set a variable
      }


in theme file

if(//variable)
{
echo '&lt;div class=d7&gt;&lt;/div&gt;';
}


thank you so much for help me
HOWEVER:

You should really look into the various _preprocess() hooks.  From further commentary below, I am thinking that's where you should be doing all this.

ORIGINAL ANSWER:

If you don't want to use the system wide variable_set() or variable_get() you can always set a variable in the global $_SESSION array that would be seen by the current logged in user only, eg,

if ( // whatever ) {
  $_SESSION['MYMODULE_variable_name']= // whatever
}


SUPER DUPER OVER SIMPLIFIED ADDITION:

function MYMODULE_foo($value=NULL) {
  static $bar;

  if ($value) {
     $bar=$value;
  }

  return $bar;
}


accomplishes it inside your module, eg, you can do:

MYMODULE_foo('this is cool');


and then in your theme do:

$baz=MYMODULE_foo();