use List::Util qw( first ) ; sub lowercase { return first {$_} map { lc } @_ unless wantarray ; return map { lc } @_ ; } $jim = lowercase( 'Jim' ) ;