in reply to Nagging space after splitting

In your case it will work like this
# perl -MData::Dumper -e ' > $str = " STRING "; > $str =~ s/\s//g; > push(@ar,$str); > print Dumper \@ar;'
You will get
$VAR1 = [ 'STRING' ];
Is this what you want?
But if you want to use split then use it as Zaxo told you

``The wise man doesn't give the right answers, he poses the right questions.'' TIMTOWTDI