[13764] in Perl-Users-Digest
Perl-Users Digest, Issue: 1174 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 27 21:17:15 1999
Date: Wed, 27 Oct 1999 18:17:02 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941073422-v9-i1174@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 27 Oct 1999 Volume: 9 Number: 1174
Today's topics:
Re: Arggggh! <g> help? (Greg Bacon)
Re: Arggggh! <g> help? (Abigail)
Re: Arggggh! <g> help? <jeffp@crusoe.net>
Array of Hashes (comparing)? (Pfash1)
Arrays of hashes: Need Help (Pfash1)
Re: Arrays of hashes: Need Help <rootbeer@redcat.com>
Automatic translation from C structs to perldsc in xs <rhomberg@ife.ee.ethz.ch>
Autosave incomming emails? <figmo@my-deja.com>
Re: Autosave incomming emails? (Alan Curry)
Banner Rotation Theory <webmaster@webdream.com>
Re: Banner Rotation Theory (Benjamin Franz)
Re: Banner Rotation Theory <gellyfish@gellyfish.com>
Re: Banner Rotation Theory <AgitatorsBand@yahoo.com>
Re: Banner Rotation Theory <AgitatorsBand@yahoo.com>
Re: Banner Rotation Theory (Benjamin Franz)
Re: Banner Rotation Theory <webmaster@webdream.com>
Re: Banner Rotation Theory (Benjamin Franz)
Re: Banner Rotation Theory (Abigail)
Re: Banner Rotation Theory (Craig Berry)
Re: Banner Rotation Theory <support@celebritybase.net>
Re: Banner Rotation Theory <rootbeer@redcat.com>
Re: Banner Rotation Theory (Henry Penninkilampi)
better link indexing program? <michael@cermak.com>
Re: can a perl script do this? <qajurria@qajurria.cx>
Re: can a perl script do this? <rootbeer@redcat.com>
Re: Can cgi pass uid/pwd for access to .htaccess protec <bajan@cool.mb.ca>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Oct 1999 19:10:59 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: Arggggh! <g> help?
Message-Id: <7v4uc3$121$5@info2.uah.edu>
In article <Pine.GSO.4.10.9910250714590.2694-100000@crusoe.crusoe.net>,
Jeff Pinyan <jeffp@crusoe.net> writes:
: You shouldn't use single quotes, that is true. The reason given is wrong.
: The correct reason is that single quotes do not interpolate variables, and
: other goodies.
While true for this particular case, I find myself surrounding constant
(for sufficiently fuzzy value of `constant') strings in single quotes.
Other people (Russ springs to mind) have also confessed to this
neurosis. :-) I don't know that I can account for it. I guess I like
the visual cue.
Greg
--
When the speaker and he to whom he speaks do not understand, that is
metaphysics.
-- Voltaire
------------------------------
Date: 25 Oct 1999 18:53:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Arggggh! <g> help?
Message-Id: <slrn819ra4.fji.abigail@alexandra.delanet.com>
Jeff Pinyan (jeffp@crusoe.net) wrote on MMCCXLVI September MCMXCIII in
<URL:news:Pine.GSO.4.10.9910250714590.2694-100000@crusoe.crusoe.net>:
^^ On Oct 25, Eric Bohlman blah blah blah:
^^
^^ > JTJ (jtjohnston.delete@courrier.usherb.ca) wrote:
^^ > : print GW "\t$in{'question$count'}";
^^ >
^^ > Lose the single quotes. Since they're inside a double-quoted string
^^ > they're treated literally, which means that you're trying to look up hash
^^ > keys with embedded single quotes, which you don't have (i.e. the hash key
^^ > you want is called question1, but you're looking for a key made up of a
^^ > single quote, question1, and another single quote).
^^
^^ Gah! Don't tell him that, because it's pretty wrong. Very wrong,
^^ actually.
^^
^^ You shouldn't use single quotes, that is true. The reason given is wrong.
^^ The correct reason is that single quotes do not interpolate variables, and
^^ other goodies.
Of course, in his example, he would have been better off with an
array instead of a hash:
print GW "\t$question[$_]" for 1 .. 4;
Abigail
--
split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 25 Oct 1999 07:18:43 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Arggggh! <g> help?
Message-Id: <Pine.GSO.4.10.9910250714590.2694-100000@crusoe.crusoe.net>
On Oct 25, Eric Bohlman blah blah blah:
> JTJ (jtjohnston.delete@courrier.usherb.ca) wrote:
> : print GW "\t$in{'question$count'}";
>
> Lose the single quotes. Since they're inside a double-quoted string
> they're treated literally, which means that you're trying to look up hash
> keys with embedded single quotes, which you don't have (i.e. the hash key
> you want is called question1, but you're looking for a key made up of a
> single quote, question1, and another single quote).
Gah! Don't tell him that, because it's pretty wrong. Very wrong,
actually.
You shouldn't use single quotes, that is true. The reason given is wrong.
The correct reason is that single quotes do not interpolate variables, and
other goodies.
Examples:
print "This is the process ID: $$\n";
print 'This is two dollar signs, with a backslash-n after: $$\n';
You'll see what they look like when you feed those two lines to perl.
How do you fix it?
for $i (1..4){ # or whatever
print "This is the value: $in{qq!question$i!}\n";
}
for $i (1..4){
print qq!This is the value: $in{"question$i"}\n!;
}
Or use a here-doc.
You should read:
perldoc perlop # for information about q(), qq(), qw(), qx(), qr()
perldoc perldata # for information about here-docs
--
MIDN 4/C PINYAN, USNR, NROTCURPI
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
------------------------------
Date: 27 Oct 1999 22:54:18 GMT
From: pfash1@aol.com (Pfash1)
Subject: Array of Hashes (comparing)?
Message-Id: <19991027185418.23687.00003209@ng-ch1.aol.com>
#Help here would be greatly appreciated.My question is in the comments below.
#!perl -w
open (SENTMAIL, 'file_of_emails') || die &error_file; #I fill an array of
hashes with strings from a file of sent emails. (The "file_of_emails" file is
copied at the end)
my @sent_emails;
{
local $/ = "------\n\n";
while (<SENTMAIL>)
{
chomp;
if ( s/^To: (.*)\n+Sender's Name: (.*)\n// )
{
push @sent_emails, {to => $1, from => $2, msg => $_};
}
}
}
close <SENTMAIL>;
#Now I want to compare the above array of hashes to the one I make from the
contents of "file_of_replies" opened and worked on below. (The actual
"file_of_replies" is copied at end)
open (FH, 'file_of_replies') || die &error_file;
my @replies;
{
local $/ = "------\n";
while (<FH>)
{
chomp;
if ( s/^>\n> To: (.*)\n+>\n> Sender's Name: (.*)\n//)
{
push @replies, {mentor => $1, student => $2, replies => $_};
foreach (@sent_emails)
#here is the comparison to the array from above.
{
if( $_->{from} eq $2)
{
print "there is a reply to a student's email\n"; #checking
push @certain_replies, {replies => $_}; # why do I get the
HASH numbers? How should I do it to get the strings?
}
}
}
}
close <FH>;
}
print "REPLIES THAT MATCH SENDERS:@certain_replies";
############file_of_emails#############
To: Steve
Sender's Name: Jarrett
Hello Steve
------
To: PamS
Sender's Name: Emily
Hello PamS
------
To: Ray
Sender's Name: Brandi
Hello Ray
#################file_of_replies############
------
>
> To: Steve
>
> Sender's Name: Emily
Here is Steve's reply to Emily
------
>
> To: Nicholas
>
> Sender's Name: Jarrett
Here is Nicholas' reply to Jarrett
------------------------------
Date: 26 Oct 1999 23:55:51 GMT
From: pfash1@aol.com (Pfash1)
Subject: Arrays of hashes: Need Help
Message-Id: <19991026195551.25518.00002512@ng-cg1.aol.com>
I would so much appreciate help here: I have two text files of records (one
has sent emails the other replies to emails) seperated by dotted lines.
I want to open the sent mail file('careerclassSENT2'), isolate sender,
recipient and message and fill an array of hashes with this information.
Then I want to open the text file that contains the replies
('careerclassREPLY2') and find all the senders' names, check to see if any of
them matches a sender's name from the sentmail file (in other words if there
exists a reply to one of the sent emails) and if so to print the reply. Got
most of this done but I haven't been able to print the reply message once I
know there is a match between the sender's name from the sentmail file #and the
reply file. Here is the code: (the two text files follow)
#!perl #-w
open (SENTMAIL, 'careerclassSENT2') || die &error_file;
my @array_of_emails;
{
local $/ =
"-------------------------------------------------------------------------
--\n\n";
while (<SENTMAIL>)
{
chomp;
if ( s/^To: (.*)\n+Sender's Name: (.*)\n// )
{
push @array_of_emails, {to => $1, from => $2, msg => $_};
}
else
{
#print XXXXX;
}
}
}
close <SENTMAIL>;
###########
open (RE, 'careerclassREPLY2') || die &error_file;
my @array_of_replies;
{
local $/ =
"-------------------------------------------------------------------------
--\n";
while (<RE>)
{
chomp;
if ( s/^>\n> To: (.*)\n+>\n> Sender's Name: (.*)\n// )
{
push @array_of_replies, {Rto => $1, Rfrom => $2, Rmsg => $_};
foreach (@array_of_emails)
{
if( $_->{from} eq $_->{Rfrom})
{
print $_;
print $_->{Rmsg};#neither of these prints the message associated with
the match
}
}
}
else
{
#print "XXXX";
}
}
}
close <RE>;
####################careerclassREPLY2#############
---------------------------------------------------------------------------
>
> To: Steve
>
> Sender's Name: Jarrett
here is the reply from steve
---------------------------------------------------------------------------
>
> To: PamS
>
> Sender's Name: Emily
here is the reply from PamS
#################careerclassSENT2####################
To: Steve
Sender's Name: Jarrett
Hello Steve
-------------------------------
To: PamS
Sender's Name: Emily
Hello PamS
-------------------------------
------------------------------
Date: Tue, 26 Oct 1999 20:27:55 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Arrays of hashes: Need Help
Message-Id: <Pine.GSO.4.10.9910262024320.29843-100000@user2.teleport.com>
On 26 Oct 1999, Pfash1 wrote:
> #!perl #-w
That's an unusual way of asking for warnings. Does it work? My tests seem
to indicate that it doesn't.
> close <SENTMAIL>;
That should have given you a warning message, if you had used -w.
As to the rest of your troubles, have you tried stepping through your code
with the Perl debugger? You should be able to find out what's wrong that
way.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 27 Oct 1999 18:24:21 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Automatic translation from C structs to perldsc in xs
Message-Id: <38172735.F942E6B@ife.ee.ethz.ch>
Hi
I want to parse a text file into a more or less complex C or C++
structure
Then I process this structure in perl. Can anybody give me a hint of a
good method to translate the struct to perl structures?
The obvious way is to write a conversion function from a struct like
struct hallo {
double peter;
int fritz;
double hans [20];
}
to a list of refs of hashes of arrays is something like:
SV *convert_hallo (struct hallo *st)
{
AV *hans = newAV();
for(i++ etc)
av_push(hans,newSVnv(st->hans[i]));
HV *hallohv = newHV(); /* pseudo array instead of hash would be
better */
hv_store(hallohv, "hans", strlen(hans), newRV_inc((SV*)hans), 0);
etc.etc
return newRV_inc((SV*)hallohv);
}
I'm looking for an automatic or semi-automatic way to generate this
conversion function. They could use the C definitions or some
metalanguage to do this. Any hints?
- Alex
------------------------------
Date: Tue, 26 Oct 1999 23:59:42 GMT
From: figmo <figmo@my-deja.com>
Subject: Autosave incomming emails?
Message-Id: <7v5f9d$sek$1@nnrp1.deja.com>
I'm not a Perl programmer so I'm not sure if this is even where I
should be looking. Basically, what I need to do is have some kind of a
process running on my Linux server that will automatically accept email
for a given account name and save the email message to an HTML file.
This is to be an "auto-archiver" of email messages that can be text
searched and browsed from a web page.
Is this something that Perl can do? If not - where should I be looking
to accomplish this? If so - any pointers as to how to do it would be
appreciated.
-tia
-figmo
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 27 Oct 1999 00:43:21 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Autosave incomming emails?
Message-Id: <JUrR3.41322$E_1.2349994@typ11.nn.bcandid.com>
In article <7v5f9d$sek$1@nnrp1.deja.com>, figmo <figmo@my-deja.com> wrote:
>I'm not a Perl programmer so I'm not sure if this is even where I
>should be looking. Basically, what I need to do is have some kind of a
>process running on my Linux server that will automatically accept email
>for a given account name and save the email message to an HTML file.
Read the documentation for your mail server to see if it supports delivery to
a program. If it doesn't, throw it out and get a better one.
With sendmail you could use a pipe in .forward to feed incoming mail to a
program.
No perl content here, move along
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: Mon, 25 Oct 1999 17:38:08 GMT
From: "Craig Vincent" <webmaster@webdream.com>
Subject: Banner Rotation Theory
Message-Id: <4A0R3.461$Bx2.500@198.235.216.4>
I developed a banner roation script that currently does the following:
When user accesses HTML an <IMG SRC = "foo.pl"> is called up
This script then records users IP and the banner they were looking at.
The Image is linked with an <A HREF = "bar.pl">
This script when clicked on once again gets user's IP, searches database
for the IP and then based on the banner they were looking at redirects
them to the appropriate site.
This setup was the only method I could think of at the time but it is
very ineffecient.
1) AOL/Proxy users constantly change/share IPs causing incorrect redirects
2) The server usage is unacceptably high (creates a lot of server hits) and
the database consumes a lot of space.
Although SSI I feel would be the best alternative unfortunately this script
will be going
I was specifically requested not to use SSI in this project :(
Does anyone have any suggestions for a more effecient banner rotation
scheme?
I noticed in the mod_perl pages there was a module developed specifically
for this purpose (AdBanner)
however the module doesn't appear to be on CPAN and I cannot reach the
author.
Sincerely,
Craig Vincent
------------------------------
Date: Tue, 26 Oct 1999 22:55:30 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Banner Rotation Theory
Message-Id: <CjqR3.460$Ha7.17125@typhoon01.swbell.net>
In article <I8nR3.1618$LR3.281072@news.shore.net>,
Scratchie <AgitatorsBand@yahoo.com> wrote:
>Benjamin Franz <snowhare@long-lake.nihongo.org> wrote:
>:>Am I missing something? Is there some reason why he can't just run a cron
>:>job regularly to update the static HTML pages with new banners and links?
>
>: Because you have a race condition.
>
>: 1. User browses page with ad banner and is served banner-a
>: 2. Server rotates to banner-b
>: 3. User reads page
>: 3. User clicks on banner-a with fixed link to ad-link script
>: 4. ad-link script serves link to banner-b
>: 5. User goes 'Huh?'
>
>So you need to have all the information the user needs to click through on
>the original page. Make a static link like
>"/cgi-bin/jumpto.cgi?ad=sponsor1". Then it doesn't matter whether the ad
>on that page has been rotated before the user clicks. Your suggestion
>seems to imply that the ad-link script would look at the page it was
>called from to determine where the user wanted to click, which seems
>problematic at best.
And you are back to needing SSI/CGI, JavaScript, et al because you can't
rotate ads with a static link otherwise. That was rather the point. The
_web page_ can contain the information only if you are writing the HTML
at least partially dynamically to preserve the identity of the banner
ad being viewed. If you are forbidden from doing that, then you need
cookies, Java or JavaScript.
--
Benjamin Franz
------------------------------
Date: 25 Oct 1999 19:50:43 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Banner Rotation Theory
Message-Id: <7v2caj$hth$1@gellyfish.btinternet.com>
On Mon, 25 Oct 1999 17:38:08 GMT Craig Vincent wrote:
>
> Does anyone have any suggestions for a more effecient banner rotation
> scheme?
>
Any possible Perl content in this is largely irrelevant - I think that you
would be better off posting to comp.infosystems.www.authoring.cgi as they
will be prepared to discuss techniques that are applicable to any
implementation language.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 26 Oct 1999 19:19:04 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: Banner Rotation Theory
Message-Id: <I8nR3.1618$LR3.281072@news.shore.net>
Benjamin Franz <snowhare@long-lake.nihongo.org> wrote:
:>Am I missing something? Is there some reason why he can't just run a cron
:>job regularly to update the static HTML pages with new banners and links?
: Because you have a race condition.
: 1. User browses page with ad banner and is served banner-a
: 2. Server rotates to banner-b
: 3. User reads page
: 3. User clicks on banner-a with fixed link to ad-link script
: 4. ad-link script serves link to banner-b
: 5. User goes 'Huh?'
So you need to have all the information the user needs to click through on
the original page. Make a static link like
"/cgi-bin/jumpto.cgi?ad=sponsor1". Then it doesn't matter whether the ad
on that page has been rotated before the user clicks. Your suggestion
seems to imply that the ad-link script would look at the page it was
called from to determine where the user wanted to click, which seems
problematic at best.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 26 Oct 1999 16:17:12 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: Banner Rotation Theory
Message-Id: <cukR3.1583$LR3.273227@news.shore.net>
Benjamin Franz <snowhare@long-lake.nihongo.org> wrote:
: Then you're out of luck. Because either you use SSI/CGI/JavaScript to modify
: the HTML on the fly to give URLs customized to the banner or you use cookies.
: There aren't any other reliable alternatives.
Am I missing something? Is there some reason why he can't just run a cron
job regularly to update the static HTML pages with new banners and links?
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 26 Oct 1999 16:33:33 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Banner Rotation Theory
Message-Id: <xJkR3.20$Ha7.2774@typhoon01.swbell.net>
In article <cukR3.1583$LR3.273227@news.shore.net>,
Scratchie <AgitatorsBand@yahoo.com> wrote:
>Benjamin Franz <snowhare@long-lake.nihongo.org> wrote:
>: Then you're out of luck. Because either you use SSI/CGI/JavaScript to modify
>: the HTML on the fly to give URLs customized to the banner or you use cookies.
>: There aren't any other reliable alternatives.
>
>Am I missing something? Is there some reason why he can't just run a cron
>job regularly to update the static HTML pages with new banners and links?
Because you have a race condition.
1. User browses page with ad banner and is served banner-a
2. Server rotates to banner-b
3. User reads page
3. User clicks on banner-a with fixed link to ad-link script
4. ad-link script serves link to banner-b
5. User goes 'Huh?'
--
Benjamin Franz
------------------------------
Date: Tue, 26 Oct 1999 13:36:10 GMT
From: "Craig Vincent" <webmaster@webdream.com>
Subject: Re: Banner Rotation Theory
Message-Id: <e7iR3.327$c95.289@198.235.216.4>
> Use cookies.
I'd prefer not to as it is possible for the browser to be set to not accept
cookies (same reason why I don't want to use javascript).
Thank you for the suggestion though.
Sincerely,
Craig Vincent
------------------------------
Date: Tue, 26 Oct 1999 13:49:44 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Banner Rotation Theory
Message-Id: <YjiR3.1253$ET3.64684@typhoon01.swbell.net>
In article <e7iR3.327$c95.289@198.235.216.4>,
Craig Vincent <webmaster@webdream.com> wrote:
>
>> Use cookies.
>
>
>I'd prefer not to as it is possible for the browser to be set to not accept
>cookies (same reason why I don't want to use javascript).
Then you're out of luck. Because either you use SSI/CGI/JavaScript to modify
the HTML on the fly to give URLs customized to the banner or you use cookies.
There aren't any other reliable alternatives. You could use IFRAMEs, but they
aren't universally supported, either. The other alternative, Java, has a nasty
tendency to cause browsers to crash.
--
Benjamin Franz
------------------------------
Date: 25 Oct 1999 22:03:28 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Banner Rotation Theory
Message-Id: <slrn81a6f7.fji.abigail@alexandra.delanet.com>
Craig Vincent (webmaster@webdream.com) wrote on MMCCXLVI September
MCMXCIII in <URL:news:4A0R3.461$Bx2.500@198.235.216.4>:
!! I developed a banner roation script that currently does the following:
1) Banner ads are evil.
2) Your desing problems are there because you don't seem to understand
the working of the net. There are no Perl issues here.
Please take your stuff somewhere else.
biz.* for instance.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 25 Oct 1999 23:32:08 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Banner Rotation Theory
Message-Id: <s19q3omagbb95@corp.supernews.com>
Craig Vincent (webmaster@webdream.com) wrote:
: Does anyone have any suggestions for a more effecient banner rotation
: scheme?
(This is quite a bit off topic, but...)
Yes. Generate the page dynamically (on the server side), with the desired
image and href targets directly in the page text.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: Mon, 25 Oct 1999 19:16:59 -0400
From: "Nelson Nieves" <support@celebritybase.net>
Subject: Re: Banner Rotation Theory
Message-Id: <7v2och$1e3i@news1.newsguy.com>
Use cookies.
You can set cookies on each persons browser. A program called, adbanner.pl,
can set three cookies: 1st for banner number, 2nd to hold the banners html
(to redirect the user when he clicks on the banner), and a 3rd cookie can
hold the individual directory of the account to be credited the click and
impression.
I do this, each client has his own directory on my server.
Use another program (linkto.pl) to read the cookies when the user clicks on
the banner link. The info you will need is the banner number and the url.
The text file containing the banner graphics can be setup like this:
2
1,/graphics/sysco.gif,http://www.sysco.com
2,/graphics/beanies.gif,http://www/beanies.com
The first line contains the number of adds in the file. The subsequent lines
contain the ads number within the file, the graphics to be used, and the
address. These get passed to cookies before the banner is displayed. The
cookies will have to be permanent. Everytime the visitor shows up the next
banner is showed to that user and the cookie that gets the banner number is
incremented. You must make sure that your program sets the cookie back to 1
if the next number is larger than the number of ads in the file.
Just an idea.
I do have a system working much like this and it works.
Craig Vincent <webmaster@webdream.com> wrote in message
news:4A0R3.461$Bx2.500@198.235.216.4...
> I developed a banner roation script that currently does the following:
>
> When user accesses HTML an <IMG SRC = "foo.pl"> is called up
>
> This script then records users IP and the banner they were looking at.
>
> The Image is linked with an <A HREF = "bar.pl">
>
> This script when clicked on once again gets user's IP, searches database
> for the IP and then based on the banner they were looking at redirects
> them to the appropriate site.
>
> This setup was the only method I could think of at the time but it is
> very ineffecient.
>
> 1) AOL/Proxy users constantly change/share IPs causing incorrect
redirects
> 2) The server usage is unacceptably high (creates a lot of server hits)
and
> the database consumes a lot of space.
>
> Although SSI I feel would be the best alternative unfortunately this
script
> will be going
> I was specifically requested not to use SSI in this project :(
>
> Does anyone have any suggestions for a more effecient banner rotation
> scheme?
> I noticed in the mod_perl pages there was a module developed specifically
> for this purpose (AdBanner)
> however the module doesn't appear to be on CPAN and I cannot reach the
> author.
>
> Sincerely,
>
> Craig Vincent
>
>
------------------------------
Date: Mon, 25 Oct 1999 14:07:57 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Banner Rotation Theory
Message-Id: <Pine.GSO.4.10.9910251406040.29843-100000@user2.teleport.com>
On Mon, 25 Oct 1999, Craig Vincent wrote:
> Does anyone have any suggestions for a more effecient banner rotation
> scheme?
Use cron, or your system's equivalent. But this doesn't have anything to
do with perl, so if you have further questions, you should search for the
docs, FAQs, and newsgroups about the web, CGI programming, or your system.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 26 Oct 1999 07:06:09 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: Banner Rotation Theory
Message-Id: <spamfree-2610990706090001@d4.metropolis.net.au>
In article <4A0R3.461$Bx2.500@198.235.216.4>, "Craig Vincent"
<webmaster@webdream.com> wrote:
> I developed a banner roation script that currently does the following:
>
> When user accesses HTML an <IMG SRC = "foo.pl"> is called up
>
> This script then records users IP and the banner they were looking at.
>
> The Image is linked with an <A HREF = "bar.pl">
...
> Does anyone have any suggestions for a more effecient banner rotation
> scheme?
Use JavaScript.
Create one array with image URLs.
Create another array with link URL.
Randomly generate a number from 0..n.
Generate the appropriate HTML (image and corresponding link) inline using
document.write().
Direct further queries about this approach to comp.lang.javascript.
Henry.
------------------------------
Date: Wed, 27 Oct 1999 19:52:24 -0400
From: "TechGuy" <michael@cermak.com>
Subject: better link indexing program?
Message-Id: <yeMR3.238$03.26932@typ11a.deja.bcandid.com>
IndexFinger (www.indexfinger.com) or Links Manager
(www.gossamer-threads.com)? I really like the customization features of
IndexFinger. Anyone have any experience with either? Comments, complaints,
etc?
Thanks,
--
TechGuy
------------------------------
Date: 27 Oct 1999 12:07:27 GMT
From: QaJurria <qajurria@qajurria.cx>
Subject: Re: can a perl script do this?
Message-Id: <7v6ptv$jsv$1@enterprise.cistron.net>
Joe Zelwietro <deplib@citytel.net> wrote:
> I want a browser to have a home page, call it Bob's webpage. After people
> have surfed a few minutes (say 3 minutes) and left the machine I want the
> browser to revert back to Bob's page. Is this possible in Perl? All advice
> welcome.
Well, if you _don't_ want to write a browser in Perl, try using JavaScript
to accomplish this result.
Jurriaan
--
/ Perl, PHP, Lite, SQL, MySQL, mSQL; / Jurriaan Kamer |
/ HTML, DHTML, JavaScript, Webdesign; / aka. QaJurria |
| Holy: / Security Consultancy. / qajurria@qajurria.cx |
| perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
------------------------------
Date: Mon, 25 Oct 1999 13:24:59 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: can a perl script do this?
Message-Id: <Pine.GSO.4.10.9910251323260.29843-100000@user2.teleport.com>
On Sun, 24 Oct 1999, Joe Zelwietro wrote:
> I want a browser to have a home page, call it Bob's webpage. After
> people have surfed a few minutes (say 3 minutes) and left the machine
> I want the browser to revert back to Bob's page. Is this possible in
> Perl?
It sounds as if you want to write a browser in Perl. Yes, this is
possible. Start with LWP from CPAN. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 25 Oct 1999 16:36:24 GMT
From: Robert Bajan <bajan@cool.mb.ca>
Subject: Re: Can cgi pass uid/pwd for access to .htaccess protected files?
Message-Id: <381485AD.80E869CD@cool.mb.ca>
I apologize for posting to wrong newsgroup.
Answer can be found at news:comp.infosystems.www.authoring.cgi
Rob
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1174
**************************************