in reply to spliting new lines and spaces

Do you mean you want to eliminate spaces and new lines?
use Data::Dumper; my @test=("aaa bbbbb cccc"); my @test = map { s/\s//g; $_ } @test; print Dumper(\@test);

And the output is as expected:
$VAR1 = [ 'aaabbbbbcccc' ];