Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 22nd, 2000, 07:01 PM
tucats tucats is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Posts: 18 tucats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i put a script together... the only problem is it works great, and writes a new file for all webpages AS LONG AS THEY ARE IN THE FIRST SUBDOMAIN... i.e. http://www.kidz4dayz.com/counter.html

i need to be able to use the counter "deeper" in the subdomains... i.e. http://www.kidz4dayz.com/testfirstl...cond/test.shtml

but all i get is repeating #1... what can i do to this script to get it to work the way that i want...?

#!/usr/local/bin/perl


$pagepath = $ENV{'DOCUMENT_URI'};

$counter_file = "counter/$pagepath";

print "Content-type: text/htmlnn";

open(FILE, ">>$counter_file");
close(FILE);

open(FILE, "$counter_file");
@indata = <FILE>;
close(FILE);

$onoff = 0;
open(FILE, ">$counter_file");
foreach $temp (@indata)
{
chop($temp);
($uri, $count) = split(/|/, $temp);
if ($uri eq $pagepath) {
$count++;
$onoff = 1;
print FILE "$uri|$countn";
print "$count"; }
else { print FILE "$uri|$countn"; }
}
if ($onoff eq 0) {
print FILE "$pagepath|1n";
print "1"; }

close(FILE);


thanks so much...




[This message has been edited by tucats (edited January 25, 2000).]

Reply With Quote
  #2  
Old February 2nd, 2000, 05:02 PM
rindal rindal is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: cph,,denmark
Posts: 2 rindal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Taking a quick glance at your script, I wonder why you do

$counter_file = "counter/$pagepath";

instead of

$counter_file = "$pagepath/counter";

or am I just missing the point ?

Reply With Quote
  #3  
Old February 2nd, 2000, 10:16 PM
tucats tucats is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Posts: 18 tucats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
rindal...

i thank you for your follow up...

i have dumped that script and have put together a new script that does everything that i want it to do...

thanks again...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > help with script...

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap