DontPanic42 has asked for the wisdom of the Perl Monks concerning the following question:
$playername = ''; $clipsobt = ''; $done = ''; @logfile = ''; $logfile = ''; open(LOGFILE, "C:\\Documents and Settings\\Alex\\Desktop\\doomlog.txt" +) or die "Can't open DOOM log file: $!\n"; open(LOGWRITE,">C:\\Documents and Settings\\Alex\\Desktop\\explog.txt" +) or die "Can't open log file for writing: $!\n"; until ($playername) { &askname(); } &clipcalc(); print LOGWRITE "You have obtained $clipsobt clips.\n"; sub askname { print "What is your player's name?: "; chomp($playername = <STDIN>); } sub clipcalc { @logfile = split(" ", <LOGFILE>); foreach $logfile (@logfile) { if ($logfile =~ /clip/i) { $clipsobt++ } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error Problem
by GrandFather (Saint) on Apr 17, 2008 at 01:52 UTC | |
|
Re: Error Problem
by NetWallah (Canon) on Apr 17, 2008 at 01:40 UTC | |
|
Re: Error Problem
by oko1 (Deacon) on Apr 17, 2008 at 02:00 UTC |