Date sent:        Tue, 7 Nov 1995 16:42:26 -0500 (EST)
From:             "Daniel F. Ancona, IV" <dfa4y@jefferson.village.virginia.edu>
To:               "Stephen N. Matsuba" <engl5105@nexus.yorku.ca>
Subject:          Re: VRML Submission

#!/usr/local/bin/perl

open (screen, ">&STDOUT");
print (screen "Content-type: text/html\n\n");

sub ReadQuery {
    $qstring=$ENV{"QUERY_STRING"};

    %p=split(/[=&]/,$qstring);
    foreach (keys %p) {
 $p{$_} =~ tr/+/ /;
 $p{$_} =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    }
    @pics=keys %p;
}

sub WritePage {
    $catstring=join ('.wrl ', @pics);
    print (screen "<html><head><title>DGR VRML
    Created</title></head>"); print (screen "<body>"); print
    (screen "<font size=+1>VRML Created!</font><p>"); print
    (screen "<a href=\"dgr.wrl\">View the whole room
    (dgr.wrl)</a><p>"); print (screen "Or, view each picture by
    itself in 3D:<ul>"); foreach (@pics) {
 print (screen "<li><a href=\"$_.wrl\">$_.wrl</a>");
    }
    print (screen "</ul>");
    $furniture="shelf.wrl couch1.wrl molding";
}

sub WriteVRML {
    system "cat room.wrl molding.wrl wall.wrl $catstring.wrl
    $furniture.wrl end.wrl > dgr.wrl";
}

#MAIN
&ReadQuery;
&WritePage;
&WriteVRML;



