Hi,
i want to search and replace array values by using perl
i am using while loop for the same. if i excute this,it shows "Substitution replacement not terminated at -e line 1.".
please tell me what's wrong this line
Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
I have to add a variable value to an array, something like this:
......
@my_array_name = $value_of_this_variable;
This doesnt seem to work, any ideas why?
Thanks! (4 Replies)
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Hi All,
I'm writing a nagios check that will see if our ldap servers are in sync...
I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable
so...eg...let take the single array... (1 Reply)
Hi,
Is there an easy way to simulate following Perl code in Bash.
if ( grep {$my_value eq $_} @ARGV ){
print "Do Something\n";
} else {
die "Invalid value";
} (0 Replies)
Hi,
I have 2 arrays:
@names=qw(amith veena chaitra);
@files=qw(file.txt file1.txt file3.txt);
There is one to one relationship between names and files.
There needs to be mapping created between names and files.
The output should be like this:
amith --> file.txt
veena --->... (3 Replies)
perl -pi -e 's/\x00/\x0d\x0a/g' `grep -l $'GS' filelist`
This isn't working :confused:, it's not pulling the files that contain the regex. Please help me rewrite this :wall:.
Ideally for this to work on 9K of 20K files in the directory, I've tried this but I don't know enough about awk... (7 Replies)
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
I'm trying to exlude a list of values with perl to process while reading in a file. Is there a way to use the next if with a list?
Example:
@array = qw(val1 val2 val3 val6);
while (<>) {
next if $_ =~ @array; # values I don't want to process here
print; # process the rest here
}... (8 Replies)
Discussion started by: timj123
8 Replies
LEARN ABOUT OSX
net::ldap::search
Net::LDAP::Search(3) User Contributed Perl Documentation Net::LDAP::Search(3)NAME
Net::LDAP::Search - Object returned by Net::LDAP search method
SYNOPSIS
use Net::LDAP;
$mesg = $ldap->search( @search_args );
@entries = $mesg->entries;
DESCRIPTION
A Net::LDAP::Search object is returned from the search method of a Net::LDAP object. It is a container object which holds the results of
the search.
METHODS
Net::LDAP::Search inherits from Net::LDAP::Message, and so supports all methods defined in Net::LDAP::Message.
as_struct ( )
Returns a reference to a HASH, where the keys are the DNs of the results and the values are HASH references. These second level HASHes
hold the attributes such that the keys are the attribute names, in lowercase, and the values are references to an ARRAY holding the
values.
This method will block until the whole search request has finished.
count ( )
Returns the number of entries returned by the server.
This method will block until the whole search request has finished.
entry ( INDEX )
Return the N'th entry, which will be a Net::LDAP::Entry object. If INDEX is greater than the total number of entries returned then
"undef" will be returned.
This method will block until the search request has returned enough entries.
entries ( )
Return an array of Net::LDAP::Entry objects that were returned from the server.
This method will block until the whole search request has finished.
pop_entry ( )
Pop an entry from the internal list of Net::LDAP::Entry objects for this search. If there are no more entries then "undef" is returned.
This call will block if the list is empty, until the server returns another entry.
references ( )
Return a list of references that the server returned. This will be a list of Net::LDAP::Reference objects.
sorted ( )
Return a list Net::LDAP::Entry objects, sorted by their DNs.
The sorting is done on the client side using Perl's alphanumerical sort operator "cmp".
sorted ( ATTR, ... )
Return a list of Net::LDAP::Entry objects, sorted by the specified attributes. The attributes are compared in the order specified, each
only being compared if all the prior attributes compare equal.
The sorting is done on the client side using Perl's alphanumerical sort operator "cmp".
shift_entry ( )
Shift an entry from the internal list of Net::LDAP::Entry objects for this search. If there are no more entries then "undef" is
returned.
This call will block if the list is empty, until the server returns another entry.
SEE ALSO
Net::LDAP, Net::LDAP::Message, Net::LDAP::Entry, Net::LDAP::Reference
ACKNOWLEDGEMENTS
This document is based on a document originally written by Russell Fulton <r.fulton@auckland.ac.nz>.
AUTHOR
Graham Barr <gbarr@pobox.com>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>.
COPYRIGHT
Copyright (c) 1997-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
perl v5.16.2 2012-09-20 Net::LDAP::Search(3)