Re: [solved] parsing and adding back this string

2011-09-04 Thread Shlomi Fish
Hi Rajeev, On Sun, 4 Sep 2011 08:05:52 -0700 (PDT) Rajeev Prasad wrote: > Shlomi Fish, > > this is not complete code but part of it, '...' in top and bottom denote > that, strict warning etc is used. Well, first of all, it would be a good idea to include the complete code. Using "..." to denot

Re: Code organization .pm

2011-09-04 Thread Shlomi Fish
Hi Ron, On Sun, 4 Sep 2011 15:28:17 -0700 (PDT) Ron Weidner wrote: > I have a class named Widget in a file named Widget.pm.  I have another class > named Table in a file called Table.pm.  Table extends Widget. > > --- > > package Widget; > #file Widget.pm > > #insert a bunch of methods...   >

Code organization .pm

2011-09-04 Thread Ron Weidner
I have a class named Widget in a file named Widget.pm.  I have another class named Table in a file called Table.pm.  Table extends Widget. --- package Widget; #file Widget.pm #insert a bunch of methods...   --- package Table; #file Table.pm use Widget; @ISA=("Widget"); #insert several method

Re: [solved] parsing and adding back this string

2011-09-04 Thread Rajeev Prasad
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

Re: [solved] parsing and adding back this string

2011-09-04 Thread John W. Krahn
Rajeev Prasad 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; pus

Re: please Perl help...

2011-09-04 Thread Shlomi Fish
Hi Parag, a few comments on your code. On Sat, 3 Sep 2011 23:38:31 -0700 Parag Kalra wrote: > use strict; > use warnings; > while(){ You should expect the contents of the file to be in a different place than __DATA__, so one should use open or *ARGV or whatever here. > my $num = $. - 1;