 
       end if;     
 
-      --Get a list of variables from the package spec
-      l_var_list := get_vars_from_compiled_object(i_name     => p_package_name
-                                                 ,i_owner    => l_owner 
-                                                 ,i_type     =>  'PACKAGE'
-                                                 ,i_var_list => l_var_list   );
-
-      --Get a list of variables from the package body
-      l_var_list := get_vars_from_compiled_object(i_name     => p_package_name
-                                                 ,i_owner    => l_owner 
-                                                 ,i_type     =>  'PACKAGE BODY' 
-                                                 ,i_var_list => l_var_list   );
-
-
+      --Recompile all referenced packages with PLScope before compiling this package with PLScope
       for l_referenced_object in (  select * 
                                     from  all_dependencies  
                                     where name  = p_package_name


    END LOOP;

    log_var_list(i_var_list => l_var_list);
 
    return l_var_list;
  END;

    end loop;
  END;

  

--------------------------------------------------------------------
-- log_new_var_list - Log the new var list minus old var list
--------------------------------------------------------------------
  procedure log_new_var_list(i_old_var_list  in var_list_typ
                            ,i_new_var_list  in var_list_typ) is
    l_node ms_logger.node_typ := ms_logger.new_func($$plsql_unit ,'log_new_var_list'); 
    l_index varchar2(200);
  BEGIN
    l_index := i_new_var_list.FIRST;
    
    WHILE l_index is not null loop
      if NOT i_old_var_list.EXISTS(l_index) OR
         NVL(i_old_var_list(l_index).signature,'X') <> NVL(i_new_var_list(l_index).signature,'X') OR
         i_old_var_list(l_index).level <> i_new_var_list(l_index).level THEN
        --This entry is not in the old list, or the signature is different, or level is different, so it's a new one.  Log it.
        ms_logger.note(l_node,l_index,i_new_var_list(l_index).type,i_new_var_list(l_index).signature); --show the index
      end if;
      l_index := i_new_var_list.NEXT(l_index);
    end loop;
  END;

--------------------------------------------------------------------
-- log_param_list - Log the param list
