qr{^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z0-9_]+)*$} #### #!/usr/bin/env perl use strict; use warnings; use Test::More; my @modules = qw{ strict autodie::exception::system utf8 B App::Prove::State::Result::Test CPAN::Meta::History::Meta_1_0 Encode::KR::2022_KR }; plan tests => 0+@modules; my $re = qr{^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z0-9_]+)*$}; for my $mod (@modules) { is $mod =~ $re, !!1, "Testing $mod"; } #### 1..7 ok 1 - Testing strict ok 2 - Testing autodie::exception::system ok 3 - Testing utf8 ok 4 - Testing B ok 5 - Testing App::Prove::State::Result::Test ok 6 - Testing CPAN::Meta::History::Meta_1_0 ok 7 - Testing Encode::KR::2022_KR