sub _browseruk_recognize_limited_urls { my ($input, $max) = @_; my @captures = $input =~ m[(https?://.+?)(?:,(?=http)|$)]g; return [ @captures[ 0 .. @captures < $max ? $#captures : $max -1 ] ]; } #### sub _browseruk_recognize_limited_urls { my ($input, $max) = @_; my @captures = $input =~ m[(https?://.+?)(?:,(?=http)|$)]g; $#captures = $max -1 if @captures >= $max; ## Adjust size if necessary return \@captures. }