[16970] in Perl-Users-Digest
Perl-Users Digest, Issue: 4382 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 20 06:05:31 2000
Date: Wed, 20 Sep 2000 03:05:11 -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: <969444311-v9-i4382@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 20 Sep 2000 Volume: 9 Number: 4382
Today's topics:
Re: Ambiguous use of values <home.barbet@wanadoo.fr>
Re: Archive File Attribute on NT tanya_ellis@my-deja.com
Re: Archive File Attribute on NT <carvdawg@patriot.net>
CGI and Directories, web-page automation, maintaining s <ihra@dlc.fi>
Re: CGI and Directories, web-page automation, maintaini (Tony L. Svanstrom)
Re: CGI and Directories, web-page automation, maintaini <ihra@dlc.fi>
Re: CGI and Directories, web-page automation, maintaini (Tony L. Svanstrom)
Re: File Parsing, Skipping lines <godzilla@stomp.stomp.tokyo>
Re: Help, need to compair PC date with a date in a vari <mattking@techie.com>
Re: Here Document <bcaligari@my-deja.com>
I need help with arrays. esalmon@packet.net
Re: I need help with arrays. <wyzelli@yahoo.com>
Re: I need help with arrays. <lr@hpl.hp.com>
Re: I need help with arrays. esalmon@packet.net
Re: I need help with arrays. (Abigail)
Re: I need help with arrays. esalmon@packet.net
Re: I need help with arrays. (Abigail)
Re: I need help with arrays. esalmon@packet.net
IP Address <ales.romaniuk@zag.si>
Re: IP Address (Tony L. Svanstrom)
Re: IP Address <ales.romaniuk@zag.si>
Re: IP Address (Abigail)
Re: IP Address <ales.romaniuk@zag.si>
Re: IP Address <jeff@vpservices.com>
Re: IP Address <glynFOOdwr@FSCKdeleteEmeD.co.uk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 20 Sep 2000 11:18:21 +0100
From: "Alain BARBET" <home.barbet@wanadoo.fr>
Subject: Re: Ambiguous use of values
Message-Id: <8q9v2i$fe9$1@s1.read.news.oleane.net>
Hi,
> popup_menu(-name=>'game',
> -values=>['red','green','blue','chartreuse']),
> and I get this:
> # Ambiguous use of values => resolved to "values" =>.
> File 'StarMax HD:Desktop Folder:popup.cgi'; Line 13
values is a Perl keyword, so
put -'values'=>['red','green','blue','chartreuse']),
> # Can't find string terminator "'" anywhere before EOF.
> File 'StarMax HD:Desktop Folder:popup.cgi'; Line 14
I don't know, you forgot the last line ... certainly a ' open and not
close.
HTH,
--
Alain BARBET
------------------------------
Date: Wed, 20 Sep 2000 06:34:25 GMT
From: tanya_ellis@my-deja.com
Subject: Re: Archive File Attribute on NT
Message-Id: <8q9lpg$mrj$1@nnrp1.deja.com>
In article <MPG.1432a6b1b495b8e59897be@localhost>,
jason <elephant@squirrelgroup.com> wrote:
> tanya_ellis@my-deja.com <tanya_ellis@my-deja.com> wrote ..
> >I would like to delete a list of files on NT
> >which dont have the Archive File Attribute
> >checked. (If the file is unchecked I know it has
> >been backed up to tape and can now be deleted.)
> >I have looked around for a file test operator to
> >check the archive attribute but far so
> >unsuccessful.
> >
> >can anyone help?
>
> (assuming you're using the standard Perl port for Win32)
>
> go to your pretty HTML documentation provided by ActiveState .. scroll
> down the table of contents to the section containing the Win32 modules
> .. then take a guess which one of the Win32 modules might help you
find
> out about file attributes
>
> click on it and read the information on the right
>
> repeat process for any other questions before asking them here
>
> --
> jason -- elephant@squirrelgroup.com --
well by the sounds of it I must apologise for asking such a dumb
question. I was always lead to believe that there are no dumb
questions. I also believed that this site is a place to share knowledge
not only between experts but those trying to learn perl. By the looks
of it I am not only dumb but wrong!
But thank you jason for your "tip" - I had already found this. But
oblivious I need more help! May be if the html documentation had more
examples I would not have to correspond with the so called experts like
you on this site!
dumbo
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 20 Sep 2000 05:36:54 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: Archive File Attribute on NT
Message-Id: <39C88536.44B48A54@patriot.net>
> (assuming you're using the standard Perl port for Win32)
>
> go to your pretty HTML documentation provided by ActiveState .. scroll
> down the table of contents to the section containing the Win32 modules
> .. then take a guess which one of the Win32 modules might help you find
> out about file attributes
>
> click on it and read the information on the right
>
> repeat process for any other questions before asking them here
Wow, what a jerk. You had so many opportunities available to you here,
such
as ignoring the question, or responding directly via email.
Well, now we _all_ know how smart you are!
------------------------------
Date: Wed, 20 Sep 2000 06:43:53 GMT
From: Jussi Josefsson <ihra@dlc.fi>
Subject: CGI and Directories, web-page automation, maintaining state
Message-Id: <39C85CBB.BA9CE2FB@dlc.fi>
Hi,
I am currently rewriting my homepage-engine and I have encountered
couple of problems.
Idea of the homepage-engine is to compile my homepage from little
pieces, assembling text-articles to one page, along the pictures that
are related to current article. I use CGI.pm and Perl 5.00503 in
Apache/linux machine.
In the leftside bar, I show all the subdirectories (only one level deep)
under current directory.
So basically if no parameters are given, page runs my main.cgi -script
that finds basic directory and shows every .txt file like:
[main].txt
[main].jpg
[article1].txt
[article2].txt
[article2].png
etc.
Mainly because I hate those "web publishing systems" that are depending
on the machine that runs the program and they are not available when you
need them ;)
Problem is with my directory structure. I need to keep state of current
directory accessed. It is easy to "hardcode" them either with hidden
fields or with parameters send to cgi-script.
But I am running in the huge problems when there are for example 3
subdirectorylevels under main page. How to handle which directories are
related to which files, which directories are under which directory, how
to make navigation bar usable, how to make link to program itself to
access correct file in correct directory?
Currently I've used File::Find -module to find contents of the
directory, but if you supply parameter like "DIR=ihra", it won't find
correct directory.
Perhaps I should build sitemap with directory/files hash everytime
script is accessed? Only downfall is that my current pages contain about
100 pages, mostly long texts. Perhaps some clever mainloop would trigger
correct filefind depending whether we are looking for file or directory?
And some directories could contain 5 subdirectories, with lots of
pictures...
Has anybody faced same kind of problems or has some basic information
how to handle directories/files in smart way? Or could someone point me
to the module that has some ideas similar to mine?
Sorry if the problem description is confusing but so am I ;) And because
I have everything else working fine except basic structure of the
filesystemhandling, there are no code. I can adjust any suggestions to
my current script, as the script does only some regexpressions, file
opening and graphics handling. It just needs to know directories and
files and how to find/handle them in correct way.
Jussi "Ihra" Josefsson
$freetime =~ s/sports/coding/;
------------------------------
Date: Wed, 20 Sep 2000 09:37:55 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: CGI and Directories, web-page automation, maintaining state
Message-Id: <1eh93uj.1fabt8p16mu07lN%tony@svanstrom.com>
Jussi Josefsson <ihra@dlc.fi> wrote:
> Perhaps I should build sitemap with directory/files hash everytime script
> is accessed?
No need to do it every time; when you update the site you simply run
such a script once, and then you can "use" the data like Config.pm does.
Of course, running an update-script once is the basic suggestion, the
Config-part of the advice is simply because I find that a fun way of
doing it. :-)
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Wed, 20 Sep 2000 08:54:43 GMT
From: Jussi Josefsson <ihra@dlc.fi>
Subject: Re: CGI and Directories, web-page automation, maintaining state
Message-Id: <39C87B67.489BC212@dlc.fi>
"Tony L. Svanstrom" wrote:
> > Perhaps I should build sitemap with directory/files hash everytime
> > script is accessed?
> No need to do it every time; when you update the site you simply run
> such a script once, and then you can "use" the data like Config.pm > does.
This was my first option and keep it in my backpocket if I can't figure
something else. Only problem is that I am feature-fanatic and I'd like
to do whole program with one script and with zero administrating (yeah,
so I am actually lazy). And perhaps I am not the only one to update the
site... hmm..
> Of course, running an update-script once is the basic suggestion, the
> Config-part of the advice is simply because I find that a fun way of
> doing it. :-)
Well, same thing, I don't get money from this, so quick-and-dirty is
actually the last solution ;)
Jussi "Ihra" Josefsson
------------------------------
Date: Wed, 20 Sep 2000 11:40:38 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: CGI and Directories, web-page automation, maintaining state
Message-Id: <1eh99h8.671n6t13sm14fN%tony@svanstrom.com>
Jussi Josefsson <ihra@dlc.fi> wrote:
> "Tony L. Svanstrom" wrote:
> > > Perhaps I should build sitemap with directory/files hash everytime
> > > script is accessed?
> > No need to do it every time; when you update the site you simply run
> > such a script once, and then you can "use" the data like Config.pm > does.
>
> This was my first option and keep it in my backpocket if I can't figure
> something else. Only problem is that I am feature-fanatic and I'd like
> to do whole program with one script and with zero administrating (yeah,
> so I am actually lazy). And perhaps I am not the only one to update the
> site... hmm..
That's easy, all you have to do is to put it in the main script and then
use something like this to activate it:
http://your.domain.tld/script.pl?secretcode=fresh.copy.please
I got some of those in my own solution for taking care of
domains/websites. One of those "hidden" things is the "snooper" I use
every now and then to figure out what a webbrowser thinks of itself:
<URL:http://www.svanstrom.com/?theGuide-snooper>
:-)
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Tue, 19 Sep 2000 21:11:01 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: File Parsing, Skipping lines
Message-Id: <39C838D5.AD1937B9@stomp.stomp.tokyo>
Larry Rosler wrote:
>
> darkrabbit wrote:
> > J. Stone wrote:
(int(rand(snippage))
> > > If I know I need to move ahead a certain number of lines....
> > ... then I have an array I can use to hop to specific line numbers.
> > This might be slow if you are parseing a long file.
> Indeed it might. Slurping an entire file is to be avoided if possible.
Hmm... sointly you will cringe knowing I am responding.
Use of 7-11 Slurpie versus Wily Coyote, hmm..
Use of slurp versus while should be wisely decided and,
either should be used, or both, as appropriate for a
script. Slurp is faster and more efficient for opening
smaller files. As you know, use of while is better for
saving memory when dealing with larger files, although
you sacrifice some speed contrasting a sacrifice of
some memory for a slurp loop construct.
Slurp is safer for dealing with sensitive data bases
by being able to open, copy and close quickly, then
do whatever. Same is true for open, read, modify,
write and close. Data in its entirety is stashed,
hopefully safely, within an array. You can get in
and out of your data base quicker.
While is not as safe when reading, modifying and
writing, one line at a time. A file is held open
longer than with slurp, exposing this file to more
risk, albeit usually a small risk. Writing one line
at a time, has some inherent risk, mostly a chance
of a bad read on a line, another process writing
to your data base if not file locked and the such.
Risks with while, however, are usually minimal.
I am not sure at what kilobyte size a break even
point is found between slurp and while. Lately I've
been playing with a one-hundred-eighty kilobyte file,
slurping for one test, a while for another test.
So far, I cannot detect any major speed difference.
Nonetheless, I am using a while loop to save memory
for this script and for speed under some conditions,
as oxymoronic as that is with use of a while loop.
Although a small script at fifty kilobytes and
just over one-thousand lines of code, it performs
extremely complex tasks at times, and other times,
almost a straight through shot with little activity.
So, my observations, I am sure, are somewhat skewed
as to speed with random complexiety in processing.
Nevertheless, my personal final analysis is use of
slurp or use of while, is a decision which should be
based upon script needs, file size and a balance between
speed and memory. Slurp and While, each is important,
each should be weighed objectively for value and, one
or the other should not discarded simply based upon
Cargo Cult promulgation.
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: Wed, 20 Sep 2000 11:06:12 +0200
From: "Matt King" <mattking@techie.com>
Subject: Re: Help, need to compair PC date with a date in a variable.
Message-Id: <8q9unk$1apq$1@news2atm.raleigh.ibm.com>
Thanks! The first script worked like a charm, however 788 lines into the
processing (4000+ lines need to be processed), Perl aborts with the
following error:
Month -1 out of range 0..11
And the line with the error is:
my $elapsed = time - timelocal($sec, $min, $hour, $mday, $mon-1, $year);
The date on that line is: 10.09.00 12:44:33
Also it doesn't apear that the addition is not not correct. For example, on
line 787 the date is 03.03.00 15:20:35, and the script reports that the
event happened 200.769699074074 days ago.... The previous line has the same
strange day count. That one has 05.04.00 08:40:57 with the message the the
even happened 168.0888888888889 days ago..... and infact all lines have this
strange day counting......
Can I borrow some more of your time for this?
Matt
------------------------------
Date: Wed, 20 Sep 2000 04:06:53 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Here Document
Message-Id: <8q9d4j$dmc$1@nnrp1.deja.com>
In article <87em2gdqhu.fsf@limey.hpcc.uh.edu>,
Tony Curtis <tony_curtis32@yahoo.com> wrote:
> >> On Tue, 19 Sep 2000 21:06:42 GMT,
> >> Brendon Caligari <bcaligari@my-deja.com> said:
>
> > I posted a question a few days ago regarding file handle
> > best practices. I was recommended (5.6+) using a scalar
> > value as file handle as follows
>
> > open(my $x, ">xxx"); print($x "hello world"); close($x);
>
> Lose the parentheses, they are somewhat obfuscative...
>
> my $fh;
>
> open $fh, '> OUTPUT' or die ...;
>
> print $fh <<_EOT_;
Tks...my problem seemed to be a typo :)
The parentheses may be unperlish, but I love them.
Functions are always functions, and since I use VI for
all editing, it's so convenient to match/manipulate
in between parenthesis.
At time perl syntax is 'upWalling'...
(note white space)
print $fh <<'_EOT_';
works
print $fh << '_EOT_';
fails
print $fh<<'_EOT_';
fails
on the other hand
print << '_EOT_';
and
print( << '_EOT_');
work!!!!!
Brendon
++++
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 20 Sep 2000 02:26:37 -0400
From: esalmon@packet.net
Subject: I need help with arrays.
Message-Id: <39C8588B.43EB@packet.net>
How would I find and delete duplicates from an array.
if: @elements - has 200 elements and some are duplicates, how would I
write a routine to find and remove duplicates?
Can any one help. Email to: contact@info-wiz.com
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Wed, 20 Sep 2000 16:14:47 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: I need help with arrays.
Message-Id: <80Zx5.37$Ad2.4490@vic.nntp.telstra.net>
<esalmon@packet.net> wrote in message news:39C8588B.43EB@packet.net...
> How would I find and delete duplicates from an array.
>
> if: @elements - has 200 elements and some are duplicates, how would I
> write a routine to find and remove duplicates?
http://www.perl.com and look for FAQ
> Can any one help. Email to: contact@info-wiz.com
No
--
Wyzelli
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: Wed, 20 Sep 2000 00:00:16 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: I need help with arrays.
Message-Id: <MPG.1432005616d3ea6a98ad99@nntp.hpl.hp.com>
In article <39C8588B.43EB@packet.net>, esalmon@packet.net says...
> How would I find and delete duplicates from an array.
>
> if: @elements - has 200 elements and some are duplicates, how would I
> write a routine to find and remove duplicates?
>
> Can any one help. Email to: contact@info-wiz.com
The voluminous Perl FAQ can help.
perlfaq4: "How can I remove duplicate elements from a list or
array?"
As for email, you would have a better chance were that your Reply-To
address.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 20 Sep 2000 03:00:19 -0400
From: esalmon@packet.net
Subject: Re: I need help with arrays.
Message-Id: <39C86083.41B6@packet.net>
Larry Rosler wrote:
>
> In article <39C8588B.43EB@packet.net>, esalmon@packet.net says...
> > How would I find and delete duplicates from an array.
> >
> > if: @elements - has 200 elements and some are duplicates, how would I
> > write a routine to find and remove duplicates?
> >
> > Can any one help. Email to: contact@info-wiz.com
>
> The voluminous Perl FAQ can help.
>
> perlfaq4: "How can I remove duplicate elements from a list or
> array?"
>
> As for email, you would have a better chance were that your Reply-To
> address.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
I have many email addresses: contact@info-wiz.com, esalmon@packet.net,
esalmon@studio301.com, etc. What does this matter?
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: 20 Sep 2000 07:16:51 GMT
From: abigail@foad.org (Abigail)
Subject: Re: I need help with arrays.
Message-Id: <slrn8sgp0r.5fq.abigail@alexandra.foad.org>
esalmon@packet.net (esalmon@packet.net) wrote on MMDLXXVII September
MCMXCIII in <URL:news:39C8588B.43EB@packet.net>:
// How would I find and delete duplicates from an array.
//
// if: @elements - has 200 elements and some are duplicates, how would I
// write a routine to find and remove duplicates?
Djee. You'd think that someone else might have had the same problem,
and it might even have been answered frequently.
Anyway, here's a solution.
do {my ($x, $y) = int rand @array;
do { $y = int rand @array} until $x <=> $y;
$array [$y] <=> $array [$x] or
splice @array => rand > 0.5 ? $x : $y => 1
} until do {
my $magic = 7;
for (my ($x, $y) = (0, 0); $x < $#array; $y = ++ $x) {
$magic *= $array [$x] <=> $array [++ $y] until $y == $#array;
}
$magic;
};
// Email to: contact@info-wiz.com
No.
Abigail
--
perl -wlpe '}{$_=$.' file # Count the number of lines.
# A woodpecker nests.
# The King near the Shaolin
# temple. A cat prowls.
------------------------------
Date: Wed, 20 Sep 2000 03:12:12 -0400
From: esalmon@packet.net
Subject: Re: I need help with arrays.
Message-Id: <39C8634C.3E5@packet.net>
Larry Rosler wrote:
>
> In article <39C8588B.43EB@packet.net>, esalmon@packet.net says...
> > How would I find and delete duplicates from an array.
> >
> > if: @elements - has 200 elements and some are duplicates, how would I
> > write a routine to find and remove duplicates?
> >
> > Can any one help. Email to: contact@info-wiz.com
>
> The voluminous Perl FAQ can help.
>
> perlfaq4: "How can I remove duplicate elements from a list or
> array?"
>
> As for email, you would have a better chance were that your Reply-To
> address.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
The reference you refered to in the perl man pages in perlfaq4 does not
exist in my copy, however I found the oposite to find the unique
elements and that will work great. Even though your reference I couldent
find you did point me into the right place. Thank you.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: 20 Sep 2000 07:40:54 GMT
From: abigail@foad.org (Abigail)
Subject: Re: I need help with arrays.
Message-Id: <slrn8sgqe0.5fq.abigail@alexandra.foad.org>
esalmon@packet.net (esalmon@packet.net) wrote on MMDLXXVII September
MCMXCIII in <URL:news:39C8634C.3E5@packet.net>:
##
## The reference you refered to in the perl man pages in perlfaq4 does not
## exist in my copy,
Then your Perl is broken.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
------------------------------
Date: Wed, 20 Sep 2000 03:43:45 -0400
From: esalmon@packet.net
Subject: Re: I need help with arrays.
Message-Id: <39C86AB1.2B55@packet.net>
Abigail wrote:
>
> esalmon@packet.net (esalmon@packet.net) wrote on MMDLXXVII September
> MCMXCIII in <URL:news:39C8634C.3E5@packet.net>:
> ##
> ## The reference you refered to in the perl man pages in perlfaq4 does not
> ## exist in my copy,
>
> Then your Perl is broken.
>
> Abigail
> --
> sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
> f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
> f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
Sounds like you are broken. :)
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Wed, 20 Sep 2000 06:47:42 +0200
From: Marvin <ales.romaniuk@zag.si>
Subject: IP Address
Message-Id: <MPG.14325fd11004d18698968a@news.siol.net>
Hello !
I would like to make a CGI form and that every person can submit only
once. Is there any function that returns IP of remote host properly
(remote_addr() returns always "").
Thanks
------------------------------
Date: Wed, 20 Sep 2000 08:17:43 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: IP Address
Message-Id: <1eh90a4.kczqm91utorhoN%tony@svanstrom.com>
Marvin <ales.romaniuk@zag.si> wrote:
> I would like to make a CGI form and that every person can submit only
> once. Is there any function that returns IP of remote host properly
> (remote_addr() returns always "").
1. I submit
2. I disconnect
3. I connect
4. I submit again
or:
1. I try to submit but can't because someone else used that IPaddress
before.
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Wed, 20 Sep 2000 08:27:53 +0200
From: Marvin <ales.romaniuk@zag.si>
Subject: Re: IP Address
Message-Id: <MPG.14327756f0a68dae98968c@news.siol.net>
In article <1eh90a4.kczqm91utorhoN%tony@svanstrom.com>,
tony@svanstrom.com says...
> Marvin <ales.romaniuk@zag.si> wrote:
>
> > I would like to make a CGI form and that every person can submit only
> > once. Is there any function that returns IP of remote host properly
> > (remote_addr() returns always "").
>
> 1. I submit
> 2. I disconnect
> 3. I connect
> 4. I submit again
>
> or:
> 1. I try to submit but can't because someone else used that IPaddress
> before.
>
>
> /Tony
>
Actually I would like to make an oppinion poll and there you can have
only one vote. So I need to check into database if you have already
voted.
------------------------------
Date: 20 Sep 2000 06:49:11 GMT
From: abigail@foad.org (Abigail)
Subject: Re: IP Address
Message-Id: <slrn8sgnd0.5fq.abigail@alexandra.foad.org>
Marvin (ales.romaniuk@zag.si) wrote on MMDLXXVII September MCMXCIII in
<URL:news:MPG.14327756f0a68dae98968c@news.siol.net>:
||
|| Actually I would like to make an oppinion poll and there you can have
|| only one vote. So I need to check into database if you have already
|| voted.
Can't be done. There's no "proof-of-identity" on the Internet.
Some people have an entire class-B network available (65K addresses),
but there are also millions of people hiding behind a handful of
proxies.
And then there are the people sharing a computer. Not the entire world
consists of geeks living alone with a Win32 box, you know. There are
hundreds of thousands of people behind a firewall, sharing the world
visible IP address with hundreds or thousands of co-workers.
Please get a clue on how the net and the web works. After that, come back
to Usenet, but know these questions are off-topic in this group.
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
------------------------------
Date: Wed, 20 Sep 2000 10:44:12 +0200
From: Marvin <ales.romaniuk@zag.si>
Subject: Re: IP Address
Message-Id: <MPG.143289a944d77d7798968d@news.siol.net>
In article <slrn8sgnd0.5fq.abigail@alexandra.foad.org>, abigail@foad.org
says...
> Marvin (ales.romaniuk@zag.si) wrote on MMDLXXVII September MCMXCIII in
> <URL:news:MPG.14327756f0a68dae98968c@news.siol.net>:
> ||
> || Actually I would like to make an oppinion poll and there you can have
> || only one vote. So I need to check into database if you have already
> || voted.
>
>
> Can't be done. There's no "proof-of-identity" on the Internet.
> Some people have an entire class-B network available (65K addresses),
> but there are also millions of people hiding behind a handful of
> proxies.
>
> And then there are the people sharing a computer. Not the entire world
> consists of geeks living alone with a Win32 box, you know. There are
> hundreds of thousands of people behind a firewall, sharing the world
> visible IP address with hundreds or thousands of co-workers.
>
>
> Please get a clue on how the net and the web works. After that, come back
> to Usenet, but know these questions are off-topic in this group.
>
>
> Abigail
>
Hi Again !
As matters of my problem, the people who will access the script will be
all in Intranet using single network scheme with 255 hosts. Since I
don't want to use entering login name and password, I just want to check
their IP (like javascript knows to do). So I am asking again, if its
possible to get remote IP number (Apache Server sees that number,cause
it is logged) into Perl.
Regards
------------------------------
Date: Wed, 20 Sep 2000 01:08:23 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: IP Address
Message-Id: <39C87077.AC4160E0@vpservices.com>
Marvin wrote:
>
> Actually I would like to make an oppinion poll and there you can have
> only one vote. So I need to check into database if you have already
> voted.
What happens if 20 people in a classroom all vote once using the same
computer that has only one IP? What happens if one person goes to 20
computers that have 20 different IPs and votes 20 times? What happens
if 20 people use AOL to vote and the AOL proxy server assigns them all
the same IP? What happens if one person uses AOL to vote 20 times and
the AOL proxy server assigns them a different IP each time? etc. etc.
But none of that has to do with Perl, you would face the same problems
no matter what language you were using.
--
Jeff
------------------------------
Date: Wed, 20 Sep 2000 10:14:48 +0100
From: "Glyndwr" <glynFOOdwr@FSCKdeleteEmeD.co.uk>
Subject: Re: IP Address
Message-Id: <2h%x5.351$Rk1.4674@news2-win.server.ntlworld.com>
Marvin <ales.romaniuk@zag.si> wrote in message
news:MPG.143289a944d77d7798968d@news.siol.net...
> As matters of my problem, the people who will access the script will be
> all in Intranet using single network scheme with 255 hosts. Since I
> don't want to use entering login name and password, I just want to check
> their IP (like javascript knows to do). So I am asking again, if its
> possible to get remote IP number (Apache Server sees that number,cause
> it is logged) into Perl.
%ENV contains a bunch of useful values passed by Apache into any Perl CGI
script. $ENV{REMOTE_ADDR} has the full IP address of the client.
--
print reverse split ""=>q/,rekcah lreP rehtona tsuJ/;
-=G=-
web: http://www.fscked.co.uk icq: 66545079
------------------------------
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 4382
**************************************