function assign_block_vars($blockname, $vararray)
    {
        if (strstr($blockname, '.')) {
            // Nested block.
            $blocks = explode('.', $blockname);
            $blockcount = sizeof($blocks) - 1;
            $str = '$this->_tpldata';
            for ($i = 0; $i < $blockcount; $i++) {
                $str .= '[\'' . $blocks[$i] . '.\']';
                eval('$lastiteration = sizeof(' . $str . ') - 1;');
                $str .= '[' . $lastiteration . ']';
            }
            // Now we add the block that we're actually assigning to.
            // We're adding a new iteration to this block with the given
            // variable assignments.
            $str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;';

            // Now we evaluate this assignment we've built up.
            eval($str);
        } else {
            // Top-level block.
            // Add a new iteration to this block with the variable assignments
            // we were given.
            $this->_tpldata[$blockname . '.'][] = $vararray;
        }

        return true;
    }