[28322] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9686 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 5 06:05:42 2006

Date: Tue, 5 Sep 2006 03:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 5 Sep 2006     Volume: 10 Number: 9686

Today's topics:
    Re: (Off topic) Cyberwar question <bik.mido@tiscalinet.it>
    Re: Cygwin error regarding profile.global <popesnarky@gmail.combat>
    Re: How to handle jpegs inside Net::NNTP <bik.mido@tiscalinet.it>
    Re: Insert Log file into oracle table mattjones@hotmail.co.uk
    Re: IO::Socket server <spp_icarsNOSPAM@yahoo.fr>
        IPC on Win XP: messages, shared memory <clydenospamorham@nospamorhamgetofftheline.freeservenospamorham.co.uk>
    Re: map tricks <bik.mido@tiscalinet.it>
    Re: map tricks <uri@stemsystems.com>
    Re: Perl socket timeout <spp_icarsNOSPAM@yahoo.fr>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 5 Sep 2006 09:16:26 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <m19qf21jo9pjq4jbju4m4ram3ot7ksmeg3@4ax.com>

On 4 Sep 2006 15:25:14 -0700, beartiger@gmail.com wrote:

>> > > Labelling an off topic post does not make it any less rude.
>> >
>> > Objecting to OT posts by replying to OT posts is stupid.
>>
>> Hmm, enlighten me as to how that does not apply to you?
>
>I don't object to OT posts, dumbshit.

You're doing!


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Tue, 05 Sep 2006 07:07:02 GMT
From: "Pope Snarky Goodfella of the undulating cable, JM, CK, POEE, KOTHASK, DSOCPL, EOTHIDIAUTP, GGGHD, HCNB, MU, BCB, CPFWJ, CPFG, MWFA, CEM" <popesnarky@gmail.combat>
Subject: Re: Cygwin error regarding profile.global
Message-Id: <pan.2006.09.05.07.07.01.506363@text.medium.number.5.always.off-topic.for.os2>

Hail Eris! On Mon, 04 Sep 2006 18:01:57 -0700, Matt Garrish wrote:
> Outer Filth John Harrington beartiger@gmail.com wrote:
>> Matt Garrish wrote:
>> <snip>
>> > Ooh, there's the M word again. Your expansive vocabulary well
>> > exhibits your deep intellect.
>>
>> Did you happen to notice that you yourself used the word, just three
>> posts ago?
>>
>>       The "moron" is you.
>>       --Matt Garrish
>
> I don't think I've ever truly understood the use of laughing my ass off
> as in usenet postings until you came along. You cite me citing you to
> point out the word moron appeared once as attributed to me. What on
> earth does that prove, other than the word is the sole extent of your
> ability to write insults?

Watch it, if you keep spanking him, he'll out you, and try to get you
nominated for kook awards in AUK while doing so.

>> And did you happen to notice that, despite your assertion that posting
>> OT is "stupid", you've now done it repeatedly?
>
> You started this thread with the childish statement that no one should
> object to you posting because for some unknown reason posting cygwin stuff
> here is to benefit the google groups world. You then made an asinine
> remark to a regular poster here whose contribution you could never hope to
> equal. So would you kindly explain how what I've posted is off-topic? It's
> perfectly reasonable to discuss an off-topic post and/or tell the poster
> what is thought of them. Or are you now the grand vizier of usenet posting
> after your one miraculous foray?

He must be, since he was involved in the outing of Ward Hardman in rmcr,
too. Here's the Google link where it all started: http://tinyurl.com/hojf8

>> Yes, I too am beginning to think that "moron" is a particularly
>> inarticulate way to describe you.
>
> Congratulations, it only took you a day to tire of the word. Feel free to
> follow up as much as you like, I for one won't be bothering to read
> anything else you post.

Looks like Mr. Harrington learned his lesson, but not well, and too
late, considering that he's co-nominated with his Outer Filth buddies (the
Outer Filth Trio) for seven awards, including Kook, Coward, and Clueless
Newbie of the Month, as well as Special Ops Cody Memorial Award (for their
use of rubber hand grenades in kooky combat).

-- 
________________________________________________________________________
All Hail Discordia! TM#5; Flonk Leader 2 & 11-1/9
The Ridiculously Long Scarf of Tom Baker
COOSN-029-06-71069

1. What is this newsgroup, alt.usenet.kooks (AUK)?

A mass of electrons spread out upon bandwidth scattered across the globe
for the express purpose of separating the wheat from the chaff of the
net.

2. This is a joke, right? RIGHT?!!

No more a joke than the fact that ISPs let people on every day who have
nothing better to do than annoy their neighbors enough to win by popular
vote silly little awards created for just such buffoons as them.

3. What's this newsgroup for?

The newsgroup alt.usenet.kooks is for the discovery and discussion of
Kooks on Usenet and the Internet. These people are known technically as
net.kooks.

4. What's this newsgroup NOT for?

This group exists for recreational Kookology, not for Very Personal
Vendetta. It is not to be used for general harassment of someone, or for
net abuse such as spamming and flooding and cancelbombing in an attempt
to gain vengeance on someone or get the denizens of AUK to shut up.
Either way, it won't work, it's very messy, "Bob" will give you triple
your money back, and you don't get a life.

Also, we [tinw] are not in the business of harassing the vulnerable or
the insane. Occasionally an apparent net.kook proves to be genuinely
ill. In such cases the person is disqualified from winning awards and
other posters are asked to avoid exarcerbating his or her problems.
Similarly, trolling or kook-hunting in support groups is strongly
discouraged.

5. Who let this newsgroup in here, and why wasn't I notified?

That's what you get for hogging the Beer Fund.

(Here you can view the control message that started it all, from our
Mighty Founder MAC.)

http://www.netcabal.com/auk/cmsg.html

6. Who is a net.kook?

If you post uniquely strange, preferably incomprehensible articles, or
you manifest a persistent, extreme, and somewhat bizarre obsession, you
just might be a net.kook. And more.

It is important to note the subtle distinction between a net.kook, a
net.cretin, a clueless newbie, troll, or garden-variety @$$hole. The
newbie, one hopes, can acquire a clue on the installment plan even if he
can't afford to buy one for cash; the cretin is merely stupid and/or
irritating; the troll makes a fool out of himself by making a fool out
of you, the @$$hole is, well, simply that. But a TRUE net.kook has a
special fascination derived from his/her/its utter ineffability. Their
behavior is irrational, if not downright weird, but they are seldom
merely boring.

It is not considered appropriate to nominate clueless newbies, trolls,
or longwinded spambrains as net.kooks. It is acceptable to nominate
net.cretins, or simply to present them, without nomination, for whatever
minor amusement value they may have; but the real focus here is on
net.kooks in all their raging, indomitable glory.

Important Disclaimer: the fact that someone has been proclaimed a
net.kook does not imply any psychological diagnosis in and of itself. A
net.kook may or may not be clinically insane; that is not the concern of
the AUK audience.

We hope.

7. Can you show me a few examples?

I'd rather not, but it may help to clarify things... The person who
posted a handful of meaningless, ill-formed newgroup messages on May 21,
1994 was a Clueless Newbie. The person who hung around
alt.religion.kibology during April and May 1994, constantly posting
boilerplate "warning" messages telling people that ARK messages were
intentionally meaningless, was a net.cretin. The people who post
demented "scientific" theories, like Archimedes Plutonium's concept of
the universe being one giant atom of plutonium, and seem incorrigible to
criticism, are moderate net.kooks. The sort of being who constantly
raves about the conspiracy against her/him/it is an extreme net.kook,
especially if he/she/it automatically assumes that anyone who questions
their world-view is an agent of the conspirators or is an ultra
right-wing/left-wing extremist, and hides behind an anonymous remailer
to avoid "persecution" even though they would get one hell of a lot less
of it by not posting at all.

http://www.insurgent.org/~jhd/kookway.htm

8. How do I present a Kook on this group?

The preferred technique is to get the suspected Kook to start posting to
AUK so that we can all see him/her/it in all their first-hand Glory. You
can do this by posting followups to the suspect's weirder messages, with
your followups nonchalantly crossposted to AUK. If the suspect responds
to your messages without editing the Newsgroups line, you've achieved
your goal.

Another acceptable method is to repost, complete and unedited, one or
two of the suspected Kook's recent rants. If you do this, please provide
a brief intro in the header describing what the hell you're doing, such
as indicating who this person is, what group you found the message on,
or why you think the rest of us should give a rat's @$$ about it.

You should be aware that if you try this with some perfectly reasonable
posting, you may be flamed to net.hell and back and probably suspected
of being a net.loon yourself. It is also considered extremely lame to
nominate someone as a Kook simply because you have lost, or at least
failed to win, a debate with them; persistently doing so is likely to
get you nominated for Kook Awards. That someone fails to perceive the
self-evident, unassailable wisdom of your viewpoint does not, in and of
itself, constitute Kookery.

9. What are the Kook Awards?

The newsgroup alt.usenet.kooks offers a variety of widely-recognized and
highly dubious honors for your service, applying to net.kooks
everywhere. They recognize several kinds and many levels of net.kookery.

Here is a detailed list of AUK awards and descriptions.

http://www.netcabal.com/auk/awards.html

10. Who the FSCK appointed YOU net.kookologist/god/nazi etc.

Nobody. We have a Gift.

11. Are there any holidays in AUK?

Why yes, there sure are:

March 30th - CALL to ARMMs

Commemorating the earliest most virulent Kook post flood of Usenet, and
the great flamewar that followed in its wake.

June 26th - KOOKS DAY

Named in commemoration of Earl Curley checking into the Motel Deep 6 to
serve a major in the pine penalty box, the same date as Edmond Wollmann
got arrested riding the San Clemente railway...on his motorcycle.

August 15th - DEAD DOC TAVISH DAY

Named in honor of the death of one of Usenet's most famed identities due
to excessive Usenet exposure; his virtual corpse is buried in a rural
cemetery near New Bremen, Texas

September 10th - KAZOO DAY

This holiday commemorates Raymond Ronald "Kazoo" Karczewski's conviction
for seven felonies. May Raymold be a warning to all kooks who are
tempted to think that a "Sovereign Christ" is above the law.

December 20th - AUK BIRTHDAY

The anniversary of the newgrouping of alt.usenet.kooks

12. What should I do if I'm paged on the Red Courtesy Telephone?

Give the caller Gandalf the Gray's speech to the demon. Verbatim.

13. Is alt.usenet.kooks archived anywhere?

Why would you even *want* to know? [But if you truly must know, GIYF.
You masochist, you.]

14. What should we do about the book?

Burn it.

15. Where can I find out more about net.kooks?

Several mini-FAQs on classic kooks of the past and present (along with
several non-kooky legendary netters) are available on the World Wide Web
in various archives. Be sure to set aside coffee and cats before
reading. [Try insurgent.org/kook-faq/]

16. What are the AUK Offices?

As well as the kook awards, kooks may compete to hold office for a month
or longer. Nominations are made in exactly the same way as for awards;
the difference is that the previous holder of the office always appears
on the ballot paper when a new candidate emerges, and the winner remains
in office until challenged again. At present, the offices are as
follows.

Darth Bawl -

This office is held by Usenet's biggest crybaby.

Village Idiot -

The name says it all.

Kooki Information Minister -

Named in honour of Iraq's Mohammed Saeed al-Sahhaf, this office is held
by the kook whose claims are most noticeably at variance with known
facts.

Ministry of Circle Jerks -

Although many kooks are lone wolves, a few like to make friends with
those who are as delusional as themselves. This office rewards the
slurpfests that often ensue.

17. Are there any net.kook awards outside of AUK?

At various points of time there have been several, from the Christian
groups' Steebie Award to alt.fan.art-bell's Angstrom Medal. At least two
newsgroups, talk.politics.guns and comp.systems.mac.advocacy, have given
out their own Kook of the Month awards. Check around from time to time
to see what other net.kook awards might be around. [alt.atheism does
them, too.]

18. What is the Cabal?

From the beginning of Usenet time, there has been but one force capable
of holding it in check to remain in the realm of mortal existence. For
today's Usenet world you need a Giant. A Behemoth. A Cabal of IMMENSE
PROPORTIONS. A REALLY *BIG* *CABAL* to offer all news ORDER.

Within this force is the most ruthless and efficient organization on all
Usenet, known as the Cabal Obsidian Order (COO). If *YOU* wish to know
of this entity, read, learn, and do as you will.

SEE THE LIGHT OF COLLECTIVE WISDOM!!!

A. I *SAID*, what is the CABAL?

There Is No Cabal. Long Live The Cabal.

B. How does the Cabal function??

As well as any apocryphal organization can hope to function.

C. What are the weaknesses of the Cabal?

<chortle> What weaknesses?

D. What is the hierarchy and power structure of the Cabal?

Oh, you don't need to know that. Really. You can trust us, especially
when it comes to information you haven't paid for.

E. What is the Cabal Obsidian Order?

The Cabal Obsidian Order (COO) is a profoundly secret collective of
operatives designed to outrun, outgun and Eliminate the most vile scum
and villainy the net has to offer.

F. How do I know if the COO is responsible for something?

If the COO's operatives are doing their job correctly, they'll be
laughing at whoever is actually responsible.

G. Who are the leaders of the COO?

Leaders? Where we function we don't need Leaders.

H. What is the Beer Fund?

The more you contribute to it, the more we will tell you.

I. How may I apply to become an operative of the COO?

Pitiful begging at the Vote Wrangler's feet might help. Then again it
might not.

19. Who is the FNVW?

Why, our highly esteemed Friendly Neighbourhood Vote Wrangler (FNVW),
whose benevolent supreme dictatorship runs the electoral wheels of our
great realm. Seven fearless folk have served, with distinction:

AUK VOTE WRANGLERS

Craig Dickson (1994-1995)
Matthew Legare (1995-1997)
Killfile Daemons (1997)
Robbie Honerkamp (1997-1998)
Phoenix (1997-2004)
Peter J Ross (2004-2006)
Sean Monaghan (2006-Present)

On retirement, Phoenix accepted the high office of Friendly Neighborhood
"Bob"father.

20. Do I have what it takes to BE a Vote Wrangler?

<chortle> If you have to ask, you don't have what it takes.

21. Who do you %$#@!s think you are to oppose ME, Lord High Poster-Child
of the Macrocosmic Universe?

We are the ones who can and will humiliate your @$$ if you use our group
as your personal piss bowl. You are a freak of the universe. You do not
give the orders here. And whether you like it or not, the universe is
laughing behind your back.

22. That was MEAN, just plain MEAN!!!

Payback's a bitch, ain't it?

23. Should I expect ONE CONSISTENT response to my rude and obnoxious
online behavior from the denizens of AUK?

Absolutely NOT.

24. To whom should I complain if I think I have been treated unfairly?

<Darth Vader>
You think you have been treated unfairly? </Darth Vader>

25. What kind of response can I expect as a result of my stupid online
behavior at AUK?

Guilty party receives one or a combination thereof of the following
assorted reactions (not at all limited to these, mind you):

1. Complete silence while we blow you off
2. Complete silence while we reload
3. Complete silence while we pull the plug on your account
4. Complete silence while we sleep at the switch
5. Complete silence while we sleep in our beds
6. Complete silence while we laugh behind your back
7. Complete silence while we wipe the splattered food and/or drinks off
our screens
8. Complete silence while we contemplate the known macrocosmic universe
9. Complete silence while the Vote Wrangler pays good money to watch
professional Denver teams find new ways to lose
10. Complete silence while we bask in the pure glow of our obnoxiously
self-righteous selves
11. Complete silence while we play high-stakes poker with Snoopy, Spike,
Andy, Olaf, Marbles and Woodstock
12. Complete silence while we never notice your NoCeM'd post
13. Complete silence while we never notice your spam-canceled post
14. Complete silence while we run your rude and obnoxious posts through
goofyizers for reposting
15. Complete silence while the Trekkies among us watch the USS Defiant
blast bad guys' ships into rubble and fly through the debris with that
nice halo of sparks effect
16. Complete silence while we wait for our Gates-sponsored software
systems to uncrash themselves
17. General laughter at your expense
18. General laughter and pointing at your expense
19. General laughter, pointing and personal insults at your expense
20. Someone exposes your true service provider to the Rabble
21. Someone does any of 1-20 and reports you to your state's Attorney
General
22. Someone does any of 1-21 and reports you to the FBI National
Computer Crime Squad (nccs@fbi.gov)
23. Someone does any of 1-22 and does highly amusing parodies of you
during the entire process
24. Talk amongst ourselves about life, love and why they sell 8-hot-dog
weenie sets with 10-bun packages
25. Sounds of awe as we wonder with dropped mouths how you were able to
make a greater fool of yourself than you already had
26. Sounds of astonishment as we MARVEL at the FREAK
27. Flames in your generally specific direction
28. Flames of you in the third, fourth and fifth person
29. Flames from the Vote Wrangler from the other side of the Galactic
Killfile just to annoy all hell out of you
30. Nominations for many noteworthy Kook awards

26. Can I really be kicked off my ISP for...

  Being a total @$$hole?

If you try hard enough.

  Top-posting like the pathetic imbecile that I am?

Usually not, but we can always try.

  Forging someone else's valid e-mail address?

Absolutely.

  Posting multiple copies of the same message to individual news groups
(Excessive Multi Posting [EMP])?

Of course. It's the SPAMMING, stupid.

27. Can I really be thrown in jail for posting threatening messages?

Yes. People have been tried and convicted for sending threatening or
harassing Email or Usenet posts. We do NOT support censorship of the
Internet; however, posting a message stating you are going to cause
virtual or unvirtual harm to someone will probably gain you a visit from
your Friendly Neighborhood FBI Agent.

28. Fine. I'll just remain anonymous. That'll work, right?

BWWAAAAAAAAA HA HA HA HA HA HA HA HA HA!!!!!!!!!!!!!!

Try it, pinkboy. An anon remailer service can be forced to turn you in
for copyright violation, harassment, stalking; you name the crime -
they've got the time. If you ran an anon remailer service what would be
the point of protecting flagrant abusers of the net and the Law??

29. Okay, then I'll bust your #$%&$*!! @$$ off AUK instead!

Uh... yeah. Many denizens of AUK are abuse admins, know abuse admins,
sleep with abuse admins, or otherwise have years of experience dealing
with and educating others about precisely your kind of dubiosity. A good
account is a terrible thing to waste, so don't sacrifice yours on our
altar.

30. I just realized I am a Maroon. How can I improve my standing in the
eyes of the Internet, my balloon doll, and, most importantly, "Bob"?

REPENT. The End is always near.


------------------------------

Date: 5 Sep 2006 09:59:59 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to handle jpegs inside Net::NNTP
Message-Id: <gbbqf2hsjkekgbvi7lh9hpn3ilmttn57ln@4ax.com>

On 5 Sep 2006 00:00:39 -0700, usenet@DavidFilmer.com wrote:

>> $;                                   # A lone dollar?
>> =$";                                 # Pod?
>> $;                                   # The return of the lone dollar?
>> {Just=>another=>Perl=>Hacker=>}      # Bare block?
>> =$/;                                 # More pod?
>> print%;                              # No right operand for %?
>
>I kept staring at that and saying, NO WAY WILL THAT JAPH COMPILE.  And
>damned if it doesn't.  I still have no idea how. Now I gotta go figure
>it out...

Granted, *any* of Abigail's japhs is awesome almost by definition.
But... we both know perl is free form: if you just remove a pair of
newlines and think that $; and %; are variable names like any other,
then it's not that obscure any more, althouth not less brilliant and
fascinating!

$; = $";
$;{Just=>another=>Perl=>Hacker=>} = $/;
print %; ;


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: 5 Sep 2006 01:40:53 -0700
From: mattjones@hotmail.co.uk
Subject: Re: Insert Log file into oracle table
Message-Id: <1157445653.724900.168190@m73g2000cwd.googlegroups.com>

Right, I've managed to input the data so i can move on to the next bit
of the script.

I was thinking someone would have a go at me for posting such a
question! I've got the programming perl and the perl DBI books but
sometimes its good to have someone explain it for you...

Thanks for everyones help anyway. 

Matt



------------------------------

Date: Tue, 05 Sep 2006 10:46:53 +0200
From: =?ISO-8859-1?Q?S=E9bastien_Cottalorda?= <spp_icarsNOSPAM@yahoo.fr>
Subject: Re: IO::Socket server
Message-Id: <44fd397e$0$31424$626a54ce@news.free.fr>

deadpickle@gmail.com a écrit :
> This is what I got:
> server.pl
> use strict;
> use IO::Socket;
> my $sock = new IO::Socket::INET(
>                    LocalHost => 'localhost',
>                    LocalPort => 7890,
>                    Proto     => 'tcp',
>                    Listen    => SOMAXCONN,
>                    Reuse     => 1);
> $sock or die "no socket :$!";
> my($new_sock, $c_addr, $buf);
> while (($new_sock, $c_addr) = $sock->accept()) {
>     my ($client_port, $c_ip) =
>                      sockaddr_in($c_addr);
>     my $client_ipnum = inet_ntoa($c_ip);
>     my $client_host =
>              gethostbyaddr($c_ip, AF_INET);
>     print "got a connection from: $client_host",
>           " [$client_ipnum]\n";
>     while (defined ($buf = <$new_sock>)) {
>         print $buf;
>     }
> }
> 
> client.pl
> use strict;
> use IO::Socket;
> my $file =
> my $host = shift || 'localhost';
> my $port = shift || 7890;
> my $sock = new IO::Socket::INET(
>                    PeerAddr => $host,
>                    PeerPort => $port,
>                    Proto    => 'tcp');
> $sock or die "no socket :$!";
> 
> What I want it to do is have the server on one computer and the client
> on the other. I want the client to connect to the server and request a
> file. I want the server to send the file to the client. Its a simple
> text file so its not very large. I want it to do this over again until
> it is closed. I dont know much about perl programming so any help would
> be very appriciated.
> 
Hi,

Here are some clues:

Server side:
============
Examine what you've received from the client (you ever listen first)
1-/ if client sent you "FILE|...", the second column is a filename, open 
it (send "NACK|reason" if you're unable to open file) and send it 
through the socket with "FIL|" before
2-/ if client sent you "QUIT|", then close the socket (Normally never used)
3-/ Else, reply "NACK|Command not understood"
In every case, after the job, close the socket.

[snip]
while (defined ($buf = <$new_sock>)) {
	chomp($buf);
	if ($buf=~/^FILE\|/){
		my $filename = (split /\|/, $buf)[1];
		unless (open (FH, "<", $filename)){
			print $new_sock "NACK|File '$filename' do not exists\n";
		}
		else {
			while (my $line =<FH>){
				chomp($line);
				print $new_sock "FIL|".$line."\n";
			}
			close(FH);
			print $new_sock "EOT|\n";
		}
		last;
	}
	elsif ($buf=~/^QUIT\|/){
		last;
	else {
		print $new_sock "NACK|Command not understood\n";
		last;
	}
}
close ($new_sock);



Client side:
============
The client talk first in every case:

use strict;
use IO::Socket;
my $file =
my $host = shift || 'localhost';
my $port = shift || 7890;
my $sock = new IO::Socket::INET(
                     PeerAddr => $host,
                     PeerPort => $port,
                     Proto    => 'tcp');
$sock or die "no socket :$!";
#--------------/ Socket opened \----------------
$filename=......; # the file to be sent by the server side
$fileout=.....; # the file in which we should place received datas
unless (open (FH_RECEPTION, ">",  $fileout)){
	die "Unable to create $fileout $!";
}
print $sock "FILE|$filename\n";
my @elem=();
my $all_received;
while (my $line=<$sock>){
	chomp($line);
	@elem = split /\|/, $line;
	if ($elem[0]=~/^FIL\|/){
		print FH_RECEPTION $elem[1]."\n";
		$all_received=0;
	}
	elsif ($elem[0]=~/^EOT\|/){
		print "Normal End of Transmission received\n";
		$all_received=1;
		last;
	}
	elsif ($elem[0]=~/^NACK\|/){
		print "ERROR: $elem[1]\n";
		last;
	}
	else {
		print "Do not understand|$line\n";
		last;
	}
}
close($sock);
close(FH_RECEPTION);
if ((defined $all_received) and ($all_received==1)){
	print "Everything has been received in $fileout\n";
}
elsif (defined $all_received) {
	print "some part of the file has been received in $fileout\n";
}

BE CAREFULL0: I consider that you're file didn't contains the '|' 
character. If so, you should replace it with another not used character.
BE CAREFULL1: on both server and client side, as coded, you don't manage 
timeouts : use IO::Select for that.
BE CAREFULL2: I didn't check the codes.

Hope this helps.

Sebastien


------------------------------

Date: Tue, 05 Sep 2006 07:20:38 GMT
From: "Clyde Ingram" <clydenospamorham@nospamorhamgetofftheline.freeservenospamorham.co.uk>
Subject: IPC on Win XP: messages, shared memory
Message-Id: <az9Lg.3925$7D6.3399@newsfe2-win.ntli.net>

1. IPC::Msg is described as being for System V.
2. Win32::IPC appears not to support IPCs using messages or shared memory.
3. On ActiveState Perl 5.8.8, the default IPC library omits IPC::Msg.  Win32 
library offers little promise.

Am I right in concluding that unrelated processes on Windows XP (Pro) cannot 
do inter-process communication using either messages or shared memory?

Thank-you,
Clyde 




------------------------------

Date: 5 Sep 2006 09:27:45 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: map tricks
Message-Id: <2d9qf2tcbuais35vav4mu152n6lvaq317s@4ax.com>

On Mon, 04 Sep 2006 17:08:35 -0400, Uri Guttman <uri@stemsystems.com>
wrote:

>and i did say you can use classic perl slurping techniques. but

Hadn't seen the followup yet.

>the easiest way to show a m/// assigned to a hash was with the module.

Not really sure:

  use File::Slurp ;
  
  my %hash = read_file( $ARGV[0] ) =~ /^([^:]+):(.+)$/mg ;

as opposed to

  my %hash = qx/cat $ARGV[0]/ =~ /^([^:]+):(.+)$/mg ;

(which is *not* what I'd use, but the OP was already using backticks.
Oh, c'mon not really wanting to start a flame, especially... for
*this*!)


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Tue, 05 Sep 2006 03:33:07 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: map tricks
Message-Id: <x7bqpu7op8.fsf@mail.sysarch.com>

>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:

  MD>   my %hash = read_file( $ARGV[0] ) =~ /^([^:]+):(.+)$/mg ;

  MD> as opposed to

  MD>   my %hash = qx/cat $ARGV[0]/ =~ /^([^:]+):(.+)$/mg ;

  MD> (which is *not* what I'd use, but the OP was already using backticks.
  MD> Oh, c'mon not really wanting to start a flame, especially... for
  MD> *this*!)

you said BACKTICKS! i HATE BACKTICKS!! they ruined my marriage, caused
my bankrupty and they also trigger my lumbago!!

"slowly i turn, step by step ...."

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Tue, 05 Sep 2006 10:50:18 +0200
From: =?ISO-8859-1?Q?S=E9bastien_Cottalorda?= <spp_icarsNOSPAM@yahoo.fr>
Subject: Re: Perl socket timeout
Message-Id: <44fd3a4b$0$31419$626a54ce@news.free.fr>

mdemmitt@gmail.com a écrit :
> Hi,
>    I am new to perl socket programming.  I have written a simple perl
> server.  I call:
> $client = $server->accept()
> 
> I want the $client socket to timeout and automatically close after 15
> seconds.  Is this possible.  I've googled for this, but can't find
> anything specific to my question.  Anyone have experience with this.
> 
> -Mike
> 
Hi,

perldoc -f alarm

Hope this helps.

Sebastien


------------------------------

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 9686
***************************************


home help back first fref pref prev next nref lref last post