Yes I understand the code and This is my understanding the code. while() { =In this I am reading the complete file with file handle. $interface = $1 if /^([\S]+)/; =this line will check the one or more non whitspace char and if ti found put the value in $1 and assign to $interface. print "$interface => $1\n" if /inet addr:([0-9.]+)/; =this line will check the address and if it found put the value in $1. But I am not able to check the condition on the first line.