This does what I would like it to
if (grep {/$dn/} @ad_sys) {
$is_system = 1;
}
but this always returns 1
.
if (grep $_ == $dn, @ad_sys) {
$is_system = 1;
}
What does the second piece do?
Matteo Riva :
== is used for numeric comparison, if you need string comparison use eq.",
2011-04-04T13:11:42
Ingo :
It filters those elements from the list @ad_sys that are numerically equal to $dn.\nThen, if the result is not empty, the condition is true and the if-block is entered.",
2011-04-04T13:10:24