[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] UserTag - [data session host] - Perl nslookup
****** message to minivend-users from "Cameron B. Prince" <cbp@InternetExpertsLLC.com> ******
Hi list,
As some of you will remember, a few weeks ago I setup a database for logging
visitors and tracking pages they view.
I use the following line to set the scratch host_ip which is written to the
database as the visitor origin:
[if session host][seti host_ip][data session host][/seti][else][seti
host_ip][data session ohost][/seti][/else][/if]
After running the script for awhile I noticed that on the majority of
occasions, [data session host] is empty and [data session ohost] gets set as
host_ip. I am not sure why this is happening because I know Minivend know's
their real host , it names the session files accordingly.
I decided to use a usertag and some perl to do a lookup on [data session
ohost] and set a value based on the results.
Here's my usertag: (from minivend.cfg) (Minivend v4.04)
UserTag nslookup Order table
UserTag nslookup Interpolate 1
UserTag nslookup Routine <<EOF
sub {
use Socket;
my $address = @_;
my $domain = gethostbyaddr(inet_aton($address), AF_INET);
}
return $domain;
}
EOF
I took this perl code straight from the O'Reily Perl Cookbook I bought
recently. I am calling it like this:
[seti host_ip][nslookup [data session ohost]][/seti]
I am getting this in the error.log:
- - - [17/June/2000:21:08:29 -0500] - - UserTag 'nslookup' subroutine failed
compilation:
>
> Global symbol "$domain" requires explicit package name at (eval 93)
line 6, <GLOBAL> chunk 122.
>
> In line 122 of the configuration file '/etc/minivend.cfg':
> UserTag nslookup Routine <<EOF
>
I am reading it like this: Minivend found that the string ($domain) is
trying to base it's value on gethostbyaddr and this is either not defined
correctly or isn't allowed.
Anyone have any ideas about what could be wrong or what should be done to
allow this?
Thanks,
Cameron
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list