Shlomi Fish, this is not complete code but part of it, '...' in top and bottom denote that, strict warning etc is used. all variables etc are already created using 'my'. i am using global variables. what should anybody name their variables, is upto them. you seem to be someone who get arrogant after learning few things. there are other people on this list more well known then you, they either do not help if they do not like, or some of them understand things and help. if you think a code can be improved, you can learn from people like John W. Krahn, he has suggested the same.
________________________________ From: Shlomi Fish <shlo...@shlomifish.org> To: Rajeev Prasad <rp.ne...@yahoo.com> Cc: Perl Beginners <beginners@perl.org> Sent: Sunday, September 4, 2011 1:25 AM Subject: Re: [solved] parsing and adding back this string Hi Rajeev, please acknowledge you have received and read this message. On Sat, 3 Sep 2011 15:47:42 -0700 (PDT) Rajeev Prasad <rp.ne...@yahoo.com> wrote: > ... > ... > > $k=1; > my $arSZ = @tmpAR=split(/"/,$line); > for $x (0..$arSZ-1){ > if ($x % 2 == 0) { > push(@modline,"$tmpAR[$x]"); > > } else { > my $count = $tmpAR[$x-1] =~ tr/,/,/; #try for something more > correct like... =~ m/\,/g); $k = $k + $count; > push(@modline,"STRING.$k"); > } > This code exhibits a lot of the bad elements I've commented about here: http://www.nntp.perl.org/group/perl.beginners/2011/09/msg118526.html Have you read that message and the http://perl-begin.org/tutorials/bad-elements/ link? If so, why do you continue writing such bad code? Regards, Shlomi Fish > print @modline; > ... > ... > > > this replaces fields in quotes with STRING-field number. > > > > -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ "The Human Hacking Field Guide" - http://shlom.in/hhfg In the Technion, there are many ways to get from one place to the other, but they are all the same length. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/