use strict; use warnings; use 5.012; my @array = ( 'GAP_SPAN09 - GAP SPAN base (Scratch Testing [TSMC11] : tsmc11_wld(sxfatd12j))', 'GAP_SPAN03 - GAP SPAN base (DFD E2E Testing [TSPAN04] : tspan04-dfdint-wld(sxfamd6f))', 'OS_WLI02 - POS_WLI02 Web Logic Integrator', ); my @results = map{(split / - /)[0]} @array; say for @results;