#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp qw/warningsToBrowser fatalsToBrowser/; my $q = CGI->new; my @links = qw/foo bar buz/; my $selected = $q->param('sel') || 'World'; my $o = $q->header . $q->start_html . $q->h1( 'Hello ' . $selected ); $o .= $q->a({href => $q->url . '?sel=' . $_}, $_) . $q->br for @links; $o .= $q->end_html; print $o;