sub compile_regex ( $ ) { qr/$_[0]/; } my $days_re = compile_regex join '|', @days;