#!/usr/bin/perl use warnings; use strict; for $1 ('a' .. 'h') { print $1 if "A" =~ /(.)/; }