in reply to No output to screen or output file

Do you define $num_elements anywhere? I'm thinking you never enter the for loop because $num_elements is undefined.

Also, you appear to be using $c to iterate over $filter. This seems odd to me because $filter is just a string. Which array are you actually trying to iterate over?

Replies are listed 'Best First'.
Re^2: No output to screen or output file
by dkhalfe (Acolyte) on Jul 24, 2012 at 17:21 UTC

    Yes I do

     my $num_elements = (@filter-1); #Number of elements in array

    I have even printed the $num_elements variable to the screen and it works.

      $num_elements isn't really named correctly. In the code, it is the last index of the array. Just a minor nit.   :-)

      But, your for loop is ok because it tests if $c <= $num_elements.

      Chris