#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; my @strings = qw( He_is_super_hero_Spiderman He_was_a_super_actor_Tom ); for my $string (@strings) { my ($spiderman_or_tom) = $string =~ /Spiderman|Tom/g; say $spiderman_or_tom; my ($last_word) = (split /_/, $string)[-1]; say $last_word; my ($last_capitalized) = $string =~ /.*([[:upper:]][^_]+)/; say $last_capitalized; } #### ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,