use strict; use Getopt::Long; use Pod::Usage; #******************************************************** #** Intialise variables #******************************************************** my $Add_Record= 0; my $Edit_Record= 0; my $List_Records = 0; my $View_Record = 0; my $Manual = 0; my $Help = 0; #******************************************************** #** Process command line arguments. #******************************************************** GetOptions( 'add|a=s' =>\$Add_Record, 'edit|e=s' =>\$Edit_Record, 'list|l=s' =>\$List_Records, 'view|v=s' =>\$View_Record, 'man|m' =>\$Manual, 'help|h|?' =>\$Help ); #******************************************************** #** Print Usage files based on the status of the command #** line arguments. #******************************************************** pod2usage(1) if $Help; pod2usage(-exitstatus => 0, -verbose => 2) if $Manual; if (($Add_Record xor $Edit_Record) xor ($List_Records xor $View_Record)) { # Run Program } else { # Print manual }