#!/usr/bin/perl

use strict;

#globale Variablen
our $vowels = 'aeiouy';
our $cons  = 'cbdfghjklmnpqrstvwxzy';
our %map  = (K => $cons, V => $vowels);
our $pat;	# Pattern
our $re;	# Regex

#Laufvariablen
my $class;
my $char;

sub debug {
	my @array = keys %map;
	print "Vowels: $vowels\n";
	print "Cons: $cons\n";
	print "Map: @array\n";
	print "Pat: $pat\n";
}

for $class ($vowels, $cons) {
	for (split //, $class) {
		$map {$_} .= $class;
	}
}

keys %map;

for $char (split //, shift) {
	$pat .= "[$map{$char}]";
}

print "Pattern lautet $pat\n";
$re = qr/^${pat}$/i;
print "REGEX lautet $re\n";
@ARGV = ('/usr/share/dict/words')
	if -t && !@ARGV;

while (<>) {
	print if /$re/;
}
Fr Jul 30 13:54:24 CEST 2021
patent_button.gif valid-html401.png elektra.jpg fsfe-logo.png valid-css.png vim.gif anybrowser.gif