From: Jamie C. <jca...@we...> - 2003-12-24 11:42:08
|
Larry Gilson wrote: > I hope I can both articulate the problem and that this is just something I > am overlooking. > > I have a report library for a module. In a specific section, it parses > /var/log looking for maillog*. I have no problem accessing the files and > reading them. However, after copying the file to an array, the array > appears to have no input record separators. The foreach control structure You can read a whole file into an array with code like : open(FILE, $file); @lines = <FILE>; close(FILE); > that should iterate through each line of the log only makes one pass. The > odd thing is that I can take the exact script, make it stand alone and use a > print statement that utilizing backtick assignment from the same location > and it will iterate through the file and provide the appropriate output. > Additionally, I can call the stand alone script from the shell and it > provides the appropriate output. I am not using any external modules. This > simply opens the file, parses it, does some math, and outputs the result. > > Am I doing something wrong? Can anyone help me with this? Would it be possible for you to post the actual code to the list? Or at least the segment that is having trouble .. That would make it easier to track down the problem. - Jamie |