Allow block display on child nodes but not grandchildren In a block configuration, I would like to show the block on
/programs/* but not on programs/* /*

I have seen a number of questions similar to mine.
Block display using wildcard, non-greedy for example. 

The recommendation from the above link to use drupal_match_path() makes the most sense to me.  I have implemented the following, 

    &lt;?php
if (drupal_match_path(current_path(), "programs/*") &amp;&amp; !arg(2)) {
  return TRUE;
}
?&gt;


expecting the block to appear on /projects/name but not on /projects/name/grandchild-node.  The block doesn't appear anywhere. Just to test the system, I tried this: 

    &lt;?php
if (drupal_match_path(current_path(), "programs/*") {
  return TRUE;
}
?&gt;


and still the block doesn't show.
I'm certain that I'm doing something wrong that is very basic. Any ideas?
Hmm.  Are you sure current_path() is returning the alias?  cause I don't think match_path takes that in to consideration at all.

$path = current_path();
$path_alias = drupal_lookup_path('alias',$path);