s0ttle has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w my (@ipfconts, $ipfile, $x); $remote_addr = '63.103.135.132'; $ipfile = '../ipfile.txt'; open (IPFILE, "<$ipfile") || die("Could not open $ipfile: $!\n"); @ipfconts = <IPFILE>; for ($x=0; $x<=$#ipfconts; $x++) { if ($ipfconts[$x] =~/$remote_addr}/){ print "added new guest!\n"; last; }else{ print "guest not found!\n";last; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: for loop
by Abigail (Deacon) on Jun 22, 2001 at 05:05 UTC | |
by CharlesClarkson (Curate) on Jun 22, 2001 at 08:01 UTC | |
by Abigail (Deacon) on Jun 22, 2001 at 11:55 UTC | |
by Anonymous Monk on Jun 22, 2001 at 14:03 UTC | |
|
Re: for loop
by japhy (Canon) on Jun 22, 2001 at 04:24 UTC | |
|
Re: for loop
by Zaxo (Archbishop) on Jun 22, 2001 at 04:09 UTC |