How to build a menu hook module I am trying to get into module building with Drupal 7.

Why is  $tryk = "test" not being taken for the title, but literal strings such as "testmenu" are working?

$tryk = "test";
function menufun_menu() {
    global $tryk;
    $items['menufun'] = array(
        'title' =&gt; $tryk,
        'page callback' =&gt; 'menufun_greeting',
        'file' =&gt; 'menufun_greeting.inc',
        'page arguments' =&gt; array('Jane', 'Doe'),
        'access callback' =&gt; TRUE,
        'type' =&gt; MENU_NORMAL_ITEM,
);
return $items;
}
If you want to use a variable for the page title, it is better to use a title callback.

function menufun_menu() {
    $items['menufun'] = array(
        'title callback' =&gt; 'menufun_title',
        'page callback' =&gt; 'menufun_greeting',
        'file' =&gt; 'menufun_greeting.inc',
        'page arguments' =&gt; array('Jane', 'Doe'),
        'access callback' =&gt; TRUE,
        'type' =&gt; MENU_NORMAL_ITEM,
    );
    return $items;
} 
function menufun_title(){
    $tryk = 'test'; // dynamic title set here.
    return $tryk;
}