in reply to Re: Parsing individual words from a file
in thread Parsing individual words from a file
my @w = map /\S+/, <DATA>; use Data::Dumper;print Dumper \@w; __DATA__ aboveboard aboveground abovementioned abrade Abraham Abram Abramson abrasion abrasive abreact abreast abridge abridgment abroad
Produces:
$VAR1 = [ 1, 1 ];
Test your code the next time ;^). You really meant /\S+/g:
my @w = map /\S+/g, <DATA>; use Data::Dumper;print Dumper \@w; __DATA__ aboveboard aboveground abovementioned abrade Abraham Abram Abramson abrasion abrasive abreact abreast abridge abridgment abroad
$VAR1 = [ 'aboveboard', 'aboveground', 'abovementioned', [...]
--
David Serrano
|
|---|