#!/usr/bin/env perl use Modern::Perl; while(){ goto SKIPPED if /match/; } say 'Do something after normal loop exit'; SKIPPED: say 'Proceeding with rest of program'; __DATA__ line 1 line 2 match line 3 line 4