#!usr/bin/perl ### Search through the users @vararray= ('andrew', 'andrews', 'test', 'AnDre', 'HAHAhahAndrEXXXShowtonite', 'AndreaLovesPr0n','Tony', 'Perlmonks'); =comment foreach $user (@list) { if(param('search') =~ /$user/) { print "$user
"; } } =cut $varregexp= 'andre'; #this is just for finding the number of matches $varmapresults= 0; $varmapresults= map (/$varregexp/i, @vararray); #get the actual values. A simple regexp returns the NUMBER of matches, hence the IF statement between brackets @varmapresultsarray= map {$_ if $_=~ /$varregexp/i} @vararray; print "\nHell-llo n-nurse!: $varmapresults times"; print "\nDo what you want with me!: @varmapresultsarray";