Re: open and close a filehandle

2008-01-10 Thread Rob Dixon
Kevin Viel wrote: I have a file with thousands of fields, but a subsequent program can only had 3000. I have to break this file up, for simplicity: 1-03000 03001-06000 Hopefully, a basic outline of my code will suffice to get informative advice. my $cnt = -1 ; my $subset = 1 ; foreach (

RE: open and close a filehandle

2008-01-10 Thread Kevin Viel
> -Original Message- > From: John W. Krahn [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 10, 2008 8:26 AM > To: Perl Beginners > Subject: Re: open and close a filehandle > > Kevin Viel wrote: > > I have a file with thousands of fields, but a subsequent

Re: open and close a filehandle

2008-01-10 Thread Chas. Owens
On Jan 10, 2008 9:26 AM, John W. Krahn <[EMAIL PROTECTED]> wrote: snip > > if ( $cnt = 0 ) { > > You are assigning 0 to $cnt so $cnt will always be false and the else > block will always execute. snip This is one of the reasons the warnings and strict pragmas are so important. The warnings prag

Re: open and close a filehandle

2008-01-10 Thread Stephen Kratzer
On Wednesday 09 January 2008 18:03:37 you wrote: > I have a file with thousands of fields, but a subsequent program can only > had 3000. I have to break this file up, for simplicity: > > 1-03000 > 03001-06000 > > Hopefully, a basic outline of my code will suffice to get informative > advice. >

Re: open and close a filehandle

2008-01-10 Thread John W. Krahn
Kevin Viel wrote: I have a file with thousands of fields, but a subsequent program can only had 3000. I have to break this file up, for simplicity: 1-03000 03001-06000 Hopefully, a basic outline of my code will suffice to get informative advice. my $cnt = -1 ; my $subset = 1 ; foreach (