[16436] in Perl-Users-Digest
Perl-Users Digest, Issue: 3848 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 30 14:05:40 2000
Date: Sun, 30 Jul 2000 11:05:18 -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: <964980317-v9-i3848@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 30 Jul 2000 Volume: 9 Number: 3848
Today's topics:
ANNOUNCE: Win32::API::Prototype <rothd@roth.net>
Re: can't use global $^W in "my"... <nobody@exnet.iastate.edu>
Re: Converting strings to numbers for comparison (Colin Keith)
Re: Converting strings to numbers for comparison <lr@hpl.hp.com>
Re: Crosswinds.net. is the worst 255 (Brian)
Database Question <unigni@zaynar.demon.co.uk>
Re: Database Question neil@pacifier.com
Re: difference between require $file and require Module (M.J.T. Guy)
Downloading Perl <fedya@banet.net>
Re: Downloading Perl <bwalton@rochester.rr.com>
Re: hash questions jliu34740@my-deja.com
Re: hash questions (Colin Keith)
Re: help w/ regular expression (M.J.T. Guy)
Re: I Am An Idiot <dave@dave.org.uk>
Re: I Am An Idiot <flavell@mail.cern.ch>
Re: I Am An Idiot (Colin Keith)
Re: I Am An Idiot <bkennedy99@home.com>
Re: I Am An Idiot <godzilla@stomp.stomp.tokyo>
IP spoofing for search engine <nospam.tom@hotmail.com>
Re: IP spoofing for search engine (Colin Keith)
Re: newb Q, Our perl guy left!! (Colin Keith)
Re: NEWB Q: CGI and DATABASSE eric_lyon@my-deja.com
No more typeglobs in Perl 6 (was: Advanced Perl Program <sb@muccpu1.muc.sdm.de>
Re: No more typeglobs in Perl 6 (was: Advanced Perl Pro (Andrew J. Perrin)
Re: Online RPG using SQL? <templar318@earthlink.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 29 Jul 2000 21:53:28 -0700
From: "Dave Roth" <rothd@roth.net>
Subject: ANNOUNCE: Win32::API::Prototype
Message-Id: <so8hkbl5o0b170@corp.supernews.com>
ANNOUNCEMENT OF NEW PERL MODULE
===============================
Win32::API::Prototype
---------------------
For all of you folks out there using Win32::API but hate having to manage
the details of creating the API object and translating data types into
P,N,I,V values read on...
Announcing the Win32::API::Prototype module. The module allows a script to
access a function from a resource (exe, dll, etc) by simply specifying a C
function prototype.
For example if you wanted to call the GetCurrentDirectory() function from
the Kernel32.dll library you could use this code:
use Win32::API::Prototype;
ApiLink( 'kernel32.dll', 'DWORD GetCurrentDirectory( DWORD nBufferLength,
LPTSTR lpBuffer )' ) || die;
$nBufferLength = 256;
$lpBuffer = NewString( $nBufferLength );
$Result = GetCurrentDirectory( $nBufferLength, $lpBuffer );
print "The current directory is: " . CleanString( $lpBuffer ) . "\n";
Notice that line 2 specifies the actual function prototype. The other
groovy
part is that line 5 calls the GetCurrentDirectory() as if it were a valid
Perl subroutine.
Currently the module can be downloaded using PPM:
ppm install
win32-api-prototype --install=http://www.roth.net/perl/packages/
Alternatively you can download the zip file:
ftp://ftp.roth.net/pub/ntperl/prototype/20000613/Prototype.zip
Cheers,
dave
--
===============================================================
Dave Roth ...glittering prizes and
Roth Consulting endless compromises, shatter
rothd@roth.net the illusion of integrity
http://www.roth.net
Win32, Perl, C++, ODBC, Training
Our latest Perl book is now available:
"Win32 Perl Programming: The Standard Extensions"
------------------------------
Date: Sun, 30 Jul 2000 11:32:12 -0500
From: "Darin Dugan" <nobody@exnet.iastate.edu>
Subject: Re: can't use global $^W in "my"...
Message-Id: <ELYg5.132$HC4.103578@news.uswest.net>
Gavin -
If you really aren't using $^W anywhere, how about:
perl -p -i.bak -e 's/^W//g' /home/gavin/codebase/v1/scripts/lucia2
(^W is really ctl-V ctl-W)
Or simply delete the line 1 and re-enter it?
Cheers
--
Darin Dugan
dddugan(at)iastate(dot)edu
"eaglewing" <eaglewing@zensearch.com> wrote in message
news:8lshu6$56vab$1@ID-41717.news.cis.dfn.de...
: If someone could help me with this before I am unable to resist putting my
: fist through my screen I'd be very much obliged.
:<snip>:
: [Thu Jul 27 22:13:06 2000] [error] Can't use global $^W in "my" at
: /home/gavin/codebase/v1/scripts/lucia2 line 1
:<snip>:
: thanks
: -gavin
------------------------------
Date: Sun, 30 Jul 2000 11:45:04 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: Converting strings to numbers for comparison
Message-Id: <4zUg5.25$DT4.1979088@nnrp2.clara.net>
In article <8ltrgh$pg1$1@nnrp1.deja.com>, paul5544@my-deja.com wrote:
Rather than repeating "wot is writ" (and most likely getting it wrong) have
a look through the perlfaq's for:
=head2 How do I determine whether a scalar is a number/whole/integer/float?
Then when you're sure its a number you can just use it in numerical
computations.
Incidently in playing, I just noticed that if you add 0 to a scalar, it will
strip off the non-numeric part. So:
$_ = "34.43klffds";
$_ += 0;
print;
Gives: 34.43
Cute.
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 30 Jul 2000 09:44:50 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Converting strings to numbers for comparison
Message-Id: <MPG.13edfb5b524f504298ac0e@nntp.hpl.hp.com>
In article <4zUg5.25$DT4.1979088@nnrp2.clara.net>, ckeith@clara.net
says...
...
> Incidently in playing, I just noticed that if you add 0 to a scalar, it will
> strip off the non-numeric part. So:
> $_ = "34.43klffds";
> $_ += 0;
>
> print;
>
> Gives: 34.43
>
> Cute.
I wouldn't use that trick unless warnings were disabled locally.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 30 Jul 2000 13:48:57 GMT
From: pontz@channel1.com (Brian)
Subject: Re: Crosswinds.net. is the worst 255
Message-Id: <398430d5.150473465@news.ne.mediaone.net>
>crosswinds.net just up and DELETED IT without even so much as a
>warning. now all my hard work is gone.
Kinda off topic here. I hope you had a local backup. If not then they
should have a tape backup.
Brian
------------------------------
Date: Sun, 30 Jul 2000 17:23:55 +0100
From: Unigni <unigni@zaynar.demon.co.uk>
Subject: Database Question
Message-Id: <o3jk3AAbaFh5EwDI@zaynar.demon.co.uk>
I'm wanting a database which I can use with Perl (running on a Unix web
server). I only need to be able to access records using their key (no
complicated searching things), but want to be able to lock specific
records and write to them while I'm also reading/writing other records.
Could anybody suggest a good database to use?
Any help will be greatly appreciated!
--
Philip Taylor
philip @ zaynar . demon . co . uk
http://hangman.games.ultrastore.com - Hangman Online!
------------------------------
Date: 30 Jul 2000 09:34:02 PST
From: neil@pacifier.com
Subject: Re: Database Question
Message-Id: <398458fa_1@news.pacifier.com>
Unigni <unigni@zaynar.demon.co.uk> wrote:
> I'm wanting a database which I can use with Perl (running on a Unix web
> server). I only need to be able to access records using their key (no
> complicated searching things), but want to be able to lock specific
> records and write to them while I'm also reading/writing other records.
> Could anybody suggest a good database to use?
> Any help will be greatly appreciated!
Mysql might be what you are looking for. Take a look at www.mysql.com
--
Neil
------------------------------
Date: 30 Jul 2000 14:44:49 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: difference between require $file and require Module
Message-Id: <8m1f11$bn7$1@pegasus.csx.cam.ac.uk>
<astewart@spawar.navy.mil> wrote:
>Quite some time ago Tom C. posted an explanation of the differences
>between do, require and use,
It's part of the FAQ actually.
> which said, in part:
>
>3) require Module is like require "Module.pm", except the former:
> 3.1: translates each "::" into your system's directory separator.
> 3.2: primes the parser to disambiguate class Module as an indirect
>object.
>
>Could Tom or someone elaborate on what 3.2 means?
An expression like
name1 name2 $arg, $arg2;
is ambiguous. Is it a Class method call?
name2->name1($arg, $arg2)
Or is it two nested subroutine calls?
name1(name2($arg, $arg2)
This is where Perl's smoke and mirrors come in: Perl uses whether
name2 has been seen as a name of a module as one of the factors in
choosing which interpretation to follow.
Mike Guy
------------------------------
Date: Sun, 30 Jul 2000 12:36:21 -0400
From: Ted <fedya@banet.net>
Subject: Downloading Perl
Message-Id: <39845985.4A7839A0@banet.net>
Is there anywhere other than Activestate where one can do this? They've
been down since Friday night. I'm looking for the ready-to go version, not
the source code that you have to compile yourself (which I was able to find
on perl.com). I've tried at least half a dozen times, and keep getting the
same error message. (BTW: If it makes a difference, I'm simply following
the links from the www.activestate.com webpage)
Thanks in advance!
--Ted I have always challenged the "psychoses." Why don't
fedya@banet.net you have a right to say you are Jesus? And why isn't
the proper response to that congratulations?"
Thomas Szasz, "Reason" Magazine, July 2000
------------------------------
Date: Sun, 30 Jul 2000 16:55:42 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Downloading Perl
Message-Id: <39845E49.54B77D43@rochester.rr.com>
Ted wrote:
>
> Is there anywhere other than Activestate where one can do this? They've
> been down since Friday night. I'm looking for the ready-to go version, not
> the source code that you have to compile yourself (which I was able to find
> on perl.com). I've tried at least half a dozen times, and keep getting the
> same error message. (BTW: If it makes a difference, I'm simply following
> the links from the www.activestate.com webpage)
>
> Thanks in advance!
>
> --Ted I have always challenged the "psychoses." Why don't
> fedya@banet.net you have a right to say you are Jesus? And why isn't
> the proper response to that congratulations?"
> Thomas Szasz, "Reason" Magazine, July 2000
There must be something else wrong, because I accessed ActiveState a
bunch yesterday. What exactly is it you think is down?
--
Bob Walton
------------------------------
Date: Sun, 30 Jul 2000 16:00:39 GMT
From: jliu34740@my-deja.com
Subject: Re: hash questions
Message-Id: <8m1jf6$74n$1@nnrp1.deja.com>
Uri, thanks for the tip.
Well, what I did in the beginning of the program is prompt user to
enter a list of id, then prompt users to enter its corresponding
values. That's what I mean by getting key/value pair through <STDIN>.
My question is how I can refer the key/value in my while loop, so that
I can reassign the new values to its key.
Thanks,
In article <x7punw4fbo.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
> >>>>> "j" == jliu34740 <jliu34740@my-deja.com> writes:
>
> j> while ( ($id, $wage) = each%List)
> j> {
> j> if ($wage >5)
> j> {
> j> $wage = $wage *2;
> j> $List{id}=$wage;
> ^^
>
> that should be $id.
>
> and combine those 2 lines as:
>
> $List{$id} *= 2 ;
>
> j> Let's assume that I have an associative array, the key and value
> j> are assigned through <STDIN>. How do I assign a new value to the
> j> key?
>
> thay are called hashes like you say in the subject.
>
> and your question here is not clear? assigning through <STDIN> make no
> sense. <STDIN> reads a line of text (normally). you have to process it
> in some way to get a key/value pair.
>
> and to assign to a hash just do what you did above:
>
> $List{ $key } = $value ;
>
> and use lower case names for perl variabled.
>
> and put a space after each, makes it much more readable.
>
> uri
>
> --
> Uri Guttman --------- uri@sysarch.com ----------
http://www.sysarch.com
> SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX
Consulting
> The Perl Books Page ----------- http://www.sysarch.com/cgi-
bin/perl_books
> The Best Search Engine on the Net ----------
http://www.northernlight.com
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 30 Jul 2000 16:16:35 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: hash questions
Message-Id: <DxYg5.32$DT4.2004962@nnrp2.clara.net>
In article <8m1jf6$74n$1@nnrp1.deja.com>, jliu34740@my-deja.com wrote:
>Uri, thanks for the tip.
>
>Well, what I did in the beginning of the program is prompt user to
>enter a list of id, then prompt users to enter its corresponding
>values. That's what I mean by getting key/value pair through <STDIN>.
>My question is how I can refer the key/value in my while loop, so that
>I can reassign the new values to its key.
Well if you do something like:
print "Enter id > *\b";
$id = <STDIN>;
print "Enter otherthing > *\b";
$val = <STDIN>;
Then there you are, they're in $id and $other (though please, validate them
before use...)
In which case, as indicated, you can set the value of $id to $val with:
$List{$id} = $val;
(I don't see where the loop comes in, but the question's been snipped, so)
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: 30 Jul 2000 14:29:49 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: help w/ regular expression
Message-Id: <8m1e4t$b0v$1@pegasus.csx.cam.ac.uk>
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <7tkqns81juhiqj1908qb5o9og0donogs4o@4ax.com> on Tue, 25 Jul
>2000 08:46:58 GMT, Bart Lateur <bart.lateur@skynet.be> says...
>> Larry Rosler wrote:
>> Can't modify bitwise xor (^) in transliteration (tr///) at test.pl line
>> 3, near "tr/\0//;"
>> Execution of test.pl aborted due to compilation errors.
>>
>> See? And this on Perl 5.6.
>
>This seems like a botched patch, because there are varying degrees of
>lvalue-ness being discovered. If the operand is simply "$_[0]" (with
>the quotes), the diagnostic says Can't modify string ...
I think the issue is syntax vs semantics, i.e. compile time vs run time.
The "readonly value" check happen at run time (as it has to), and is
only done in the appropriate cases of tr///. But the "Can't modify"
error above is a syntactic check - that the lhs is something which
is syntactically not valid on the lhs of an assignment.
Hmmm.. should be easy to fix.. (tap tap tap) Yep.
See bug report [ID 20000730.002] for a patch.
Mike Guy
------------------------------
Date: Sun, 30 Jul 2000 13:06:41 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: I Am An Idiot
Message-Id: <7g68osgmjn7io66cm3ref5j3dpdj3b5psq@4ax.com>
On Sat, 29 Jul 2000 17:45:03 GMT, andrew-johnson@home.com (Andrew
Johnson) wrote:
>In article <jq26os8ljbfcf1cgehpdasgleak6dlbpq5@4ax.com>,
> Dave Cross <dave@dave.org.uk> wrote:
>
>[snip]
>
>! I am, of course, a lying misogynistic script-kiddie who wouldn't know
>! piece of decent Perl code if it jumped up and down in front of me
>! waving a sign saying "Look! I'm a well-written piece of Perl code".
>
>It's true -- I once bought a piece of decent Perl code, from a
>reputable dealer, 'cause like, I couldn't write one, and I gave it
>that very sign, a plane ticket to England and some pocket money, and
>I told it to find Dave and jump up and down and wave the sign and to
>send word back if Dave ever figured out what it was. Well, I never
>heard from that code again so obviously Dave doesn't have a clue. My
>friends suspect that it was a far cleverer piece of code than I'd
>imagined and that it traded in its ticket and is now sipping umbrella
>drinks on a beach in Tahiti, but I don't think so ... I think it's
>jumping up and down in front of Dave right now ...
Is that what it is? Wait, I'll see if I can tie it down long enough to
copy it into the book!
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: Sun, 30 Jul 2000 15:38:08 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: I Am An Idiot
Message-Id: <Pine.GHP.4.21.0007301537240.28118-100000@hpplus03.cern.ch>
On Sat, 29 Jul 2000, Andrew Johnson wrote:
> It's true -- I once bought a piece of decent Perl code, from a
> reputable dealer, 'cause like, I couldn't write one, and I gave it
> that very sign, a plane ticket to England and some pocket money, and
> I told it to find Dave and jump up and down and wave the sign and to
> send word back if Dave ever figured out what it was. Well, I never
> heard from that code again
It was probably pining for the fjords...
------------------------------
Date: Sun, 30 Jul 2000 16:22:47 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: I Am An Idiot
Message-Id: <rDYg5.33$DT4.2006692@nnrp2.clara.net>
In article <Pine.GHP.4.21.0007301537240.28118-100000@hpplus03.cern.ch>, "Alan J. Flavell" <flavell@mail.cern.ch> wrote:
>On Sat, 29 Jul 2000, Andrew Johnson wrote:
>> that very sign, a plane ticket to England and some pocket money, and
>> I told it to find Dave and jump up and down and wave the sign and to
>> send word back if Dave ever figured out what it was. Well, I never
>> heard from that code again
>
>It was probably pining for the fjords...
Last time I looked we didn't have any fjords. Try Norway:)
Mind you, I haven't seen any snippets of perl code running about waving
placards screaming "I'm a decent script, run me baby, run me!" either :)
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 30 Jul 2000 16:24:25 GMT
From: "Ben Kennedy" <bkennedy99@home.com>
Subject: Re: I Am An Idiot
Message-Id: <ZEYg5.73099$A%3.984100@news1.rdc2.pa.home.com>
> This statement is in direct contradiction of your
> previous statement, paraphrased, "... _always_ use die."
> However, your statement shows a bit more wisdom through
> implication use of die may not always be the best choice.
You are most likely misinterpreting what he said originally - he probably
meant to say _always_ pay attention to the return value of open().
> Just as I thought; dogmatic || die.
Actually "or die" is better since its lower precedence
> Point is, I write programs which compensate for errors,
> continue to successfully run, where you boys would
> give up and kill your program. Suppose this is a marked
> difference between real women and, real men; we women
> don't surrender easily, if ever.
>
>
> open (POKERLOG, "+<$poker_log");
> $read_poker = <POKERLOG>;
> close (POKERLOG);
>
> if (!($read_poker))
> {
> open (POKERLOG2, ">$poker_log");
> print POKERLOG2 "500";
> close (POKERLOG2);
> $player_cash = "500";
> }
> if ($read_poker)
> { $player_cash = $read_poker; }
You are advocating the same thing. But by checking the return value of
open() and $! directly you are able to diagnose more problems. Why can't
you open $poker_log initally - is the file not there? Or are the
permissions set incorrectly? In your above example, suppose $poker_log
existed, but was not readable or writable. Then this would fail every
single time when you tried to overwrite the file. As a programmer, you
could then diagnose problems quickly. For example:
if (-e $poker_log) { # now you know the file exists
open(LOG,$poker_log) or die "Uh oh, why can't I a read a file that
already exists! $!";
chomp($player_cash = <LOG>);
close(LOG);
} else { # this file does not exist
print "I don't have a log file for you!\n";
open(LOG,">$poker_log) or die "Uh oh, why can't a write to a file?? $!";
print LOG "500\n";
$player_cash = 500;
close(LOG);
}
In this case, I am using the -e file text to find out if the file existed.
Using the return value of open() and $! to check for this is possible, but
less clear as to what you are doing. The two die statements are cases where
you truly want the program to die, if you can't do things like write to or
read from a file. Once I stupidly set all permissions in my /home tree to
600, forgetting about the fact that the httpd files were in there. It was
pretty easy to restore the correct permissions due to the or die()
statements in my CGI scripts.
The purpose of diagnostics is to let the programmer know when something has
gone awry - that is, when something that is *supposed* to happen doesn't
happen. In the above code, it is certainly possible for the log file not to
be there, so in my opinion this check should be relegated to the "normal
flow" of the program.
I would say, and hope that others agree, that if adding "or die" to an open
statement potentially disrupts the normal flow of your program, then there
is probably a more clear and effective way of expressing what you want to
happen - this is the difference between using -e to check for the existance
of a file before opening it, and plowing through a failed open and a failed
readline operator before getting to the root of the matter.
--Ben Kennedy
------------------------------
Date: Sun, 30 Jul 2000 10:10:46 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: I Am An Idiot
Message-Id: <39846196.6E83151B@stomp.stomp.tokyo>
Ben Kennedy wrote:
(others wrote:)
(Godzilla! wrote:)
Goodness, your newsreader exhibits the _exact_ same
problems as dozens of others here. Such a coincidence.
Must be a Sybil Club.
> > This statement is in direct contradiction of your
> > previous statement, paraphrased, "... _always_ use die."
> > However, your statement shows a bit more wisdom through
> > implication use of die may not always be the best choice.
> You are most likely misinterpreting what he said originally -
> he probably meant to say _always_ pay attention to the return
> value of open().
I am not a practicing internet mind reader nor are you.
My habit is to deal with reality, not mystic implications,
which are best left to The Milk Mystic.
> > Just as I thought; dogmatic || die.
> Actually "or die" is better since its lower precedence
Both kill your program. Reality dictates there is no difference.
* waves a white flag in sarcastic jest *
> > Point is, I write programs which compensate for errors,
> > continue to successfully run, where you boys would
> > give up and kill your program. Suppose this is a marked
> > difference between real women and, real men; we women
> > don't surrender easily, if ever.
(snipped my stunningly imaginative code)
(snipped Perl 5 Cargo Cultist Code Cop Mule Manure)
Rest of your comments are fluff, flitter and filler
sprinkled upon fresh mule manure for appearance sake.
Why do you Cargo Cultist Perl 5 boys insist on killing
your program, insist on waving a white flag and instantly
surrendering when an elephant down at the San Diego Zoo
passes gas?
I write my programs to successfully run under impossible
odds, to beat all odds, rather than lying down and whimpering.
* whistles theme to The Good, The Bad and The Ugly *
Seems another example of women having what men don't; cahones.
Godzilla!
--
print "file:///%43|%2f";
------------------------------
Date: Sun, 30 Jul 2000 19:44:42 +0800
From: DT <nospam.tom@hotmail.com>
Subject: IP spoofing for search engine
Message-Id: <MPG.13ee96011e8ecc41989686@news.newsguy.com>
I have dedicated servers which provide virtual webhosting service and
offer search engines submission for free with a script. The problem is if
I use :
$sock = new IO::Socket::INET ( PeerAddr => $host,
PeerPort => 80,
Proto => 'tcp',
Type => SOCK_STREAM ) or retur
undef, $@;
All the submission is done based on the IP of the main server, can you
tell me how to make it submit through the IP of virtual server?
Thanks!
------------------------------
Date: Sun, 30 Jul 2000 16:28:47 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: IP spoofing for search engine
Message-Id: <3JYg5.34$DT4.2007714@nnrp2.clara.net>
In article <MPG.13ee96011e8ecc41989686@news.newsguy.com>, DT <nospam.tom@hotmail.com> wrote:
>I have dedicated servers which provide virtual webhosting service and
>offer search engines submission for free with a script. The problem is if
>I use :
>
> $sock = new IO::Socket::INET ( PeerAddr => $host,
> PeerPort => 80,
> Proto => 'tcp',
> Type => SOCK_STREAM ) or retur
>undef, $@;
>
>All the submission is done based on the IP of the main server, can you
>tell me how to make it submit through the IP of virtual server?
*blink* Urm, if its a virtual web hosting I would assume you mean its name
based virtual hosting, in otherwords 1 IP address and 50 billions web sites
and you leave it up to the web server/clients to use HTTP 1.1 to figure it
out?
If so then that's what you do too. You connect your socket to the IP address
of the server and start talking HTTP/1.1, in other words you use the Host:
header field. I.e.
print "GET / HTTP/1.1\n",
"Host: www.bobsyeruncle.com\n",
"Referer: www.bobsmyuncle.com\n"; # etc.
Which would get / (usually pulling index.htm(l) when translated by the
server) from the vhost www.bobsyeruncle.com.
O' course if you're talking about IP based hosting then they'll have their
own IP address in which case you'd just slap the IP address of each site
into the socket object in turn.
I strongly suspect that the LWP module or similar can sort all of this lot
for you, so have a look at it/similar modules.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 30 Jul 2000 14:20:26 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <KQWg5.26$DT4.1993322@nnrp2.clara.net>
In article <Pine.LNX.4.21.0007292011030.19898-100000@hawk.ce.mediaone.net>, "Andrew N. McGuire " <anmcguire@ce.mediaone.net> wrote:
>Basically, anything you say will not be heard by those who killfile you.
>"*plonk*", and "They can't hear you scream in /dev/null!" are good
"In /dev/null, no one can hear you scream"
. Hmmm, now why didn't they use that as the tag line? :)
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 30 Jul 2000 17:04:54 GMT
From: eric_lyon@my-deja.com
Subject: Re: NEWB Q: CGI and DATABASSE
Message-Id: <8m1n7k$9g5$1@nnrp1.deja.com>
In article <8luu94$l5t$1@news.vsnl.net.in>,
"Debjit" <debjit@oyeindia.com> wrote:
WHERE DID YOU GET IT ? is it available online ?
> I use MySQL 3.22 win32 binary. It works great!
> eric_lyon@my-deja.com wrote in message
<8lsfh9$pjd$1@nnrp1.deja.com>...
>
> >PS: the OCELOT databasse is the only BD that i've found to do some
SQL
> >with win 95, is there a better (and free_ one ?
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 30 Jul 2000 16:27:36 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: No more typeglobs in Perl 6 (was: Advanced Perl Programming -- Dated?)
Message-Id: <8m1l1o$pi3$1@solti3.sdm.de>
In article <Rnmg5.8306$f_5.34629@news1.rdc1.ct.home.com>, Dan Sugalski <dan@tuatha.sidhe.org> wrote:
>> And just think about it: Without typeglobs, no aliases for subroutines
>> or variables anymore, no import of symbols in "use Module qw(...)" anymore,
>> no "use English;" anymore, etc.!
> Huh? How does one follow from the other? Just because typeglobs doesn't
> exist doesn't mean any of the other things don't exist. Heck, you can do
> all that stuff now without using typeglobs.
How?
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: 30 Jul 2000 13:40:12 -0400
From: aperrin@demog.berkeley.edu (Andrew J. Perrin)
Subject: Re: No more typeglobs in Perl 6 (was: Advanced Perl Programming -- Dated?)
Message-Id: <uya2jfrer.fsf@demog.berkeley.edu>
Steffen Beyer <sb@muccpu1.muc.sdm.de> writes:
> >> And just think about it: Without typeglobs, no aliases for [1] subroutines
> >> or [2] variables anymore, [3] no import of symbols in "use Module qw(...)"
> >> anymore,
> >> no "use English;" anymore, etc.!
>
> > Huh? How does one follow from the other? Just because typeglobs doesn't
> > exist doesn't mean any of the other things don't exist. Heck, you can do
> > all that stuff now without using typeglobs.
>
> How?
[1] sub foo {...}
$Rfoo = \&foo;
[2] $foo = 'foo';
$Rfoo = \$foo;
[3] package Foo;
@ISA = qw/Exporter/;
@EXPORT_OK = qw/$scalar, @array, subroutine/;
use Foo qw($scalar, @array, subroutine);
[4] use English;
I don't see how any of these require typeglobs.
--
----------------------------------------------------------------------
Andrew Perrin - Solaris-Linux-NT-Samba-Perl-Access-Postgres Consulting
aperrin@igc.apc.org - http://demog.berkeley.edu/~aperrin
----------------------------------------------------------------------
------------------------------
Date: Sun, 30 Jul 2000 11:11:34 GMT
From: David Tsai <templar318@earthlink.net>
Subject: Re: Online RPG using SQL?
Message-Id: <39840D3F.BDCEBFBB@earthlink.net>
> I've been in the process of deveoping plans for an web-based
> role-playing game, and I'm looking at different ways to implement it.
> Several people have told me that the best way to go would probably be to
> write it in Perl using a SQL database (for character stats, dynamic
> information, etc.) I'd appreciate any thoughts on this matter. Do you
> think the Perl/SQL combination would work, or are there better ways to
> implement such a project? Also, since my Perl skills are still pretty
> rough, if anyone could point me toward some online info about how to use
> SQL from Perl I'd be very grateful.
>
> Thanks!
>
> James
James,
Check out the DBI modules at cpan and decide what kind of SQL database you
would want to use. Some popular SQL databases are mSQL and mySQL. The DBI
module provides an interface between the database and Perl so you can easily
manipulate your tables in the database. If you don't know SQL those web
sites have some language specifications on the language.
http://www.mysql.com
http://www.hughes.com.au
http://www.cpan.org
Hope that helps.. Good luck..
--
Best Regards,
David Tsai
CGI Paradise
http://www.web-consult.com/scripts/
------------------------------
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 3848
**************************************