# splitte an Pattern mit EINEM Leerzeichen $ perl -e '$string = " foo bar"; @fields = split(/ /,$string); foreach(@fields) {$c++; print "$c $_\n"}' 1 2 3 foo 4 5 bar # splitte an Pattern mit EINEM oder MEHREREN Leerzeichen $ perl -e '$string = " foo bar"; @fields = split(/ +/,$string); foreach(@fields) {$c++; print "$c $_\n"}' 1 2 foo 3 bar # SPEZIAL: splitte an STRING mit einem Leerzeichen $ perl -e '$string = " foo bar"; @fields = split(" ",$string); foreach(@fields) {$c++; print "$c $_\n"}' 1 foo 2 bar