Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: No output to screen or output file

by Riales (Hermit)
on Jul 24, 2012 at 17:15 UTC ( #983474=note: print w/replies, xml ) Need Help??

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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://983474]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2018-01-20 19:34 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (227 votes). Check out past polls.