if((my $start = /start/) .. (my $end = /end/)) { ... #### print "First time\n" if $start; print "Last time\n" if $end;