in reply to Perl match to cut off after second occurrence

my $STOP_AFTER_MATCH = 2; (undef, undef, my $dir) = split /\\/, $0, $STOP_AFTER_MATCH + 1;