Greetings all.
There has to be a better way to perform the task below. Essentially I'm just renaming fields returned from an LDAP directory searchfor output - and this works - but there has to be a more efficient way. Using all of these "IF" conditionals seems really clunky. Any suggestions are appreciated. Thanks.
And so on for about ten fields, which makes for a lot of conditionals. Hoping to find a better way.@ldapFields = ("unvLocalPhone", "unvLocalAddress", ...); foreach $field @ldapFields { if ($field eq "unvLocalPhone") { $field = "Phone"; } if ($field eq "unvLocalAddress") { $field = "Address"; } # Many more ifs follow...
In reply to A more efficient way to do this? by mirage4d
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |