Hi,
Your whole coding is not good.
Try the below:
open (true, "< DATA.txt"); open (first, "> 1.out.text"); open (rest, "> 2.out.text"); $. <= 8 ? print first $_ : print rest $_ while(<true>);
DATA.txt
1 2 3 4 5 6 7 8 9 10
Update: true is included
In reply to Re: removing lines from a file
by gopalr
in thread removing lines from a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |