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


in reply to subsitute s/ and match m/ failure

As clarification of what's been said elsewhere, you are testing the wrong element of the split ... to use your original code, change
$model =~ s/\.log$//; die if $model =~ /log/;
to read
$ip =~ s/\.log$//; die if $ip =~ /log/;

A user level that continues to overstate my experience :-))