How do you return an instance of a variable class from within a different variable class? I have a plugin with the structure something like:

variables
 - PluginVariable.php
 - PluginAnotherVariable.php


Inside PluginVariable.php I have something like:

&lt;?php
namespace Craft;

class PluginVariable
{
   public function foo($parameter)
   {
       $result = craft()-&gt;plugin_results-&gt;get($parameter);
        return new PluginAnotherVariable($result);
   }
}


Now when I do {{ craft.plugin.foo('something') }} I just get Fatal error: Class 'Craft\PluginAnotherVariable' not found.

I've checked that the filenames and classnames are identical and the namespacing etc so the class most certainly exists but I can't get this to work, has anyone had a similar issue with this and what could be causing it? Thanks.
Boom!

So I just needed to put an underscore between the plugin handle and variable name so PluginAnotherVariable.php becomes Plugin_AnotherVariable.php and the classname Plugin_AnotherVariable and things are now working :)