[26621] in Perl-Users-Digest
Perl-Users Digest, Issue: 8731 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 5 03:05:45 2005
Date: Mon, 5 Dec 2005 00:05:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 5 Dec 2005 Volume: 10 Number: 8731
Today's topics:
Re: FAQ 2.11 Perl Books <sdn.girths00869@zoemail.net>
Re: FAQ 5.34 Why can't I use "C:\temp\foo" in DOS paths <jwkenne@attglobal.net>
Re: FAQ 5.34 Why can't I use "C:\temp\foo" in DOS paths <sherm@dot-app.org>
Image proccessing tool question <RemoveThisPrefixmatts2nospam@ix.netcom.com>
Re: Image proccessing tool question <RemoveThisPrefixmatts2nospam@ix.netcom.com>
Re: migrate data tables <noone@nowhere.net>
Re: My experience with XML::DOM VS XML::LibXML <jvs@india.ti.com>
Re: My experience with XML::DOM VS XML::LibXML <jvs@india.ti.com>
Re: My experience with XML::DOM VS XML::LibXML <jvs@india.ti.com>
Re: Saving only comments in HTML robic0
Re: Saving only comments in HTML robic0
Re: Saving only comments in HTML <matthew.garrish@sympatico.ca>
Re: Saving only comments in HTML robic0
Re: Saving only comments in HTML robic0
TCP IO::Socket::INET Listen w/o using ->accept? (1 to 1 <casabianca@suplitein.junk.de.net.org.com>
Re: TCP IO::Socket::INET Listen w/o using ->accept? (1 <1usa@llenroc.ude.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 04 Dec 2005 14:50:41 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: FAQ 2.11 Perl Books
Message-Id: <Xns9722A17A8488Csdn.comcast@216.196.97.136>
PerlFAQ Server <comdog@pair.com> wrote in
news:dmt874$4kr$1@reader2.panix.com:
>
> 2.11: Perl Books
>
I'd like to suggest two books that were published this summer:
_Higher-Order Perl_, by Mark Jason Dominus
_Perl Best Practices_, by Damian Conway
--
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`
------------------------------
Date: Sun, 04 Dec 2005 23:00:43 -0500
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: FAQ 5.34 Why can't I use "C:\temp\foo" in DOS paths? Why doesn't `C:\temp\foo.exe` work?
Message-Id: <MXOkf.1949$L7.251@fe12.lga>
Sherm Pendley wrote:
> Isn't it time to update the "DOS paths" and "legacy DOS filesystem" bits?
> Windows hasn't been built on top of MS-DOS, or used FAT16, for quite a long
> time now.
Enter "command", and Windows itself announces
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.
--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
------------------------------
Date: Mon, 05 Dec 2005 00:49:44 -0500
From: Sherm Pendley <sherm@dot-app.org>
Subject: Re: FAQ 5.34 Why can't I use "C:\temp\foo" in DOS paths? Why doesn't `C:\temp\foo.exe` work?
Message-Id: <m2lkz09jpj.fsf@Sherm-Pendleys-Computer.local>
"John W. Kennedy" <jwkenne@attglobal.net> writes:
> Sherm Pendley wrote:
>> Isn't it time to update the "DOS paths" and "legacy DOS filesystem" bits?
>> Windows hasn't been built on top of MS-DOS, or used FAT16, for quite a long
>> time now.
>
> Enter "command", and Windows itself announces
>
> Microsoft(R) Windows DOS
> (C)Copyright Microsoft Corp 1990-2001.
Command.com is included with Windows solely for old apps that rely on it; the
default shell these days is cmd.exe. It's hardly surprising that the old shell
still displays the old welcome message.
Are you seriously trying to claim that, despite its being based on the NT
kernel and using NTFS by default, Windows XP can legitimately be called "DOS",
simply because it includes a copy of the old command.com shell?
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Sun, 04 Dec 2005 20:43:13 GMT
From: Matt Silberstein <RemoveThisPrefixmatts2nospam@ix.netcom.com>
Subject: Image proccessing tool question
Message-Id: <ctk6p1dnkadfolj3rjhcnliklup4vrfgij@4ax.com>
I need to do the following job. I can see how to do this in Perl, but
if it already exists in some tool/script that would be better.
I have a number of jpeg images of various sizes (but close together in
size). Eventually I want each of them embedded in a new jpeg centered
in a background. There are various approaches to solve this and if the
tool exists I am open. If not, then I figure for me I would do two
passes. First, scan the image directory/source and determine maximum
length and width. If it were manual I would then decide the best
larger size to use. After that I would make my second pass, putting
each image in the background image and saving it.
TIA and if anyone else would find this useful I will try to make it
general. So tell me how you would like it generalized.
--
Matt Silberstein
Do something today about the Darfur Genocide
http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org
"Darfur: A Genocide We can Stop"
------------------------------
Date: Sun, 04 Dec 2005 22:07:02 GMT
From: Matt Silberstein <RemoveThisPrefixmatts2nospam@ix.netcom.com>
Subject: Re: Image proccessing tool question
Message-Id: <9np6p1lfcvjpic0pp1daim8866jbo39ojs@4ax.com>
On 4 Dec 2005 20:56:48 GMT, in comp.lang.perl.misc , John Bokma
<john@castleamber.com> in <Xns9722980A0A4D3castleamber@130.133.1.4>
wrote:
>Matt Silberstein <RemoveThisPrefixmatts2nospam@ix.netcom.com> wrote:
>
>> I need to do the following job. I can see how to do this in Perl, but
>> if it already exists in some tool/script that would be better.
>>
>> I have a number of jpeg images of various sizes (but close together in
>> size). Eventually I want each of them embedded in a new jpeg centered
>> in a background. There are various approaches to solve this and if the
>> tool exists I am open. If not, then I figure for me I would do two
>> passes. First, scan the image directory/source and determine maximum
>> length and width.
>
>Image::Size;
Thanks.
>> If it were manual I would then decide the best
>> larger size to use. After that I would make my second pass, putting
>> each image in the background image and saving it.
>
>ImageMagick?
Likely, but I am not sure yet.
>I assume that not all pictures tile nicely, so what color are you using
>for the background?
Probably white, but I suspect I will need this again and will make it
flexible.
--
Matt Silberstein
Do something today about the Darfur Genocide
http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org
"Darfur: A Genocide We can Stop"
------------------------------
Date: Mon, 05 Dec 2005 02:29:55 -0500
From: John Smith <noone@nowhere.net>
Subject: Re: migrate data tables
Message-Id: <0vWdnR_cY9q9cQ7eRVn-iQ@comcast.com>
robic0 wrote:
> On Sat, 03 Dec 2005 14:26:16 -0500, John Smith <noone@nowhere.net>
> wrote:
>
>> I have data in a Foxpro DBF table. Is there a quick, simple way in Perl
>> to copy this table into a SQLite table? I know how to do it manually
>> using DBI, but I'm looking for a package that does it all automatically.
>> I do not mind if the data types are not mapped exactly right. Could
>> SNOPS do it?
>>
>> The reason I need to do this is because I need to generate some
reports
>>from the Foxpro database. However, I'm unfamiliar with Foxpro SQL, the
>> Foxpro ODBC driver has very limited functionality, and the data is
>> read-only. So it would be easier if I imported the data into a more
>> advanced database and worked with it from there. I'm using Perl on
>> Windows XP.
>
> This is really puzzling, Foxpro is very limited functionality?
> I never used foxpro, but most dbm engines support standard SQL
> syntax. Are you new to sql query's? Have you ever heard of
> "stored procedures"? Most need several practice query's to have
> it sink in. Mostly simple. However in Access, the level of
> auto-generated indirection (relationships) can produce query
> strings several K in size that can only be analyzed graphically.
> Access does however support simple sql standards.
>
Foxpro is not bad, but the Foxpro ODBC driver is very limited. See:
http://tinyurl.com/bhdby
I tried DBIx::Migrate, but it didn't create the tables in the target. I
looked at SPOPS, but it was too complicated. I didn't want to use
inefficient Table2Hash/Hast2Table functions. Taking advantage of
SQLite's data type independence, I wrote this utility function:
# source DBI connection - odbc
# target DBI connection - sqlite
# odbc query
# new table name
sub CreateTemporarySQLiteTable($$$$)
{
my ($dbh, $sth, @row, $i);
my $source = shift;
my $target = shift;
my $query = shift;
my $newtablename = shift;
my ($fieldnames);
$sth = $source->prepare($query)
or die "Error-".$source->errstr()."-preparing: $query";
$sth->execute() or die "Error-".$source->errstr()."-executing: $query";
$fieldnames = $sth->{NAME_uc};
$query = "CREATE TABLE ".$newtablename." ('".join("','",@$fieldnames)."')";
$target->do($query)
or die "Error creating table: ".$source->errstr();
while(@row = $sth->fetchrow_array())
{
$query = "INSERT INTO ".$newtablename." VALUES (";
for($i = 0; $i < scalar(@row); $i++)
{
$query .= $target->quote($row[$i]);
if($i == scalar(@row)-1) {
$query .= " ) ";
} else {
$query .= " , ";
}
}
$target->do($query);
}
$target->commit();
}
It reads my Foxpro data into a SQLite table. Actually, it takes the
results of any SELECT query from any DBI data source, and dumps it into
a new SQLite table. I can take snapshots of all the data I need from
Foxpro, and then do additional processing from there. The main thing I
wanted from SQLite was the ability to do nested subqueries. The Foxpro
ODBC driver only supports a couple in the WHERE clause. I couldn't
import or touch the Foxpro database, because it is part of an in-use,
legacy application. Thanks for your reply.
------------------------------
Date: Mon, 5 Dec 2005 12:16:35 +0530
From: Jahagirdar Vijayvithal S <jvs@india.ti.com>
Subject: Re: My experience with XML::DOM VS XML::LibXML
Message-Id: <slrndp7oib.q1s.jvs@bstclindt008.india.ti.com>
* robic0 <robic0> wrote:
<SNIP>
>
> Forgot to include this comment last time:
> In SAX you don't have to preprocess like your doing here.
> You could start parsing without doing this, even though your
> looking for inner xml structures. Thats not necessary with SAX.
> But using dom, thats the way you have to do it, to reduce the
> memory consumption by taking the "whole" into consideration.
> ....... more to come.
>
One of the reasons I did not go for SAX was it would increase the code
size for e.g currently the actual code for parsing the XML is within if
(/<packet>/.../<\/packet>/) block and getvalue function (<45lines). The restof the
code is doing the actual function for which the script was written.
I have not written code using SAX before but from what I understand I
will have to write start-end tag handler for each and ever possible tags
which in my case goes in hundreds of tags.
Regards
Jahagirdar Vijayvithal S
--
Why doesn't DOS ever say "EXCELLENT command or filename!"
Jahagirdar .V.S 91-80-25099129(O) 91-80-28540394(R)
IC Design Engineer RGES-WLAN,
Texas Instruments (India) Ltd.
------------------------------
Date: Mon, 5 Dec 2005 12:30:42 +0530
From: Jahagirdar Vijayvithal S <jvs@india.ti.com>
Subject: Re: My experience with XML::DOM VS XML::LibXML
Message-Id: <slrndp7pcq.q1s.jvs@bstclindt008.india.ti.com>
* robic0 <robic0> wrote:
<SNIP>
>>Forgot to include this comment last time:
>>In SAX you don't have to preprocess like your doing here.
>>You could start parsing without doing this, even though your
>>looking for inner xml structures. Thats not necessary with SAX.
>>But using dom, thats the way you have to do it, to reduce the
>>memory consumption by taking the "whole" into consideration.
>>....... more to come.
> Again forgot. Let me give you an example. You have a 4 gig xml
> file. You only want to extract data in random, 4k slices xml.
> What you are trying to do with preprocessing here (to reduce)
> the dom overhead is done automatically with SAX stream
> processing. You just set the handlers to filter the data you
> want to an array of structures or database. If in your case
> the aggregate xml is extremely large, and your only interrested
> in a few blocks of xml (which itself is very large) only SAX
> can do that. You set up simple handlers (callbacks) for start
> tag, end tag, content (and by the way for every other w3c
> constuct). Glean you tag data.
>
> In your case the data your interrested in has a container tag
> "<packet>" (I won't go into the case of unclosed nested tags)
> which spans a series of tags:
A few additional details on what I am trying to do. I am trying to build
an engine to collect statistics on packet sequences of interest each xml
stream may contain upto a million packet, each packet enclosed in a
<packet> </packet> tag
>
> <packet>
> <proto name="geninfo" pos="0" showname="General information"
> size="114">
> <field name="num" pos="0" show="1" showname="Number" value="1"
> size="114"/>
> <field name="len" pos="0" show="114" showname="Packet Length"
> value="72" size="114"/>
> <field name="caplen" pos="0" show="114" showname="Captured Length"
> value="72" size="114"/>
> <field name="timestamp" pos="0" show="Sep 30, 2005 11:34:22.158787000"
> showname="Captured Time" value="1128060262.158787000" size="114"/>
> </proto>
> ....
> </packet>
>
> Once the "<packet>" start tag is flagged, you can start collecting
> tag data (attributes and content) into a structure that can be
> serialized out to a database. You do this until the end tag
> "</packet>" is reached.
Isnt this similar to what I get from my use of DOM?
>
> SAX is event driven, totally serialized. Its so fast you can't
> believe it.
> In fact your example is so simple I could write the data structures
> and the custum part of the template model in less than a day.
> Including creating database records. The only limit would be
> on the amount of hard drive space.
>
> You have to learn SAX, especially on such a large model. The rudiments
> of the event handlers can be for the most part be templated for all
> data models you want to extract.
>
> If you want a good template, or will be doing more of this.
> I could provide it to you on a contract basis. I've done alot of
> SAX and know the ins and outs extremely well.
>
> With SAX you have granularity down to the & level.
> Let me know what you decide.
>
> Hope this helps....
> gluck
>
> dr
>
>
Regards
Jahagirdar Vijayvithal S
--
Why doesn't DOS ever say "EXCELLENT command or filename!"
Jahagirdar .V.S 91-80-25099129(O) 91-80-28540394(R)
IC Design Engineer RGES-WLAN,
Texas Instruments (India) Ltd.
------------------------------
Date: Mon, 5 Dec 2005 12:47:55 +0530
From: Jahagirdar Vijayvithal S <jvs@india.ti.com>
Subject: Re: My experience with XML::DOM VS XML::LibXML
Message-Id: <slrndp7qd3.q1s.jvs@bstclindt008.india.ti.com>
* robic0 <robic0> wrote:
<SNIP>
>>>
> If you want me to write the core or whole of you project, I can do
> that too. But I know you guys are programmers. Just could use a good
> master to work from...
>
Thanks for the offer. I have been writing perl scripts in and out for
the past 5+ years for automating most of my code generation and parsing
work.
I already have a working code.
I started this thread because I saw something which to me indicated a
bug/memory leak in the XML::DOM implementation. so wanted to know the
opinion of others here on it.
Regards
Jahagirdar Vijayvithal S
--
Why doesn't DOS ever say "EXCELLENT command or filename!"
Jahagirdar .V.S 91-80-25099129(O) 91-80-28540394(R)
IC Design Engineer RGES-WLAN,
Texas Instruments (India) Ltd.
------------------------------
Date: Sun, 04 Dec 2005 18:38:07 -0800
From: robic0
Subject: Re: Saving only comments in HTML
Message-Id: <bu97p15r37pabirfujr9vqqeeni6t3k9gj@4ax.com>
On Sun, 4 Dec 2005 20:50:17 -0500, "Matt Garrish"
<matthew.garrish@sympatico.ca> wrote:
>
><robic0> wrote in message news:v727p1pihaqfrd0ost2brvnrb1mf2ibc8q@4ax.com...
>> On Sat, 3 Dec 2005 11:03:41 -0500, "Matt Garrish"
>> <matthew.garrish@sympatico.ca> wrote:
>>
>>>
>>><robic0> wrote in message
>>>news:hqk2p11t2gt3ic8bf174qcv7urpv0lql6u@4ax.com...
>>>> On Thu, 01 Dec 2005 12:41:48 +0100, Gunnar Hjalmarsson
>>>> <noreply@gunnar.cc> wrote:
>>>>
>>>>>robic0 wrote:
>>>>>> Gunnar Hjalmarsson wrote:
>>>>>>>robic0 wrote:
>>>>>>>>Gunnar Hjalmarsson wrote:
>>>>>>>>>robic0 wrote:
>>>>>>>>>>Matt Garrish wrote:
>>>>>>>>>>>
>>>>>>>>>>>foreach my $commented ($page[0] =~ /<!--(.*?)-->/gs) {
>>>>>>>>>> ^
>>>>>>>>>> . == [^\n]
>>>>>>>>>>Make sure $page[0] is not like this:
>>>>>>>>>><!-- Comments all over
>>>>>>>>>>the place,
>>>>>>>>>>more and more,
>>>>>>>>>>still more
>>>>>>>>>>-->
>>>>>>>>>
>>>>>>>>>And why would that make a difference? You'd better take the whole
>>>>>>>>>m//
>>>>>>>>>operator into consideration, including the modifiers.
>>>>>>>>
>>>>>>>>and what does the /g"s", s modifier do,
>>>>>>>>given $page[0] contains the whole page (even though it might be
>>>>>>>>stripped of "\n". If /s modifies ".*" just say so.
>>>>>>>
>>>>>>>perldoc says it just fine.
>>>>>>
>>>>>> Just to let you know, still didn't look.
>>>>>> It was only relavent to me in that you asserted it and
>>>>>> incumbent upon youself to explain it.
>>>>>
>>>>>Scarcely. You posted an incorrect comment on Matt's suggestion, and I
>>>>>pointed out that you were wrong. When posting answers, or criticizing
>>>>>answers posted by others, you'd better make efforts to get it right. If
>>>>>you don't understand that, you may just as well go away.
>>>>>
>>>>><further rambling snipped>
>>>>
>>>> Listen jerk, your qualification without explanation won't fly.
>>>> You expanded the parameters of the discussion. If you think
>>>> your God then why don't you just fuckin cure cancer.
>>>> Your not responding on the level of the question. Perldoc
>>>> statements make you a useless son uf a bitch, biotch........
>>>>
>>>
>>>You're the only imbecile here for making such a stupid assertion and then
>>>trying to stick to it. If you don't understand regex modifiers, which you
>>>obviously don't, then don't attempt to correct valid regular expressions
>>>that use them. Maybe over recess you should take the time to read perlre.
>>>
>>>
>> Why don't you put it "ALL" down in print for the record so anybody
>> that reads the archives will know exactly wtf you are talking about.
>
>For the record: robic0 does not understand regular expressions. When you see
>a reply from him in regards to any question you might have about regular
>expressions, ignore said response.
>
>Matt
>
My IQ is 170. I think I will reffer to you as a droit motherfuckin
asshole.
Is that ok with u?
------------------------------
Date: Sun, 04 Dec 2005 18:48:11 -0800
From: robic0
Subject: Re: Saving only comments in HTML
Message-Id: <4ga7p1pjfbcn4g99ptmvgvvs4ekfo1jhth@4ax.com>
On Mon, 05 Dec 2005 03:25:07 +0100, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:
>Matt Garrish wrote:
>> For the record: robic0 does not understand regular expressions. When you see
>> a reply from him in regards to any question you might have about regular
>> expressions, ignore said response.
>
> s/ about regular.+?expressions//s;
Perhapss you would like to "suck my dick motherrfucker"?
Just a statement....
------------------------------
Date: Sun, 4 Dec 2005 21:46:18 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Saving only comments in HTML
Message-Id: <WRNkf.716$kt5.106642@news20.bellglobal.com>
<robic0> wrote in message news:bu97p15r37pabirfujr9vqqeeni6t3k9gj@4ax.com...
> On Sun, 4 Dec 2005 20:50:17 -0500, "Matt Garrish"
> <matthew.garrish@sympatico.ca> wrote:
>
>>
>>For the record: robic0 does not understand regular expressions. When you
>>see
>>a reply from him in regards to any question you might have about regular
>>expressions, ignore said response.
>>
>>
> My IQ is 170. I think I will reffer to you as a droit motherfuckin
> asshole.
>
Trouble with the decimal place? That happens when your iq is 17. Perhaps you
might care to look up droit in a dictionary over lunch break, and then work
on figuring out exactly what saying you thought you understood but were
incapable of repeating...
Matt
------------------------------
Date: Sun, 04 Dec 2005 19:44:42 -0800
From: robic0
Subject: Re: Saving only comments in HTML
Message-Id: <osd7p1t254cgtggefmdf4glle3jo6445c8@4ax.com>
On 5 Dec 2005 03:41:16 GMT, John Bokma <john@castleamber.com> wrote:
>robic0 wrote:
>
>> My IQ is 170.
>
>I am not going to hold my breath until you're going to use it ;-)
spam
------------------------------
Date: Sun, 04 Dec 2005 19:59:48 -0800
From: robic0
Subject: Re: Saving only comments in HTML
Message-Id: <sje7p1lr7ev5ukuqgs8120p1369gr44bhr@4ax.com>
On Sun, 4 Dec 2005 21:46:18 -0500, "Matt Garrish"
<matthew.garrish@sympatico.ca> wrote:
>
><robic0> wrote in message news:bu97p15r37pabirfujr9vqqeeni6t3k9gj@4ax.com...
>> On Sun, 4 Dec 2005 20:50:17 -0500, "Matt Garrish"
>> <matthew.garrish@sympatico.ca> wrote:
>>
>>>
>>>For the record: robic0 does not understand regular expressions. When you
>>>see
>>>a reply from him in regards to any question you might have about regular
>>>expressions, ignore said response.
>>>
>>>
>> My IQ is 170. I think I will reffer to you as a droit motherfuckin
>> asshole.
>>
>
>Trouble with the decimal place? That happens when your iq is 17. Perhaps you
>might care to look up droit in a dictionary over lunch break, and then work
>on figuring out exactly what saying you thought you understood but were
>incapable of repeating...
>
>Matt
>
Mat,
droit soundss good to me. Am I to be learned in Perl?
Is Perl just a happenstance, intermediated, destineded
for extinsion? Probabbly........
Ask me why i know the future
Jackass...
------------------------------
Date: Sun, 4 Dec 2005 10:11:54 -0800
From: "Eckstein C." <casabianca@suplitein.junk.de.net.org.com>
Subject: TCP IO::Socket::INET Listen w/o using ->accept? (1 to 1)
Message-Id: <3vgproF14lbpkU1@individual.net>
I want to know if it's possible to have a listening TCP socket (I'm
using IO::Socket::INET), that only expects one client, to instead of
using
my $client = $listen_sock->accept();
and
$client->recv($data, 1024);
as you would normally do, and instead, just do a
$listen_sock->recv($data, 1024)
on the listening socket?
This works for UDP (I know I know, UDP is connectionless) and I've bene
able to do things this way in other langs before, that let you either go
the "accept/client" route or "read from socket", 1:1 listen setup.
So basically I just want a simple 1:1 setup.
Thank you.
------------------------------
Date: Sun, 04 Dec 2005 18:51:30 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: TCP IO::Socket::INET Listen w/o using ->accept? (1 to 1)
Message-Id: <Xns97228CFF21960asu1cornelledu@127.0.0.1>
"Eckstein C." <casabianca@suplitein.junk.de.net.org.com> wrote in
news:3vgproF14lbpkU1@individual.net:
> I want to know if it's possible to have a listening TCP socket (I'm
> using IO::Socket::INET), that only expects one client,
If you are using TCP, a connection-oriented protocol, a connection must
be established using accept before you can receive data. This sounds so
self-evident to me that I am having difficulty understanding why this is
puzzling you.
If you want to serve only one client, then you can use the peeraddr
method to check if it is the client you expected.
This would still allow a denial of service attack to be launched against
the server. So, I would set up a firewall to only allow connections from
a given host to the service.
> I've bene able to do things this way in other langs before,
> that let you either go the "accept/client" route or
> "read from socket", 1:1 listen setup.
>
> So basically I just want a simple 1:1 setup.
I am not sure what "a simple 1:1 setup" is. I would definitely be
interested in knowing how one would receive data over a connection
without setting up a connection (as my expertise in TCP/IP is even less
than my expertise in Perl).
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 8731
***************************************