in reply to Capturing substrings with complex delimiter, up to a maximum

Remember that split takes a regex as it first argument. Use a lookahead assertion after the comma.
use strict; use warnings; use Data::Dumper; my $input = q|http://abc.org,http://de,f.org,https://ghi.org,http://jk +l.org|; my @urls = (split /,(?=http)/, $input, 4)[0..2]; print Dumper \@urls;
Output:
$VAR1 = [ 'http://abc.org', 'http://de,f.org', 'https://ghi.org' ];
Bill