Broken, if the regex ever not matches. Please don't use $1 except in the conditional testing the regex that you think might match.while (<>) { /(\S*)\s+(\S*)/; push @a, $1 if length $1; push @b, $2 if length $2; }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re: Re: making a single column out of a two-column text file
by merlyn
in thread making a single column out of a two-column text file
by allolex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |