I would like to do something like the following, but it does not work.
Is the closure-nature of this code what's causing the problem?

Thanks,


-Nick

--- File foo.xps ---
<%
sub snapshot {
    my ($node) = @_;

    $t->{address}{testcode} = sub {
        my ($node, $t) = @_;
        my $street = findvalue('address/text()', $node);
        my $city = findvalue('city/text()', $node);
        my $state = findvalue('state/text()', $node);
        my $zip = findvalue('state/text()', $node);
        my $phone = findvalue('main_phone', $node);
        my $url = findvalue('url', $node);
        $t->{pre} = qq(<para>$street<br/>
                       $city, $state $zip<br/>
                       $phone</br>
                       $url</para>);
        return -1;
    };

    my $address = apply_templates('/institution/contact_information');
    my $html = qq(<table border='1' cellpadding='8' bgcolor='#cccc99'>
                  <tr><td width='208' align='center,center'>
                  $address
                  </td></tr></table>);
    return $html;
}
                  
%>
--- end of File ---

Then somewhere else:

--- File bar.xps ---
<!--#include file="content/html-college_profile_new.xps" -->
<%
$t->{school}{testcode} = sub {
    my ($node, $t) = @_;
    if ($some_condition) {
        $t->{pre} = &snapshot;
    }
    return -1;
};
%>
--- end of File ---




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to