my $opt = 'ah1:2:3:f:l:L:i:d:'; my ($isascii, $fmtfile, $fldname, $length, $location, $infile, $dirname); getopts ("$opt", \%opt); switch ($_) { case {$opt{1}} { read_structure_type1($opt{1}); next; } case {$opt{2}} { read_structure_type2($opt{2}); next; } case {$opt{3}} { read_structure_type3($opt{3}); next; } case {$opt{f}} { $fldname = $opt{f}; next; } case {$opt{l}} { $length = $opt{l}; next; } case {$opt{L}} { $location = $opt{L}; next; } case {$opt{i}} { $infile = $opt{i}; next; } case {$opt{d}} { $dirname = $opt{d}; next; } case {$opt{h}} { usage(); exit; } }