Re: which is better when reading files

2008-01-13 Thread Lost Sheep Of the Porn
On Jan 11, 5:28 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > Enjoy_Life wrote: > > > > > > > > hi, who can tell me which is better of the following codes? > > why there are different methods to read files? > > thanks > > > 1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading: > >

Re: which is better when reading files

2008-01-11 Thread Rob Dixon
Enjoy_Life wrote: > hi, who can tell me which is better of the following codes? why there are different methods to read files? thanks 1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading: $!\n"; while () { print if /blue/; } close(INPUT); 2. use IO::File;

Re: which is better when reading files

2008-01-11 Thread Enjoy_Life
thanks On Jan 11, 2008 5:04 PM, Jeff Pang <[EMAIL PROTECTED]> wrote: > On Jan 11, 2008 2:00 PM, Enjoy_Life <[EMAIL PROTECTED]> wrote: > > hi, who can tell me which is better of the following codes? > > why there are different methods to read files? > > thanks > > > > 1. open(INPUT, "< filedata")

Re: which is better when reading files

2008-01-11 Thread Jeff Pang
On Jan 11, 2008 2:00 PM, Enjoy_Life <[EMAIL PROTECTED]> wrote: > hi, who can tell me which is better of the following codes? > why there are different methods to read files? > thanks > > 1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading: > $!\n"; > while () { > pr

which is better when reading files

2008-01-10 Thread Enjoy_Life
hi, who can tell me which is better of the following codes? why there are different methods to read files? thanks 1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading: $!\n"; while () { print if /blue/; } close(INPUT); 2. use IO::File; $input = IO::File->ne