Home:ALL Converter>What does this code do?

What does this code do?

Ask Time:2011-04-04T21:07:21         Author:Sandra Schlichting

Json Formatter

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?

Author:Sandra Schlichting,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/5538899/what-does-this-code-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
yy