last if /somregexp/; #### last if $somelongvarname =~ /somregexp/; #### chop;