Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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?


Comment on Re: No output to screen or output file
Select or Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://983474]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2015-07-07 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls