use Regexp::Assemble; my $ra = Regexp::Assemble->new; $ra->add(127..254); print $ra->re;