Serge Shakarian wrote: > <?XML:NAMESPACE PREFIX = O /> > > When parsing a large log file which one would be better for > performance splice or split? Every line is in a standard format and I > would be using splice/split to get 12 out of 20 space separeted words > in each line. Thanks in advance. > Serge
Hello Serge. If you're starting with a single file record in a scalar, then 'splice' is irrelevant as it operates only on Perl arrays. You can extract your fields with 'split' if they are comma-separated (or otherwise delimited) or 'unpack' (if they are fixed-length). If the record structure is more complex you may need to use a regex to split it up. Of these, unpack will be the fastest, but you shouldn't be worried about the efficiency of your code until you've written a program and proven it to be unacceptably slow. Until then you should be writing in the way that best describes the structure of your data. It is a useful thing to reduce the run time from 6 hours to 1 hour, but is an expensive waste of effort to improve on a solution with a run time of 60ms to reduce it to 10ms. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]