Re: Iterating thru array of hashes

2010-04-01 Thread Graham Barr
On Mar 31, 2010, at 10:31 PM, Prashanth Sundaram wrote: > > > sub create_user { >my(@add_user)=...@_; >print Dumper(@add_user); >for $eachuser (@add_user) >{ print "\n==\n "; >#for $attribut (keys %eachuser) >#{ ># if ($attribut eq "\n objectC

Re: Iterating thru array of hashes

2010-03-31 Thread Prashanth Sundaram
I am still having trouble with adding users to ldap via Array of Hashes. I am a nOOb to perl scripting and learning my way thru the references. Bind to LDAP & AD, getting attributes and values work fine. *NEED HELP IN AREA* I need someone to look at the routine where I generate the Array

Re: Iterating thru array of hashes

2010-03-30 Thread Prashanth Sundaram
Thanks Graham. 1. I am using objectClass as an array in the hash. I am getting 'Object Class violation' in the ldapadd op. Should I be using a 3-D array hash? $user{'loginShell'} = $loginShell; $user{'homeDirectory'} = "/home/$sAMAccountName"; $user{'gecos'} = $cn; $user{'objectClass'} = ['top','

Re: Iterating thru array of hashes

2010-03-29 Thread Graham Barr
On Mar 29, 2010, at 1:56 PM, Prashanth Sundaram wrote: > Hello, > > I need some help in understanding how to iterate thru array of hashes. I am > basically pushing a hash into array and then passing the array to another > function to iterate thru the values. I could do it parallely but I wanted

Iterating thru array of hashes

2010-03-29 Thread Prashanth Sundaram
Hello, I need some help in understanding how to iterate thru array of hashes. I am basically pushing a hash into array and then passing the array to another function to iterate thru the values. I could do it parallely but I wanted to check the size of the array and make sure it is within the defin