
IvarForss
Deleted
Apr 15, 2000, 2:16 AM
Post #3 of 4
(242 views)
|
Her's the code.... but i dident figure out at all how to use the sort command so it isent included... # Open counter file open(File, "+<count.dat") | | die "can't update somewhere: $!"; $buffer = <File>; # read the line seek(File, 0, 0); # go back to start of file for rewriting #if (length ($ENV{'QUERY_STRING'}) > 0){ $page = $ENV{'QUERY_STRING'}; $page = "http://i.am/bokhyllan/3.htm"; # DEBUG @pairs = split(/&/, <File> ); seek(File, 0, 0); # go back to start of file for rewriting foreach $pair (@pairs){ ($name, $value) = split(/=/, $pair); $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $in{$name} = $value; if ($page eq $name) { $value = $value +1; $pagefound="yes"} print $name,"=",$value, "\n"; push (@list, $name, "=", $value, "&"); } print File @list; if ($pagefound eq "yes") { close File; } else{ print File $page, "=1&"; print $page, " = 1 new!"; close File; } #}
|