use warnings; use strict; use Getopt::Long qw(:config gnu_getopt); help() if $ARGV[0] !~ /^--/; my @aminos = qw (A R N D C Q E G H I L K M F P S T W Y V B Z X); GetOptions( 'substr1=s' => \my $substr1, 'substr2=s' => \my $substr2, 'sub' => \&a, 'help|?' => \&help, ); sub a { if ( "$substr1$substr2" =~ /[^@aminos]/ ) { print "hello\n"; } print "@aminos\n"; } sub help { print "Usage: script --substr1 value --substr2 value --sub"; exit }