#!/usr/bin/perl

# $Id: copy_ws.pl,v 1.3 1996/01/17 05:05:35 hoagland Exp $

# copy_ws.pl, by Jim Hoagland (hoagland@cs) 1/96

# this program makes a working set like another one, stores it,
# then invokes &draw_ws to return the HTML for the page.
# Input is CGI, fields on a form,  Output is HTML to STDOUT.

require '/pkg/www/arpa/secret/cgi-bin/gui-helper.pl';
require '/pkg/www/arpa/secret/cgi-bin/draw_ws.pl';

require CGI;

$input= new CGI;

foreach (@ARGV) {  # simulate field input
  $input->param(split('=',$_,2));
}

$state= State->new(&get_statefile);

#-------------

$to= $input->param('to');
$from= $input->param('name');
$state->set_set($to,$state->hosts_in_set($from));
$state->store;

&draw_ws($state,$to);
1;
