use ExtUtils::MakeMaker; sub write_makefile { # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'SPOPSx-Ginsu', 'PREREQ_PM' => { SPOPS => 0.86 }, 'AUTHOR' => 'Ray Zimmerman ', 'ABSTRACT' => 'SPOPS eXtension for Generalized INheritance SUpport', 'PMLIBDIRS' => [ 'SPOPSx' ], # 'MAN3PODS' => {}, 'VERSION_FROM' => 'SPOPSx/Ginsu.pm', # finds $VERSION ); } my $conf_file = 't/my_dbi_conf.pm'; if ( -f $conf_file ) { my $ans = lc get_input( "It appears you already have a $conf_file file.\n" . 'Would you like to use it?', 'Y'); unless ($ans eq 'y') { eval{ unlink( $conf_file ) }; } } unless ( -f $conf_file ) { my $DB_NAME = get_input( "Enter name of database for testing", 'GinsuTest'); my $DB_USER = get_input( "Enter database username for testing", 'test'); my $DB_PASS = get_input( "Enter database password for testing", ''); open( CONF, "> $conf_file" ) || die "Cannot open $conf_file for writing! Error: $!"; print CONF <; chomp $val; $val = $default if $val =~ /^\s*$/; } until ( defined $val ); ($val) = $val =~ /^\s*(.*)\s*$/; return $val; }