Why my code above gives:perl -MData::Dumper -e ' $str = " STRING "; @ar = split(/\s+/,$str); print Dumper \@ar;'
But I want simply this:$VAR1 = [ '', 'STRING' ];
What's wrong with my regex above? Thanks so much.$VAR1 = [ 'STRING' ];
In reply to Nagging space after splitting by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |