split's default behavior will split on multiple whitespace, much like /\s+/, with the bonus of ignoring leading and trailing whitespace:
use strict; use warnings; while (<DATA>) { print "The fourth element is ", (split)[3], "\n"; } __DATA__ one two three four five six seven A B C D E F G H I spam eggs spam spam and spam
In reply to Re: another split question
by Art_XIV
in thread another split question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |