CONFIG_TULIP_NAP => y CONFIG_USB_SISUSBVGA_CO => y CONFIG_PC30 => m CONFIG_USB_TES => m CONFIG_I2C_NFORCE => m CONFIG_MTD_SBC_GX => m CONFIG_NTFS_DEBUG => Z CONFIG_DRM_SI => m CONFIG_SCSI_ISCSI_ATTR => m CONFIG_ACPI_SLEE => y CONFIG_DLCI_MA => 8 CONFIG_SCSI_IPR_DUMP => Z CONFIG_ECONET_NATIV => y CONFIG_BRIDG => m CONFIG_IP_ADVANCED_ROUTE => y CONFIG_AIC79XX_REG_PRETTY_PRIN => y CONFIG_IF => m some of the keys are chopped off like CONFIG_BRIDG there are so many entries in the config file with this name. CONFIG_BRIDGE_NF_EBTABLES=m CONFIG_BRIDGE_EBT_BROUTE=m CONFIG_BRIDGE_EBT_T_FILTER=m CONFIG_BRIDGE_EBT_T_NAT=m CONFIG_BRIDGE_EBT_802_3=m CONFIG_BRIDGE_EBT_AMONG=m CONFIG_BRIDGE_EBT_ARP=m CONFIG_BRIDGE_EBT_IP=m CONFIG_BRIDGE_EBT_LIMIT=m CONFIG_BRIDGE_EBT_MARK=m CONFIG_BRIDGE_EBT_PKTTYPE=m CONFIG_BRIDGE_EBT_STP=m CONFIG_BRIDGE_EBT_VLAN=m CONFIG_BRIDGE_EBT_ARPREPLY=m CONFIG_BRIDGE_EBT_DNAT=m CONFIG_BRIDGE_EBT_MARK_T=m CONFIG_BRIDGE_EBT_REDIRECT=m CONFIG_BRIDGE_EBT_SNAT=m CONFIG_BRIDGE_EBT_LOG=m CONFIG_BRIDGE_EBT_ULOG=m similarly, CONFIG_AIC79XX_REG_PRETTY_PRINT=y is shown only as CONFIG_AIC79XX_REG_PRETTY_PRIN => y I am maintaining hash with configuration name as key and value to be y,m,Z I am puzzled as to why the some keys are getting chopped off while others are not ? ====== code => #!/usr/bin/perl # This part of the script takes the old config # file and sets only those options into the new # config files which are set. open CONF1 ,"<","config-2.6.18-custom" or die $!; open CONF2 ,"<","config-2.6.16.27-custom" or die $!; my @lines1= ; my @lines2= ; sub trim{ my $string = shift; $string =~ s/^\s+|\s+$//g; return $string; } sub get_config_info_in_mem { my %hash_config = (); my ($lref) = @_; my (@lines) = @$lref; for $line (@lines) { if (substr($line,0,6) eq "CONFIG" ) { $i=index($line,"="); $val=substr($line,$i+1,length($line)-1-$i); $conf=substr($line,0,$i-1); # print "$conf=$val\n"; $conf=trim($conf); $val=trim($val); $hash_config{$conf} = $val; } else { if(substr($line,0,8) eq "# CONFIG") { $i=index($line,"CONFIG_"); $i_space=index($line," ",$i+1); $conf=substr($line,$i,$i_space-$i); $val="Z"; # print "$conf=$val\n"; $conf=trim($conf); $val=trim($val); $hash_config{$conf} = $val; } } } return %hash_config; } sub print_hash_in_mem { my ($hc) = @_; my %hash_config =%$hc; while( my($conf,$val) = each(%hash_config)) { print "$conf => $val\n"; } } my %hash_config1=get_config_info_in_mem(\@lines1); #print $hash_config1."\n"; print_hash_in_mem(\%hash_config1); # my $hash_config2=get_config_info_in_mem(@lines2); # print_hash_in_mem(%hash_config2);