in reply to PL_rsfp_filters - what does it contain ?

#!/usr/bin/perl use myfilter; use otherfilter;
av_len(PL_rsfp_filters) is equal to 1 in this case!

Yes, meaning there are two active filters. av_len(), despite its name, returns the highest index in the array, not the number of elements.

Anno

Replies are listed 'Best First'.
Re^2: PL_rsfp_filters - what does it contain ?
by sawoy (Initiate) on Mar 16, 2007 at 16:42 UTC
    thanks, Anno!
    i search aroung PL_rsfp_filters but forget about av_len()
    as i see in sources number of array's elements is always (av_len() + 1). so i can use statement like:
    if ( (av_len(PL_rsfp_filters) + 1) > 1 )
    that is equal to already founded checking:
    if ( av_len(PL_rsfp_filters) > 0 )
      i search aroung PL_rsfp_filters but forget about av_len()

      Ah yes, that's known as an XY problem: You asked (first yourself, then the Perl Monks) about the content of PL_rsfp_filters (that's X), but your problem was understanding av_len() (Y). Good thing you mentioned av_len() in the body of your query. It might have been unanswerable otherwise.

      if ( av_len(PL_rsfp_filters) > 0 )

      Right, that checks for two or more filters. In view of the problem you had with the statement, it probably deserves a comment:

      if ( av_len(PL_rsfp_filters) > 0 ) { /* We only deal with a single filter */
      Anno

      Update: Identified X and Y in the XY problem