Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: File Locking

by sligi (Sexton)
on Nov 16, 2001 at 02:11 UTC ( #125700=note: print w/replies, xml ) Need Help??


in reply to File Locking

Hmm... Seems like you have empty @friends there. The loop should probably be something like:
while(<MYFILE>) { if (m/^$newfriend$/) { print "You are already on the list!\n"; exit; } push @friends, $_; }
...or one could of course concatenate to the file.

--
Jaska

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://125700]
help
Chatterbox?
and the leaves swirl about...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2016-12-05 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (71 votes). Check out past polls.