On Tuesday 29 June 2004 19:26, Wiggins d Anconia wrote:
> > On Tuesday 29 June 2004 18:44, mohammed chafik wrote:
> > > That's what i've tried (may be it is not the best approch);
> >
> > If you ask me, the general approach is quite ok...
>
> Good suggestions, if we are going to stick with the loop, and we only
> care that we advance as long as we haven't found the subject then
> throwing a 'last' in after the assignment, would provide at least some
> speed up. If there are a significant # of lines to parse and the subject
> may appear early enough on the line then this could be a noticeable
> improvement. 

You're right, of course...

> It would also make sense to adjust $i initial point forward 
> if we can be guaranteed that subject occurs after a minimum number of
> fields on a line, which does seem indicated since we are using 0,2
> indexes later not relative to the subject, so $i could be set at 3
> initially.  Turn my nitpicking back off now ;-)...

...but I was just trying to keep my own perfectionism at a tolerable 
level. ;-)
I'm quite sure that some people on this list would re-write this script in a 
maximum of two lines, but since Chafik's scripts is working after all, I 
thought it might be fair to give him a chance of improving his own script...

Generally, I'd (still) think that regular expressions might be a good idea 
here...e.g. see Gunnarīs post  ;-)

Philipp 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to