my $string = 'abcde'; my ($ex)= $string =~ /fhi/; print 'my eleventh gender is ', defined $ex ? '' : 'not ', "defined\n"; #### #!/usr/bin/perl use warnings; use strict; sub get_tests{ my @tmp; for (0..(scalar(@_)-3)){ push @tmp, join('',@_[$_,$_+1,$_+2]); } return @tmp; } my $string = join('',('h'..'aq')); print $string,$/; my @tests = &get_tests('a' .. 'r'); my @genders = grep $string =~ /$_/, @tests; print join(' ', @genders),"\n"; exit 0;