dear monks, in the light of your suggestions i've modified the code and and it worked fine it didn't return the entire file but there is one serious problem now and even after spending 2 hours debugging it i am unable to. the code i wrote is as follows.
#!/usr/bin/perl
open(INFILE, "$ARGV[0]") or die $!;
open (ALL_OUT, ">Output_File") or die $!;
while($line=<INFILE>)
{
@english=qw//;
@hindi=qw//;
chomp $line;
print ALL_OUT "########################".$line."##################
+#############\n";
($en_line,$hnd_line)=split(/\|/,$line);
if($en_line =~m/:/i)
{
@english=split(/:/,$en_line);
for($i=0;$i<=$#english;$i++)
{
$englan=substr @english[$i],3;
$eng_dat.=`grep -w '$englan' /home/vikash/pro_1/en_100
+0`;
}
print ALL_OUT $eng_dat;
if($hnd_line=~m/:/i)
{
@hindi=split(/:/,$hnd_line);
for($j=0;$j<=$#hindi;$j++)
{
$hindlan=@hindi[$j],3;
$hindi_dat.=`grep -w '$hindlan' /home/vikash/pro_1
+/HI_1000`;
}
print ALL_OUT $hindi_dat;
}
else{
$hindlane=substr $hnd_line,3;
$hindi_dat=`grep -w '$hindlane' /home/vikash/pro_1/HI_
+1000`;
print ALL_OUT $hindi_dat;
}
}
else{
$englane=substr $en_line,3;
$eng_dat=`grep -w '$englane' /home/vikash/pro_1/en_1000`;
print ALL_OUT $eng_dat;
if($hnd_line=~m/:/i)
{
@hindi=split(/:/,$hnd_line);
for($j=0;$j<=$#hindi;$j++)
{
$hindlan=substr @hindi[$j],3;
$hindi_dat.=`grep -w '$hindlan' /home/vikash/pro_1
+/HI_1000`;
}
print ALL_OUT $hindi_dat;
}
else{
$hindlane=substr $hnd_line,3;
$hindi_dat=`grep -w '$hindlane' /home/vikash/pro_1/HI_
+1000`;
print ALL_OUT $hindi_dat;
}
}
}
efficiency right now is nota at all my concern i just want the desired output, but the problem is when i run it with my labels file and if the entry happens to have not one key but multiple keys separated by ':' , and the split(/:/) is called it also prints the result of the last run of the $line. i am pasting a few lines of the output and the input file.
########################EN-1000-0050-2|HI-1000-0050-2#################
+##############
<p id=EN--1000-0050-2> A medical team opened the brain with great care
+, attempting to assess the hemispheres and lobes of this strange brai
+n. Was it in any way different? Was it for instance, bigger? No, it w
+as decided, in fact if anything, it was a little smaller than normal.
+ But still intelligence is a function of the entire brain. Yes, the f
+rontal area was well developed, and the thalamus and hypothalamus wer
+e well developed. All the neural connections se .n.ed particularly fi
+rm. In fact it was a normal brain, but\97 'Yes?' asked one of the do
+ctors. </p>
<p id=HI--1000-0050-2> एक मेडि
+325;ल दल ने बडी ì
+0;ावधानी से उ&#
+2360;के मस्तिष्
+क को खोला ता
+325;ि इस विचित्
+र मस्तिष्क 
+25;े हेमिस्फी&#
+2351;र्स तथा लॉब
+;्स की जॉच पर&#
+2326; की जा सके| क
+381;या यह किसी त
+;रह भिन्न था| &
+#2350;सलन, कुछ बड
+66; था| नही, ऐसा 
+49;ी नहीं कहा ज
+ा सकता| असल म&#
+2375;ं तो सामान्
+;य से कुछ छोट&#
+2366; ही था| पर बु
+342;्विमत्ता त&
+#2379; पूरे मस्तì
+7;ष्क का काम ह&
+#2379;ता हैं| हां 
+310;गे का भाग पू
+;री तरह विकस
+367;त था और थैले
+;मस व हाइपोथ
+376;लेमस भी अच्
+छी तरह विकस
+67;त थें| पूरी त
+;ंत्रिक प्र
+39;ाली काफी मज&
+#2348;ूत प्रतीत ì
+1;ो रही थी| दरअ
+सल यह एक साम
+366;न्य मस्तिष&
+#2381;क था, पर- पर, ç
+9;क डाक्टर ने &
+#2346;ूछा| </p>
########################EN-1000-0050-3|HI-1000-0050-3:HI-1000-0052-1:H
+I-1000-0052-2:HI-1000-0052-3###############################
<p id=EN--1000-0050-3> 'Ramu's brain clearly indicates that the evolut
+ion of the human brain has not stopped,' the chief of the team said.
+'We can say that any brain has room for anything we chose to put into
+ it. But arrangement and memory and expectations are the channels th
+rough which it is done. Once the process of intelligence started, eac
+h of the three children bore down on the others with a weight of expe
+ctation and a piling on of intellectual memory.' 'And the emotions n
+ever developed, not even with Tarangini?' 'No. They had lost their i
+mportance. Perhaps we make too much of them.' Captain Uttama sighed.
+ He had been so close to the children; he had loved them, but had the
+y ever loved him? Would he ever know? </p>
<p id=HI--1000-0050-2> एक मेडि
+325;ल दल ने बडी ì
+0;ावधानी से उ&#
+2360;के मस्तिष्
+क को खोला ता
+325;ि इस विचित्
+र मस्तिष्क 
+25;े हेमिस्फी&#
+2351;र्स तथा लॉब
+;्स की जॉच पर&#
+2326; की जा सके| क
+381;या यह किसी त
+;रह भिन्न था| &
+#2350;सलन, कुछ बड
+66; था| नही, ऐसा 
+49;ी नहीं कहा ज
+ा सकता| असल म&#
+2375;ं तो सामान्
+;य से कुछ छोट&#
+2366; ही था| पर बु
+342;्विमत्ता त&
+#2379; पूरे मस्तì
+7;ष्क का काम ह&
+#2379;ता हैं| हां 
+310;गे का भाग पू
+;री तरह विकस
+367;त था और थैले
+;मस व हाइपोथ
+376;लेमस भी अच्
+छी तरह विकस
+67;त थें| पूरी त
+;ंत्रिक प्र
+39;ाली काफी मज&
+#2348;ूत प्रतीत ì
+1;ो रही थी| दरअ
+सल यह एक साम
+366;न्य मस्तिष&
+#2381;क था, पर- पर, ç
+9;क डाक्टर ने &
+#2346;ूछा| </p>
<p id=HI--1000-0050-3> ‘रामू क
+66; मस्तिष्क इ&
+#2360; ओर स्पष्ट 
+60;ंकेत करता ह&
+#2376;ं कि मानव-म
+60;्तिष्क का व&
+#2367;कास अभी रुè
+5;ा नहीं हैं,’ &
+#2342;ल के प्रमुè
+6; ने कहा, हम कह
+; सकते हैं कि &
+#2325;िसी भी मस्ê
+0;िष्क में हम &
+#2309;ब अपनी इच्é
+1;ित चीज रख सक&
+#2340;े है| पर तर्
+325;, 52 अंतरिक्ष &#
+2325;ा वरदान स्म
+;रण शक्ति और &#
+2310;कांक्षाओं
+के माध्यम स
+75; ही यह काम कि
+;या जा सकता ह&#
+2376;ं जैसे ही बì
+9;द्वि की प्र&#
+2325;्रिया शुरु
+ हुई, ये तीनो&#
+2306; बच्चें आका
+;क्षाओं की श
+325;्ति और बुद्
+विमान स्मृê
+0;ि के स्तंभ क&
+#2375; सहारे औरोæ
+6; से आगे निकल
+गये| </p>
<p id=HI--1000-0052-1> और भावन
+366;ऍ तो उनमें क
+;भी विकसित ह
+368; नहीं हुई| तë
+2;ंगिनी में भ&#
+2368; नही| </p>
<p id=HI--1000-0052-2> नहीं उन
+325;े लिए भावना
+ओं का महत्व 
+326;त्म हो गया थ
+;ा| संभवत: हमा&
+#2352;े भीतर ये क
+69;छ ज्यादा ही
+हैं| </p>
<p id=HI--1000-0052-3> कप्तान 
+313;त्तम झेंप ग
+या| वह बच्चो
+306; को इतना निक
+;ट रहा था वह उ&
+#2344;से प्यार कë
+2;ने लगा था, पर
+ क्या उन्हो
+06;ने भी कभी उस
+से प्यार कि
+51;ा होगा| कया व
+;ह कभी यह जान &
+#2346;ायेगा| </p>
EN-1000-0050-2|HI-1000-0050-2
EN-1000-0050-3|HI-1000-0050-3:HI-1000-0052-1:HI-1000-0052-2:HI-1000-00
+52-3