my @config = extractFile( 'c:/apache/cgi-bin/cms/gcp/1_0/txt/gcp.conf' ); my $index_file = 0; foreach( @config ) { if( $_ =~ m|index_file =| and $_ =! m/#/ ){ print "$_\n"; $index_file = s/index_file = //; } }