use Getopt::Long; Configure( \%Config ); if( $Config{help} ){ Syntax(); exit();} ....Code Goes Here..... sub Configure { my( $Config ) = @_; my $Result = 0; Getopt::Long::Configure( "prefix_pattern=(-|\/)" ); $Result = GetOptions( $Config, qw( del|d=i length|l=i path|p=s first|f=s reports|r=i help|?|h ) ); if (! scalar $Config->{line}) { $Config->{line}=132;} if (! scalar $Config->{reports}) { $Config->{reports}=1;} if (! exists $Config->{path}) { Syntax(); exit; } if (! exists $Config->{first}) { Syntax(); exit; } if (exists $Config->{del}) { Delete(); } $stream = $Config->{line}; $rptpag = $Config->{reports}; $dir = $Config->{path}; $firstln = $Config->{first}; } sub Syntax { print <