my $cgi = new CGI; # .... bunch of calendarview.pl code here .... # need to get a url that takes us back to new years my $newyears = new CGI($cgi); $newyears->param('month',1); $newyears->param('day',1); my $newyears_url = $newyears->self_url; #### sub new_self_url { my %params = @_; my $new = new CGI($cgi); foreach(keys %params) { $new->param($_,$params{$_}); } return $new->self_url; } # now you can get urls back to your script with different # dates like this: my $newyears = new_self_url(month => 1, day => 1); my $christmas = new_self_url(month => 12, day => 25);