in reply to Re^3: Alternate for "open"
in thread Alternate for "open"

While I posted my first program here "MONKS" suggested to use strict. From that time I never miss those two lines in my code. And I am very sure that I am using while to read the file (Already posted).

As per your suggetion I am trying to run the code piece by piece now. And my first piece is reading CDR & build the values in hash. So, I want to be sure that my hash is not taking much memory.

Thanks for suggestions

Replies are listed 'Best First'.
Re^5: Alternate for "open"
by Preceptor (Deacon) on Nov 17, 2015 at 11:34 UTC

    The only sample you post:

    $cmp=substr(reverse($line),0,1); if ($cmp eq ";") {

    doesn't look like it has strict and warnings switched on. Or if it is, you're reusing $cmp which isn't necessary and recycling vars means you're probably not scoping correctly. That's why you get it as a suggestion again - because we have no evidence to the contrary.

      I updated the post as they suggested and posted my output.

        Still no code - so still can't give you an answer

Re^5: Alternate for "open"
by Preceptor (Deacon) on Nov 18, 2015 at 14:41 UTC

    I don't believe you - if you have use strict; use warnings when you also have:

    my $total_size = total_size(\%val); print "\%val :",$total_size,$/; my $total_size = total_size(\%seen_cdr);

    Your code is generating errors: "my" variable $total_size masks earlier declaration in same scope.

    Either you don't have these switched on, or you've code that's generating errors every time it runs, and you're asking for someone to fix it for you.