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 :-))