#! /usr/bin/perl -w use strict; my @allowed = split '', 'abcdefghijklmno'; my %testHash; @testHash{@arg}=(); my @test = split '', 'acbbedfydaccd'; die "Unknown char! \n" unless exists $testHash{$_} for (@test); print "success!\n";