From: Lokesh Agrawal Date: 2008-03-11T19:35:53+09:00 Subject: Please help Hi All, I have written a scipt. require 'rubygems' require 'net/ldap' require "env_variable.rb" ldap = Net::LDAP.new :host => '10.44.169.24', :port => 389, :auth => { :method => :simple, :username => "cn=Manager,dc=ibm,dc=com", :password => "secret" } filter = Net::LDAP::Filter.eq( "mail", $email ) treebase = "dc=ibm,dc=com" attrs = ["status"] ldap.search( :base => treebase, :filter => filter, :attributes => attrs ) do |entry| entry.each do |attribute, values| $i = 1 values.each do |$status| end puts $status end end and I am getting output Inactive mail=$email,ou=people,o=external,dc=ibm,dc=com means $status variable is holding text Inactive first time and second time its value is mail=$email,ou=people,o=external,dc=ibm,dc=com (first value get replaced by new value) I want to take both the values in variable or in array. Can anyone help me please. Thanks and Regards Lokesh Agrawal -- Posted via http://www.ruby-forum.com/.