Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: ADSI groups users

by sundialsvc4 (Abbot)
on Mar 04, 2011 at 14:20 UTC ( [id://891456]=note: print w/replies, xml ) Need Help??


in reply to ADSI groups users

I naturally look at such problems with an eye toward so-called finite state machine logic.   While this particular example is trivial, the idea is more-or-less like this:

The algorithm will loop through all of the zero-or-more input records that exist.   As it does so, it will also keep some kind of “recollection of” what it has seen before ... memories of data that might have been gleaned from previous records, and, importantly, “what state we are now in.”   In this example, we might say the states are (say...) SKIPPING_FOR_GROUP_NAME and READING_USER_NAMES.   There is always an “initial state” that is established before the record-reading loop begins.

Each input record is classified both in terms of its content (e.g. “it consists entirely of digits”), and by the current state.   In response, the algorithm (a) decides what to do with this value, and (b) maybe changes the value of “current state.”

There are always activities that must occur both during the reading-loop and then one more time after the loop ends.

As always, writing an actual algorithm in a production setting is a balancing-act between sufficiency, robustness, clarity, simplicity and overkill.

Replies are listed 'Best First'.
Re^2: ADSI groups users
by Anonymous Monk on Mar 04, 2011 at 14:54 UTC
    Awesome!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-18 13:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found