my $test = "TITLE=SPECIAL CASE 1"; my @temp; for(reverse split(//,$test)){ last if /=/; push @temp,($_); } print reverse @temp;