in reply to regex issue

well this is nor really speedy
my $found = 0; while (<$fh>) { $found = 1 if index($_, $student) == 0; }

Replies are listed 'Best First'.
Re: Re: regex issue
by matija (Priest) on Feb 27, 2004 at 21:08 UTC
    There's a problem with your code: It will give a false positive if you have a name which is identical to part of a shorter name

    (for instance: John Smith would match, even though the name in the file is John Smithers).

Re: Re: regex issue
by Anonymous Monk on Feb 27, 2004 at 21:00 UTC
    what did you do :)) , What does the index function do ? thanks
Re: Re: regex issue
by Anonymous Monk on Feb 27, 2004 at 21:03 UTC
    Hummmmmmmm , doesn't work my friend!!!! prints duplicate entries.