Как вернуть undef из функции в perl: http://perlmaven.com/how-to...ndef-from-a-function