good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: split functionby kennethk (Abbot) |
on Jul 12, 2010 at 16:15 UTC ( [id://849035]=note: print w/replies, xml ) | Need Help?? |
Your line while(my @line = <DATAIN>) slurps in the whole file. I think what you mean to write is:
The while(<DATAIN>) structure reads the next line into the special variable $_, which is then split on tabs and stored in my @line = split (/\t/);. See I/O Operators and split. If this does not meet spec, post your input file (wrapped in code tags) and expected output, so we can see what you see what you see. Read How do I post a question effectively?. Update: Please do not change the content of posts - it makes it less likely people will notice your updates and makes it much more difficult to follow threads later. It looks like jwkrahn's post below answers your concerns.
In Section
Seekers of Perl Wisdom
|
|