in reply to Re: A more efficient way to do this?
in thread A more efficient way to do this?
Not in Perl, but in Perl you could:
foreach my $field (@ldapFields) { $field =~ s/unvLocalPhone/Phone/; $field =~ s/unvLocalAddress/Address/; #... }
although that is probably less efficient in terms of execution time and only marginally better in terms of maintainability and programmer time. Besides, it doesn't do what the OP's code does - consider what happens if an element of @ldapFields were 'unvLocalPhoneNumber' for example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: A more efficient way to do this?
by mirage4d (Novice) on Feb 11, 2010 at 21:20 UTC | |
by kennethk (Abbot) on Feb 11, 2010 at 21:34 UTC |