#!/usr/local/bin/perl5.9.5 # use feature ":5.10"; use strict; use warnings; print "content-type: text/html\n\n"; my @userArray = qw(batman robin joker); my @userArray2; #this is a null array my @mainArray = (@userArray, @userArray2); my @set; # A loop, just for this example... for(@mainArray) { when ( ! defined $_ ) { next } when ( /^$/ ) { next } default { push @set, $_ } } say "@set";