in reply to Re^2: split function gives emply line as output of the array element
in thread split function gives emply line as output of the array element
There is an empty string around every corner$ perl -e " print qq!($_)\n! for split /,/, q!,1,2,3!" () (1) (2) (3) $ perl -e " print qq!($_)\n! for split /,/, q!,,,,1,2,3!" () () () () (1) (2) (3) $ perl -e " print qq!($_)\n! for split /(,)/, q!,,,,1,2,3!" () (,) () (,) () (,) () (,) (1) (,) (2) (,) (3)
$ perl -e " print qq!($_)\n! for split /,/, q!5,,,!" (5) $ perl -e " print qq!($_)\n! for split /(,)/, q!5,,,!" (5) (,) () (,) () (,)
|
|---|