use strict; use warnings; use v5.12; my @array = ( "First try this.", "Second try that.", "Third tried another.", "Fourth tried this last.", ); if( @array ~~ m/tried/p ) { say ${^PREMATCH} . ${^MATCH} . ${^POSTMATCH}; } #### Third tried another.