>>>>> "PK" == Parag Kalra <paragka...@gmail.com> writes:
PK> use strict; PK> use warnings; PK> while(<DATA>){ PK> chomp; why are you chomping here when you add in the \n later? PK> if ($_ =~ /NM_(\d+)/){ PK> my $found = $1; PK> $_ =~ s/$found/$found:12345/g; many issues there. why do you test the match before making the s///? you can ALWAYS do an s/// as it will just fail if it doesn't match. why are you doing s/// against $_? by default it does that. PK> print "$_\n"; PK> } else { PK> print "$_\n"; PK> } why are you printing the same thing in each clause? just print AFTER the change is made? why do you top post when you have been told to bottom post and edit the quoted email? uri -- Uri Guttman ------ u...@stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/