
japhy
Enthusiast
Sep 24, 2000, 5:48 PM
Post #2 of 2
(283 views)
|
Try the following: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> if ($formdata{addname} =~ /\W/) { error1() } else { open LIST, "+>>/path/to/alias.txt" or error(); seek LIST, 0, 0; # go to beginning while (<LIST> ) { error2() if /$formdata{addname}\@$MABLE[1]/o; } print LIST "new data here...\n"; close LIST; } </pre><HR></BLOCKQUOTE> Your main problem was you backslashed the [ and ] in the array element $MABLE[1]. ------------------ Jeff "japhy" Pinyan -- accomplished author, consultant, hacker, and teacher
|