http://qs321.pair.com?node_id=1126543

sumathigokul has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks...Any idea how to print the value of $lines outside 'for loop', because i want to print the lase updated statement....

se strict; use warnings; open (IN1, "<design_modify1.vhd") or die; open (IN2, "<nets.txt") or die; open (OUT, ">output_file.vhd") or die; open (IN3, "<enabled_nets.txt") or die; my @nets = <IN2>; chomp @nets; my @enabled_nets = <IN3>; chomp @enabled_nets; my $lines = ""; while (<IN1>) { #print OUT; foreach my $i (0..$#nets) { if (s/\=\>\s+$nets[$i]\,/\=\>$enabled_nets[$i]\,/) { my $lines = $_; print "done"; print $lines; } } print OUT "$lines"; } close (IN1); close (IN2); close (IN3); close (OUT);