use strict; use Data::Dumper; my $string = '=123=123=435'; my @array = grep { $_ ne '' } split '=', $string; print Dumper \@array;