use CGI; use URI; =head2 C<< link $ARGREF >> Returns a link to the current query, modified by C<$ARGREF>, suitable for use from within Template Toolkit. Very convenient if you want to page through a sorted set. All CGI query parameters are preserved. =cut sub link { my ($args) = @_; my %V = (%{ CGI->new->Vars }, %$args); return URI->new(CGI->new(\%V)->url(-full => 1, -query => 1))->query; };