in reply to Getting Multiple inputs
Note that the "\s+" will split on one or more whitespace characters, so it will still work if they accidentally type two spaces between some words.print "Enter some words (separated by spaces): >> "; chomp(my $line = <STDIN>); my @words = split /\s+/, $line;
Cheers,
Darren :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting Multiple inputs
by ikegami (Patriarch) on Apr 05, 2006 at 18:52 UTC | |
|
Re^2: Getting Multiple inputs
by sweetblood (Prior) on Apr 05, 2006 at 18:43 UTC | |
|
Re^2: Getting Multiple inputs
by gzayzay (Sexton) on Apr 05, 2006 at 17:21 UTC |