The issue is , code isn't looping through each group and member from the list

What loop is that?

Why do you think it isn't looping, because data is missing, or ldap calls aren't returning data or ?

The way to solve that problem is to eliminate everything from the code that isn't that loop, and solve only that loop, see Re^2: Perl Script and Re^4: Main logic of this script (summary/abstract/outline) (and parent/replies)

So when I run your program through ppi-outline.pl I get

# while( $dl = <FH> ) # foreach ( @entries ) # foreach ( @members ) # while( $curmem = <FH2> ) # foreach ( @entries2 ) # if( grep /^$member$/, @current )

so I might rewrite that as

while( $dl = <FH> ){ my @entries = GetEntries( ... ); FudgeEntries( \@entries, $removememfilepath ); }
sub FudgeEntries { my( $entriesRef, $removemem ) = @_; for my $entry ( @$entriesRef ){ my @members = GetMembers( $entry ); FudgeMembers( \@members, $removemem ) } } sub FudgeMembers { my( $membersRef, $removemem ) = @_; ... }

Basicaly outline the program in terms of subroutines ( make more subs, don't develop allergy ) that actually run, even if that means making them stubs stubs by hardcoding the data, then one by one turn the stubs into real subs. Get running code first, then slowly improve that running code.

is ldap-master temporarily offline? If you use stubs you can still develop your program .... and others who don't use ldap at all (or don't have an is ldap-master like yours) can help you

Is the problem with GetMembers()? Only concentrate on getmembers ....

Somewhere in your program you make an assumption about a function or some data that isn't true, so your program doesn't work the way you want it; all you have to do is find it, that gets easy with small subs


In reply to Re^3: foreach/while loop help by Anonymous Monk
in thread foreach/while loop help by bshah

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.