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.
In reply to Re^2: A more efficient way to do this?
by GrandFather
in thread A more efficient way to do this?
by mirage4d
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |