[28320] in Perl-Users-Digest
Perl-Users Digest, Issue: 9684 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 5 03:05:59 2006
Date: Tue, 5 Sep 2006 00:05:07 -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: 9684
Today's topics:
Re: (Off topic) Cyberwar question <1usa@llenroc.ude.invalid>
Re: Allowing threading with CGI <youknows@gmail.com>
Re: Close a Running Sub-Process <ced@blv-sam-01.ca.boeing.com>
Re: Cygwin error regarding profile.global <mgarrish@gmail.com>
Re: Cygwin error regarding profile.global <mgarrish@gmail.com>
Re: Cygwin error regarding profile.global <1usa@llenroc.ude.invalid>
How to handle jpegs inside Net::NNTP <fishfry@your-mailbox.com>
Re: How to handle jpegs inside Net::NNTP <abigail@abigail.be>
Re: How to handle jpegs inside Net::NNTP usenet@DavidFilmer.com
Re: Insert Log file into oracle table <addinall@addinall.org>
IO::Socket server deadpickle@gmail.com
Re: IO::Socket server usenet@DavidFilmer.com
new CPAN modules on Tue Sep 5 2006 (Randal Schwartz)
Perl socket timeout mdemmitt@gmail.com
Re: Problems detecting multiple clients <bryan@worldspice.net>
Re: References - problem understanding them <AaronJSherman@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 05 Sep 2006 02:40:13 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <Xns9834E69E21DF7asu1cornelledu@127.0.0.1>
John Bokma <john@castleamber.com> wrote in
news:Xns9834B349E217Acastleamber@130.133.1.4:
> "Jürgen Exner" <jurgenex@hotmail.com> wrote:
>
>> Yours for a better Usenet
>
> Writing versatel.nl about Skybuck might indeed help for a better Usenet,
Done.
> ploinking nor posting "I ploinked you" does :-).
It is satisfying, though.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: 4 Sep 2006 21:06:50 -0700
From: "alpha_beta_release" <youknows@gmail.com>
Subject: Re: Allowing threading with CGI
Message-Id: <1157429210.035354.42140@m79g2000cwm.googlegroups.com>
And here excerpt from the error.log
[Tue Sep 05 12:02:36 2006] [notice] Apache/2.2.2 (Win32) configured --
resuming normal operations
[Tue Sep 05 12:02:36 2006] [notice] Server built: Apr 29 2006 18:32:31
[Tue Sep 05 12:02:36 2006] [notice] Parent: Created child process 4004
[Tue Sep 05 12:02:36 2006] [notice] Child 4004: Child process is
running
[Tue Sep 05 12:02:36 2006] [notice] Child 4004: Acquired the start
mutex.
[Tue Sep 05 12:02:36 2006] [notice] Child 4004: Starting 250 worker
threads.
[Tue Sep 05 12:02:36 2006] [notice] Child 4004: Starting thread to
listen on port 80.
xhoster@gmail.com wrote:
> "alpha_beta_release" <youknows@gmail.com> wrote:
> > That's weird. Is it just my system?
> > I don't think there's any informative thing about the message. Anyway,
> > here's the message
> > "Perl Command Line Interpreter has encountered a problem and needs to
> > close. We are sorry for the inconvenience."
> >
> > I run it on Windows, using Apache as HTTP server
>
> It worked for me on Linux with Apache. Sorry, I can't test it on
> Windows/Apache. Now that we have working code, maybe someone else can.
>
> Maybe it is an Apache for Windows configuration issue.
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 5 Sep 2006 05:21:41 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Close a Running Sub-Process
Message-Id: <J53tK3.78n@news.boeing.com>
mumebuhi wrote:
>>> You capture the pid of the running process (it is the return value of a
>>> pipe open), and then you kill it just prior to the close.
>>>
>>> my $pid=open my $fh, $cmd or die $!;
>>> #....
>>> kill 1,$pid;
>>> close $fh;
>
> This is it. This is the perfect solution for the time being. The
> particular remote process, fortunately, does not need to be killed
> because it is intended that way. I am with you that this is probably
> not a safe if the remote process needs to be cleaned up properly.
>
'HUP' works but there's a potentially safer Unix idiom using 'TERM' and
'KILL':
kill 'TERM',$pid or kill 'KILL',$pid
or warn "couldn't signal $pid";
Alternatively, returning the remote pid followed by an 'exec' enables
signaling the remote process directly:
my $child_process = "ssh id@host 'echo $$; exec tail --follow=name'"
..
$remote_pid = <$fh>;
while (<$fh>) {
...
if ( /some_condition/ ) {
system "ssh... 'kill -s TERM $remote_pid'"
..
hth,
--
Charles DeRykus
------------------------------
Date: 4 Sep 2006 18:05:41 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Cygwin error regarding profile.global
Message-Id: <1157418341.049325.251050@b28g2000cwb.googlegroups.com>
bearti...@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?
> 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?
> 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.
Matt
------------------------------
Date: 4 Sep 2006 18:18:18 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Cygwin error regarding profile.global
Message-Id: <1157419098.715834.95420@e3g2000cwe.googlegroups.com>
Matt Garrish wrote:
> 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
> >
> > And did you happen to notice that, despite your assertion that posting
> > OT is "stupid", you've now done it repeatedly?
> >
> > Yes, I too am beginning to think that "moron" is a particularly
> > inarticulate way to describe you.
> >
> > Now, you were saying....?
> >
My apologies for this. Our little friend only pretended he'd posted to
alt.usenet.kooks by setting a followup, so in posting it back here I
bunged something up in google groups. That this guy doesn't see he's
the only nut still floors me, but whatever gets you off...
Matt
------------------------------
Date: Tue, 05 Sep 2006 02:35:20 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Cygwin error regarding profile.global
Message-Id: <Xns9834E5C9F7B34asu1cornelledu@127.0.0.1>
Tad McClellan <tadmc@augustmail.com> wrote in
news:slrnefovf6.a80.tadmc@magna.augustmail.com:
> Jürgen Exner <jurgenex@hotmail.com> wrote:
>> beartiger@gmail.com wrote:
>
>
>>> Fuck you.
>>
>> ***PLONK***
>
>
> I did that almost a year ago.
Me tooooo! AOL ;-) (Sorry, couldn't resist)
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Mon, 04 Sep 2006 22:40:52 -0700
From: fishfry <fishfry@your-mailbox.com>
Subject: How to handle jpegs inside Net::NNTP
Message-Id: <fishfry-CB17E8.22405204092006@comcast.dca.giganews.com>
I can fetch a message ok with Net::NNTP, but if it contains a jpeg, I
can't see how to properly save the image data to make a jpg readable by
Photoshop. Any pointers appreciated.
------------------------------
Date: 05 Sep 2006 06:27:00 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: How to handle jpegs inside Net::NNTP
Message-Id: <slrnefq65g.6dg.abigail@alexandra.abigail.be>
fishfry (fishfry@your-mailbox.com) wrote on MMMMDCCLIII September
MCMXCIII in <URL:news:fishfry-CB17E8.22405204092006@comcast.dca.giganews.com>:
<> I can fetch a message ok with Net::NNTP, but if it contains a jpeg, I
<> can't see how to properly save the image data to make a jpg readable by
<> Photoshop. Any pointers appreciated.
Well, you don't show any code, don't tell us what you've tried and
where you failed.
I usually get the article body, decode it, and write it to a file.
No rocket science there.
Perhaps Photoshop requires files in a certain format?
Abigail
--
$; # A lone dollar?
=$"; # Pod?
$; # The return of the lone dollar?
{Just=>another=>Perl=>Hacker=>} # Bare block?
=$/; # More pod?
print%; # No right operand for %?
------------------------------
Date: 5 Sep 2006 00:00:39 -0700
From: usenet@DavidFilmer.com
Subject: Re: How to handle jpegs inside Net::NNTP
Message-Id: <1157439639.236520.11370@b28g2000cwb.googlegroups.com>
Abigail wrote:
[after cutline]
> $; # 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...
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: 4 Sep 2006 20:59:01 -0700
From: "addinall" <addinall@addinall.org>
Subject: Re: Insert Log file into oracle table
Message-Id: <1157428741.197973.235150@i3g2000cwc.googlegroups.com>
mattjones@hotmail.co.uk wrote:
> addinall schrieb:
> >
> > Right, so I've created a CLOB field (didn't realise!) and my code is now:
>
> #!/usr/central/bin/perl -w
>
> use strict;
> use DBI;
>
> #!/usr/central/bin/perl -w
>
> use strict;
> use DBI;
>
> my $dbh = DBI ->connect("dbi:Oracle:SERVER", "DATABASE", "PASSWORD")
> or die "Couldn't connect to database: $DBI::errstr\n";
>
> my $LOG = open (LOG, "/home/USERNAME/PERL/hello.log");
>
> my @data = <LOG>;
> close LOG;
At this stage $LOG SHOULD contain '1' if the OPEN opened.
You should test this.
>
> my $rows = $dbh->do("
> INSERT INTO LOGS VALUES ( 'wesdf', 'sdfg', 'dfg', 'fdg', 'dfg', 'dfg',
> 'dfg', 'dfg', $LOG) ");
You are sticking $LOG into the database and ignoring your data!
Don't worry, I've done that a few times ;-)
Cheers,
Mark Addinall.
>
> $dbh->disconnect;
>
> exit;
> >
> > > The 9th value to be inserted '$LOG' is supposed to read in hello.log. But i am still getting the value 1. Im using TOAD so can check it straight away by refreshing the schema browser.
>
> I want to get this working before I think about what i have to enter
> into the fields. But for your info: i have to search through 1 log file
> at a time and pull out specific information (which are not delimited!).
> Some of the lines are repetitious so i can't just define a value to
> pull out. I have written some code on this and it basically pulls out
> the lines i want - I was hoping that TOAD would let me then, filter out
> the info on display!
>
> > > Thanks for your help.....ive been working on this script for a while so this was my last resort - I was just given this to do and I hadn't even used oracle or written any PERL before!!!
>
> Matt
------------------------------
Date: 4 Sep 2006 22:23:15 -0700
From: deadpickle@gmail.com
Subject: IO::Socket server
Message-Id: <1157433794.975724.84650@i3g2000cwc.googlegroups.com>
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.
------------------------------
Date: 4 Sep 2006 23:50:43 -0700
From: usenet@DavidFilmer.com
Subject: Re: IO::Socket server
Message-Id: <1157439043.274942.83670@i42g2000cwa.googlegroups.com>
deadpickle wrote:
> [snip multiposted question]
Don't multipost. It's rude.
(the bot is still offline, but it sent me an e-mail)
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Tue, 5 Sep 2006 04:42:08 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue Sep 5 2006
Message-Id: <J53rq8.s0r@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Acme-MetaSyntactic-0.90
http://search.cpan.org/~book/Acme-MetaSyntactic-0.90/
Themed metasyntactic variables names
----
Apache-AuthenRadius-0.9
http://search.cpan.org/~daniel/Apache-AuthenRadius-0.9/
Authentication via a Radius server
----
App-Context-0.964
http://search.cpan.org/~spadkins/App-Context-0.964/
An application framework for web applications, command-line programs, server programs, and web services
----
App-Repository-0.964
http://search.cpan.org/~spadkins/App-Repository-0.964/
Logical data access layer for the App::Context Framework, providing a uniform API to access data in databases, file systems, remote web sites, etc.
----
App-Widget-0.964
http://search.cpan.org/~spadkins/App-Widget-0.964/
Family of web user interface widgets for the App::Context Framework, enabling development of complex UI's in a CGI, mod_perl, or other web context
----
Bio-NEXUS-0.66
http://search.cpan.org/~tjhladish/Bio-NEXUS-0.66/
Installation Instructions.
----
Business-OnlinePayment-CashCow-0.05
http://search.cpan.org/~jonasbn/Business-OnlinePayment-CashCow-0.05/
Online payment processing via CashCow
----
Cairo-1.00
http://search.cpan.org/~tsch/Cairo-1.00/
Perl interface to the cairo library
----
Catalyst-Plugin-Session-State-URI-0.06
http://search.cpan.org/~nuffin/Catalyst-Plugin-Session-State-URI-0.06/
Saves session IDs by rewriting URIs delivered to the client, and extracting the session ID from requested URIs.
----
Catalyst-Plugin-Session-Store-Delegate-0.02
http://search.cpan.org/~nuffin/Catalyst-Plugin-Session-Store-Delegate-0.02/
Delegate session storage to an application model object.
----
Class-Accessor-Named-0.005
http://search.cpan.org/~jesse/Class-Accessor-Named-0.005/
Better profiling output for Class::Accessor
----
Class-Workflow-0.01_02
http://search.cpan.org/~nuffin/Class-Workflow-0.01_02/
Light weight workflow system.
----
Class-Workflow-0.01_03
http://search.cpan.org/~nuffin/Class-Workflow-0.01_03/
Light weight workflow system.
----
Config-File-1.4
http://search.cpan.org/~gwolf/Config-File-1.4/
Parse a simple configuration file
----
Device-USB-0.17
http://search.cpan.org/~gwadej/Device-USB-0.17/
Use libusb to access USB devices.
----
ExtUtils-Autoconf-0.01
http://search.cpan.org/~flora/ExtUtils-Autoconf-0.01/
Perl interface to GNU autoconf
----
FreeBSD-Sendfile-0.01
http://search.cpan.org/~markim/FreeBSD-Sendfile-0.01/
Wrapper for the FreeBSD sendfile(2) function.
----
Games-EternalLands-0.04
http://search.cpan.org/~franc/Games-EternalLands-0.04/
----
Getopt-Compact-0.04
http://search.cpan.org/~asw/Getopt-Compact-0.04/
getopt processing in a compact statement with both long and short options, and usage functionality.
----
Glib-1.140
http://search.cpan.org/~tsch/Glib-1.140/
Perl wrappers for the GLib utility and Object libraries
----
Gnome2-GConf-1.040
http://search.cpan.org/~ebassi/Gnome2-GConf-1.040/
Perl wrappers for the GConf configuration engine.
----
Gtk2-1.140
http://search.cpan.org/~tsch/Gtk2-1.140/
Perl interface to the 2.x series of the Gimp Toolkit library
----
Gtk2-GladeXML-1.006
http://search.cpan.org/~tsch/Gtk2-GladeXML-1.006/
Create user interfaces directly from Glade XML files.
----
HTML-DisableForm-0.01
http://search.cpan.org/~naoya/HTML-DisableForm-0.01/
Manipulate disabled/readonly HTML Forms
----
Handel-0.99_08
http://search.cpan.org/~claco/Handel-0.99_08/
Simple commerce framework with AxKit/TT/Catalyst support
----
Markup-Perl-0.5
http://search.cpan.org/~mmathews/Markup-Perl-0.5/
turn your CGI inside-out
----
Net-Analysis-0.05
http://search.cpan.org/~worrall/Net-Analysis-0.05/
Modules for analysing network traffic
----
Net-IMAP-Simple-NB-1.1
http://search.cpan.org/~msergeant/Net-IMAP-Simple-NB-1.1/
Non-blocking IMAP.
----
POE-Filter-LZF-1.3
http://search.cpan.org/~bingos/POE-Filter-LZF-1.3/
A POE filter wrapped around Compress::LZF
----
Plagger-0.7.11
http://search.cpan.org/~miyagawa/Plagger-0.7.11/
Pluggable RSS/Atom Aggregator
----
RT-View-ConciseSpreadsheet-0.002
http://search.cpan.org/~jesse/RT-View-ConciseSpreadsheet-0.002/
[One line description of module's purpose here]
----
SQL-Shell-1.13
http://search.cpan.org/~bbc/SQL-Shell-1.13/
command interpreter for DBI shells
----
Sys-Sendfile-FreeBSD-0.01
http://search.cpan.org/~markim/Sys-Sendfile-FreeBSD-0.01/
Wrapper for the FreeBSD sendfile(2) function.
----
TeX-Encode-0.8
http://search.cpan.org/~timbrody/TeX-Encode-0.8/
Encode/decode Perl utf-8 strings into TeX
----
Template-Plugin-DisableForm-0.01
http://search.cpan.org/~naoya/Template-Plugin-DisableForm-0.01/
TT plugin for HTML::DisableForm
----
Test-Simple-0.64_01
http://search.cpan.org/~mschwern/Test-Simple-0.64_01/
Basic utilities for writing tests.
----
Text-Hatena-0.15
http://search.cpan.org/~jkondo/Text-Hatena-0.15/
Perl extension for formatting text with Hatena Style.
----
Time-Piece-1.10
http://search.cpan.org/~msergeant/Time-Piece-1.10/
Object Oriented time objects
----
Time-Tiny-0.01
http://search.cpan.org/~adamk/Time-Tiny-0.01/
A time object, with as little code as possible
----
WWW-Search-Ebay-2.226
http://search.cpan.org/~mthurn/WWW-Search-Ebay-2.226/
backend for searching www.ebay.com
----
WWW-Shorten-Reduus-0.01
http://search.cpan.org/~jmadler/WWW-Shorten-Reduus-0.01/
Perl interface to redu.us
----
Web-Scaffold-0.02
http://search.cpan.org/~miker/Web-Scaffold-0.02/
build minimalist fancy web sites
----
Win32-MediaPlayer-0.2
http://search.cpan.org/~kenwu/Win32-MediaPlayer-0.2/
Module for playing sound MP3 / WMA / WAV / MIDI file on Win32 platforms
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 4 Sep 2006 21:22:06 -0700
From: mdemmitt@gmail.com
Subject: Perl socket timeout
Message-Id: <1157430126.940907.170080@e3g2000cwe.googlegroups.com>
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
------------------------------
Date: 4 Sep 2006 18:35:02 -0700
From: "samasama" <bryan@worldspice.net>
Subject: Re: Problems detecting multiple clients
Message-Id: <1157420102.515676.90600@m73g2000cwd.googlegroups.com>
> That only deletes connections which are denied due to chk_multi_conn. What
> about the connections that are acceptedable and then at some point down the
> road get closed naturally?
*nod*, that's why I was messing with other deletes, which with what you
already said didn't make any sense at all. Noted.
>
> You might want to pass them into the subs, instead of using them globally.
> Yes, it can be more annoying to write initially (and no, I don't always
> follow my own advice), but it is generally worth it in the long run.
I'll try that, I'm not worried about annoyances, just writing better
code.
> I don't know cookbook it is from, or what it looks like originally, but
> I'm pretty sure it didn't look like that. You must have screwed something
> up in the conversion. One thing to note is that $CLIENT doesn't appear
> productively anywhere in that code. How can it tell if CLIENT shows up
> more than once when it doesn't even care about what CLIENT is?
>
> What you end up with is that %count holds the count of the number of times
> each IP address is connected, and $times holds that count for one
> (unpredictably) arbitrary IP address.
First edition, and yes I mangled it a bit...
>From the cookbook:
%count = ();
foreach $element (@ARRAY) {
$count{$element}++;
}
> after you fork, you do something like
> $pid_list{$pid}=$CLIENT->peerhost;
>
> Then when "wait" gives you a pid, you look it up in the %pid_list hash to
> see what IP needs to be deleted from %ip_conns.
>
Ahhhhhh! Ok that makes sense!
Thanks so much for your help.
I'm sure I'll be back following up in a day or two with progress
hopefully : )
--
samasama
------------------------------
Date: 4 Sep 2006 21:24:35 -0700
From: "Aaron Sherman" <AaronJSherman@gmail.com>
Subject: Re: References - problem understanding them
Message-Id: <1157430275.245681.29540@h48g2000cwc.googlegroups.com>
J=FCrgen Exner wrote:
> J=FCrgen Herz wrote:
> > Aaron Sherman wrote:
> >
> >> In reality they're the same thing, but what you should not do is
> >> confuse lexically scoped variables with stack-allocated variables in
> >> C. You essentially have no access to the stack at all in Perl. The
> >> "Perl stack" is malloced memory, and items allocated on it are freed
> >> when they are no longer referenced. By creating a reference to your
> >> lexically scoped hash, you asked Perl not to release it.
> Sorry, but I strongly disagree. Pointers in C are memory addresses,
As are SV*s
> something that otherwise you find in assembler. You can manipulate them, =
you
> can add or subtract to the address, etc, etc.
> A reference in Perl is an _abstract_, well, reference to one concrete
> object.
No. That might be how you like to think of it, but that's not what it
is. It's an area of malloced memory that Perl maintains a pointer to.
That memory, in trun, can contain a pointer to another SV, and that
target SV is almost always informed of the pointer relationship in
order to allow for reference count-based garbage collection.
> On an implementation level it may be implemented as a C
> pointer, but it could just as well be an index into some variable list or
> whatever. As a Perl programmer you don't know and you don't care.
But as a C programmer, understanding the implementation helps in the
understanding, and this need to abstract away the guts is what
typically gets people into trouble trying to understand high level
languages, when they are coming from low-level langauges.
> C forces
> the programmer to implement memory management manually while Perl does it
> automatically. There is not new(), malloc(), or free() in Perl.
This is also not true. C gives you fewer tools, and provides fewer
implicit behaviors, but just by way of example, the way the C call
stack is managed is most certainly memory management, and if you don't
believe me, try calling alloca(3).
Perl also requires and allows you to do memory management, but it is
all done through SVs, HVs, AVs, GVs, etc. Somtimes this is quite
important. For example, you can control de-allocation of an array in
three ways, each of which has its own behavior: assign an empty list,
"undef" it, take it out of scope. How memory allocation is affected is
not only different in all three cases, but HOW it is different is
documented as part of the language.
------------------------------
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 9684
***************************************