in reply to Re: foreach/while loop help
in thread foreach/while loop help


Thanks for your reply.
The issue is , code isn't looping through each group and member from the list
As you mentioned, the looping inside looping is confused, I guess and need more functions but don't know what it is.
I'm just learning to write in Perl so definitely need more help to understand.

Replies are listed 'Best First'.
Re^3: foreach/while loop help
by Anonymous Monk on Jul 13, 2015 at 00:36 UTC

    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

    so I might rewrite that as

    while( $dl = <FH> ){ my @entries = GetEntries( ... ); FudgeEntries( \@entries, $removememfilepath ); }

    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