in reply to Re: appending to a file
in thread appending to a file

Each line of the input file is probably going to look something like:

John Doe\n

And your regex: /^\Q$student\E$/ will never match any line in that file, because it doesn't allow for the trailing newline. Thus, $student will always get printed, even if the name already exists. F


Dave

Replies are listed 'Best First'.
Re^3: appending to a file
by Anonymous Monk on Feb 27, 2004 at 05:41 UTC

    Did you even try running my script? If you had, you'd have seen that it works just fine. Notice the anchor I used. '$', not '\z'. So the match works just fine thank you.

      thanks so much it work fine