Replace min() function with one from List::Util

List::Util is a core module since 5.7.x