http://www.perlmonks.org?node_id=989339


in reply to how to check condition and then pattern match

Seems that you want to parse an ifconfig output:

use Net::Int::Stats;