in reply to Re: using loop/array to write files
in thread using loop/array to write files
Can anyone see from looking at this code, what I am doing wrong? Thanks!#!/usr/bin/perl #use strict; can't use this, I get an error... my $adfile = '/home/ebrae2/adskingston-www/cgi-bin/ebrae/data/ads.data +'; my $hits_dir = '/home/ebrae2/adskingston-www/cgi-bin/ebrae/hits/'; $os = $^O; open(FILE, $adfile) || die "Can't open $adfile"; while ($line = <FILE>) { chomp $line; my @counter_file = split(/\|/,$line); open (HITS_FILE, ">$hits_dir/$counter_file[0].txt") || die "Can't cr +eate file"; ("$hits_dir/$counter_file[0].txt"); print HITS_FILE "0"; close (HITS_FILE); if ($os eq "unix") { chmod 0666, "$hits_dir/$counter_file[0].txt"; } } close(FILE); if ($os eq "unix") { chmod 0666, "$adfile"; } print "Content-type: text/html\n\n"; print "<BR><CENTER>"; print "<form><input type=button value=\"Success!\" onClick=\"locatio +n.href('http://www.adskingston.com')\"></FORM>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: using loop/array to write files
by ginocapelli (Acolyte) on Sep 10, 2001 at 04:51 UTC |