Re: help with file reading

2002-10-07 Thread Michael Fowler
On Mon, Oct 07, 2002 at 03:54:53PM +0200, Pravesh Biyani wrote: > $lofile = " somefile"; > > and call the function > > file_read(lofile) ; > > where function is : > > > sub file_read > { > > while (<$_[0]>) > > blah..blah.. > > } It's not entirely clear from your code what you intended t

RE: help with file reading

2002-10-07 Thread Dharmender Rai
Well the thing will work but its useless because you are not reading from the file here. You are applying the while loop on a scalar instead of providing it with the file desc that it needs for the "logical processing". --- "Daryl J. Hoyt" <[EMAIL PROTECTED]> wrote: > You can pass in a variable

Re: help with file reading

2002-10-07 Thread Dharmender Rai
Read the Hashed Part () --- Pravesh Biyani <[EMAIL PROTECTED]> wrote: > Hi > can i pass the file variable in the function.. > > for eg. > > $lofile = " somefile"; > > and call the function > ## The way you have defined file_read ## you should pass the handle of the file ## by opening it

RE: help with file reading

2002-10-07 Thread Daryl J. Hoyt
You can pass in a variable it would be something like this: $lofile = " somefile"; file_read($lofile) ; sub file_read($) { my ($file) = @_; while (<$file>) blah..blah.. } Daryl J. Hoyt Software Engineer Geodesic Systems 312-832-2010 < http://www.geodesic.com> < mailto:[EMAIL PROTECTED]>