In a script I'm working on, I'm using this block of code to convert a file's Date Modified as the filename for the output file:
#Ops stores the stat function ran on the previous input.
$Ops = (stat($DB))[9];
#Converts the date to a readable format
($sec, $min, $hour, $mday, $mon, $year, $wday...
Actually, if I tell it to use if (exists $Dest) it tells me that it's not part of a hash or array. duncdude's matching expression works exactly as I need it to. The thing is, when it counts, I infer that it's telling me every individual instance of an address instead of how many times it was...
I'm sorry, I'm pretty much new at Perl, I've only been at it for about 2 weeks.
my %IPs; #Added in this HASH
my $User;
my $Dd;
my $Tt;
my $Ap;
my $Dest;
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
#my $Choices;
#my $PickNumber;
print "Which file: ";
$TheDB =...
Sorry for the linguistic confusion, I really meant substituting. Oh and that $key =~ s/http:\/\/*.*\///ig; line was an early, unsuccessful attempt that I forgot to delete. Also, I just tried your first method again, I was implementing it wrong before. It sort of worked. On some of the URLs...
Hello everyone. I have this code, originally courtesy of FireMyst, and I modified it. Originally it counted instances of user IP addresses from the records in log files. Now I want to get the addresses the users visited. I've got it pulling out the addresses and counting them, but I don't...
It does come out to be some rather ungainly code. Just to make things clear, I don't want it to generate the sixth option. I'm just doing it in a subroutine:
sub input2{
my $Choices2;
my $Picknumber2;
INPUT2: $Choices2 = <<'OPTIONS2';
Hey again! What would you like to do next?
1) Open...
Hello everyone. What I want to do is go through a loop, and when it has gone through that loop one or more times, I want it to run a subroutine. The code I have so far is this:
print "\n\nPlease enter the name of the file to load: ";
$DB = <STDIN>;
chomp($DB);
INPUT: $Choices =...
Oookay, I see I was far overstepping my knowledge. Here's my original goals in pseudocode:
Ask which file you want to run time calculations on
Open that file
Begin an infinite loop
Associate the user with the time
Associate the time with the site
Calculate the time since the epoch of the first...
Okay so I'm still wrestling with these log files. What I'm trying to do now is get it to go through and add up how long a user stayed on a page. The log is formatted like this:
19.33.44.63 2003/08/05 0009:38:11 PASSED http://www.slashdot.com
110.25.12.6 2003/08/05 0009:38:11 PASSED...
Oh, wait, usige you just gave me a thought. If I had it add that date to the epoch and use that as a starting point instead of trying to change the epoch itself, that should work, right?
Yes, I want to set the epoch to the first date/time combo in a list, for example:
08/13/03 06:17:29
08/17/03 12:22:04
08/17/03 18:19:20
I would want the epoch to be set as 08/13/03 06:17:29. Unfortunately Duncan, I'm doing it in Windows, I'm sorry I failed to mention that. Is there a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.