#!/usr/bin/perl use strict; use warnings; use CGI; my $cgi = CGI->new(); my @a = (); $cgi->param('foo',scalar @a ? @a : ''); print $_ for $cgi->param('foo');