in reply to A regexp/split question

wrote by Monk takshaka on Wed Jun 7 2000 at 20:41 @flds = split; # or @flds = split ' '; Skips leading whitespace. ########################## I can't understand these expression,but It worked indeed,why? @flds=split ' ' equate @flds=split(' ',$_); it is not equate @flds=split(/ /,$_); What different between ' ' and / / ? I hope you can understand my poorly english,Thanks!

Replies are listed 'Best First'.
RE: A regexp/split question
by takshaka (Friar) on Jun 08, 2000 at 11:05 UTC
    split; and split ' ', $line; are special cases that split on whitespace just like /\s+/ but without leading null fields.

    This behavior is described in the perlfunc entry on split.