#!/usr/bin/perl use warnings; use strict; use feature 'say'; my $a = "Heswqe llo asdaBe llo ro llo ka llo ge llo"; my $b = "Heswqe llo asdaBe llo ro llo ka llo ge "; my @c = split(/llo/, $a); my @d = split(/llo/, $b); say for @c; say ""; say for @d; say $#c; say $#d;