[25587] in Perl-Users-Digest
Perl-Users Digest, Issue: 7831 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 25 11:05:59 2005
Date: Fri, 25 Feb 2005 08:05:31 -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 Fri, 25 Feb 2005 Volume: 10 Number: 7831
Today's topics:
'warn' produces additional output <news@chaos-net.de>
Re: 'warn' produces additional output <do-not-use@invalid.net>
Re: 'warn' produces additional output <news@chaos-net.de>
Re: Annoying Problem with a Basic Perl app and XP Pro <bastard@uni-koblenz.de>
Re: BerkeleyDB locking question <admin@asarian-host.net>
Re: BerkeleyDB locking question <admin@asarian-host.net>
Re: BerkeleyDB locking question <Paul.Marquess@btinternet.com>
Re: Comparing huge XML Files nospam@geniegate.com
Re: CPAN problem <phaylon@dunkelheit.at>
Re: create thread from within another? (Anno Siegel)
Re: create thread from within another? <gargoyle@no.spam>
Re: Division/math bug in perl? <phaylon@dunkelheit.at>
Re: Division/math bug in perl? <geoff@invalid.invalid>
Do sparse arrays take up full memory? <giblin@panix.com>
Re: Do sparse arrays take up full memory? <do-not-use@invalid.net>
How to convert latin1 to utf8 francescomoi@europe.com
Re: How to convert latin1 to utf8 <phaylon@dunkelheit.at>
Re: Incorrect password <darkon.tdo@gmail.com>
Re: maximum size of a hash table (Anno Siegel)
Re: Parsing a chemical formal <luotao@milliways.kammer.uni-hannover.de>
perl network sniffer <jamiethacker@gmail.com>
Re: perl network sniffer <phaylon@dunkelheit.at>
Re: perl network sniffer <jamiethacker@gmail.com>
Re: perl network sniffer <phaylon@dunkelheit.at>
Pure Perl OpenSSL Library <dkm@kataplop.net>
Re: Read from keyboard <jl_post@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Feb 2005 15:08:47 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: 'warn' produces additional output
Message-Id: <slrnd1ucbf.b3a.news@maki.homeunix.net>
The following script produces a few lines of output on STDERR.
Some of the lines are supposed to be red (works at least on zsh, bash
and tcsh).
First question:
Why is there a trailing line after "Output line two" with a leading
space character?
" at ./warn.pl line 9."
The only difference between the two warn statements is the position of
the "\n".
Second question:
What are the general prerequisites which cause 'warn' to produce this
additional output?
---- code ----
#!/usr/bin/perl
# use warnings;
use strict;
print "Output line one:\n";
warn "\tMy statusmessage\n";
print "Output line two:\n";
warn "\033\[1;31m \tMy statusmessage\n\033\[1;00m"; # this is line 9
print "Output line three:\n";
warn "\033\[1;31m \tMy statusmessage\033\[1;00m\n";
--- end code ---
--
perl -e '$|=1;&p(7.74.117.115.116.32);&s();&p(97.110.111);&p(116.104.101
.114);&s;&p(32.112.101.114.108);&s();&p(32.104.97.99.107.101.114.10);sub
s{sleep 1};sub p(){print "@_"}'
------------------------------
Date: 25 Feb 2005 15:39:22 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: 'warn' produces additional output
Message-Id: <yzd8y5cya91.fsf@invalid.net>
Martin Kissner <news@chaos-net.de> writes:
> The following script produces a few lines of output on STDERR.
> Some of the lines are supposed to be red (works at least on zsh, bash
> and tcsh).
>
> First question:
> Why is there a trailing line after "Output line two" with a leading
> space character?
> " at ./warn.pl line 9."
> The only difference between the two warn statements is the position of
> the "\n".
>
> Second question:
> What are the general prerequisites which cause 'warn' to produce this
> additional output?
"perldoc -f warn" says:
Produces a message on STDERR just like "die", but
doesn't exit or throw an exception.
And "perldoc -f die" says:
If the last element of LIST does not end in a
newline, the current script line number and input
line number (if any) are also printed, and a newline
is supplied.
Does this explain what you see?
------------------------------
Date: Fri, 25 Feb 2005 16:19:07 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: Re: 'warn' produces additional output
Message-Id: <slrnd1ugfb.blv.news@maki.homeunix.net>
Arndt Jonasson wrote :
>
> "perldoc -f warn" says:
> Produces a message on STDERR just like "die", but
> doesn't exit or throw an exception.
>
> And "perldoc -f die" says:
> If the last element of LIST does not end in a
> newline, the current script line number and input
> line number (if any) are also printed, and a newline
> is supplied.
>
> Does this explain what you see?
That's perfect. Thank you.
I did check 'perldoc -f warn' and I also checked a book, but I didn't
read 'perldoc -f die' (I should have done so).
Best regards
Martin
--
perl -e '$|=1;&p(7.74.117.115.116.32);&s();&p(97.110.111);&p(116.104.101
.114);&s;&p(32.112.101.114.108);&s();&p(32.104.97.99.107.101.114.10);sub
s{sleep 1};sub p(){print "@_"}'
------------------------------
Date: Fri, 25 Feb 2005 15:01:04 +0100
From: Dimitri Papoutsis <bastard@uni-koblenz.de>
Subject: Re: Annoying Problem with a Basic Perl app and XP Pro
Message-Id: <cvn78p$l4g$1@news.uni-koblenz.de>
Sam Holden wrote:
> On 24 Feb 2005 16:53:48 GMT,
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>> Sam Holden <sholden@cs.usyd.edu.au> wrote in comp.lang.perl.misc:
>>> On 24 Feb 2005 14:13:47 GMT,
>>> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>>> > Dimitri Papoutsis <bastard@uni-koblenz.de> wrote in
>>> > comp.lang.perl.misc:
>>> >
>>> >> Definition: Pseudo-trial:
>>> >> not even tried to do sth. but babbling as if...
>>> >
>>> > A trial is an experiment (if it isn't an interrogation). The word you
>>> > want is "attempt".
>>>
>>> A lot of common usage and a few dictionaries disagree with that and
>>> include "to make an effort to do" as one of the meanings of
>>> try.
>>
>> The distinction is exactly what I'm getting at, but that's "try".
>> "Trial" appears to have a somewhat specialized meaning.
>
> Ahh. I completely missed the "Pseudo-trial" part and saw only the "tried"
> part.
>
[OT]
;o)
aaaaaaaaahhhhh all right, now i get the point... there's always new
knowledge to accumulate. My mistake is based upon dict.leo.org. Furthermore
i was not aware about the possible difference between "trial" and
"attempt". Thank you, guys..
[/OT]
bye
dnp
------------------------------
Date: Fri, 25 Feb 2005 13:06:04 +0100
From: "Mark" <admin@asarian-host.net>
Subject: Re: BerkeleyDB locking question
Message-Id: <2pqdnXmNDd41iYLfRVnyhA@giganews.com>
"Paul Marquess" <Paul.Marquess@btinternet.com> wrote in message
news:386vufF5kehhoU1@individual.net...
> Nice summary Dan. The only thing I would add is to make sure that these
> "environment" files must be stored on a local disk. Berkeley DB
> locking doesn't work on network drives.
After testing BerkeleyDB for several days now, I must say I find it vastly
superior to DB_File. :)
One last question remains, though. When I "exit" a program, are there any
special needs to close/untie handles and or hashes? Or are the objects
silently destroyed? I would not want to have data corrupted because of
mishandindling this area.
Thanks,
- Mark
------------------------------
Date: Fri, 25 Feb 2005 15:06:26 +0100
From: "Mark" <admin@asarian-host.net>
Subject: Re: BerkeleyDB locking question
Message-Id: <rLqdnWh8kPpGrYLfRVnyhw@giganews.com>
"Paul Marquess" <Paul.Marquess@btinternet.com> wrote in message
news:386vufF5kehhoU1@individual.net...
Odd; where is the shared memory, btw? I loaded several databases, the way
you suggested; then did an "ipcs" to watch shared memory segments (I have
48MB of it available), yet I see no pages assigned to BerkeleyDB. I guess
it is using mmap by default. So, I tried opening my $env like this:
-Flags => DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL|DB_SYSTEM_MEM
But $BerkeleyDB::Error said: "Invalid argument". Obviously, I am still
mising something. :) If you, or others, know what it is, I'd love to hear
it.
Thanks,
- Mark
------------------------------
Date: Fri, 25 Feb 2005 15:09:46 -0000
From: "Paul Marquess" <Paul.Marquess@btinternet.com>
Subject: Re: BerkeleyDB locking question
Message-Id: <388tdqF5fsk5qU1@individual.net>
"Mark" <admin@asarian-host.net> wrote in message
news:2pqdnXmNDd41iYLfRVnyhA@giganews.com...
> "Paul Marquess" <Paul.Marquess@btinternet.com> wrote in message
> news:386vufF5kehhoU1@individual.net...
>
> > Nice summary Dan. The only thing I would add is to make sure that these
> > "environment" files must be stored on a local disk. Berkeley DB
> > locking doesn't work on network drives.
>
> After testing BerkeleyDB for several days now, I must say I find it vastly
> superior to DB_File. :)
>
> One last question remains, though. When I "exit" a program, are there any
> special needs to close/untie handles and or hashes? Or are the objects
> silently destroyed? I would not want to have data corrupted because of
> mishandindling this area.
I arrange for all open connections to be gracefully closed on shotdown.
Paul
------------------------------
Date: Fri, 25 Feb 2005 13:17:20 GMT
From: nospam@geniegate.com
Subject: Re: Comparing huge XML Files
Message-Id: <Lucy1109333857213720x64b1cc@air.tunestar.net>
In: <1109294676.165910.32400@g14g2000cwa.googlegroups.com>, "junnuthala" <junnuthula@yahoo.com> wrote:
>Thanks for all the replies.
>
>But for a 6MB XML file, having more than 300,000 elements, XML::Parser
>module is taking almost 35 minutes to get the parsed result as a tree.
>
>Any suggestions why the XML::Parser is taking so much time to parse a
>moderately big file?
You might want it in event-driven mode, I don't know about 300,000 elements,
but I've seen it saw through very large XML documents at blazing speed using
the event driven model. (especially in cases where you're only interested in
the attributes, but thats probably not the case here)
Here's a hint for speed: Only use the callbacks you actually need.
Listening to an event will cause it to jump out of it's compiled code and into
your perl code. Leaving callbacks undefined (unless you really need them) will
avoid this step.
Try taking a pass at it w/out any callbacks turned on, then introduce your
callbacks to find the bottlenecks.
If you really need in memory trees, could you maybe break the document down
into several smaller ones? It *might* be faster to invent your own tree
structures in this case, something optimized for read-only access. (I've done
this before but it's kind of time consuming, really only useful in extreme
cases, like if you need to compare over and over and over)
Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
------------------------------
Date: Fri, 25 Feb 2005 12:38:48 +0100
From: Robert Sedlacek <phaylon@dunkelheit.at>
Subject: Re: CPAN problem
Message-Id: <pan.2005.02.25.11.38.48.477674@dunkelheit.at>
roger wrote:
> I don't understand why it thinks it is failing to download them when
> clearly it is succeeding.
Hm, the only thing I could think of is that you have a router between you
and the outside world with a firewall or something. If not, I'm afraid
that I'm out of ideas..
--
http://www.dunkelheit.at/
codito, ergo sum.
------------------------------
Date: 25 Feb 2005 12:34:36 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: create thread from within another?
Message-Id: <cvn60s$rek$2@mamenchi.zrz.TU-Berlin.DE>
gargoyle <gargoyle@no.spam> wrote in comp.lang.perl.misc:
> I'm using ActivePerl 5.8.6.811 and have a question regarding threads.
>
> What are the implications of starting a thread from within another (as
> opposed to starting all threads from the main thread, ie. tid 0)? Will
> any nasty bugs or strange issues come to bite me? In other words, was
> the ithreads model written to handle this sort of behavior?
>
> The reason I'm asking is because I'm trying to find a way to keep memory
> footprint to a minimum, and yet be able to spawn new threads at any
> given time. I figured a "dispatcher" thread could be started as early
> as possible (before most modules are loaded, data structures filled,
> etc.) and then when a new worker thread is needed, main could signal the
> dispatcher (via a queue) and tell it to create a new thread with some
> specific parameters (based on the job that needs to be accomplished at
> that given moment).
What makes you think you can conserve memory that way?
Unlike a child process, a thread handles concurrency in the address
space of one process. It doesn't duplicate everything you have loaded
at the point of dispatch.
Anno
------------------------------
Date: Fri, 25 Feb 2005 13:49:18 GMT
From: gargoyle <gargoyle@no.spam>
Subject: Re: create thread from within another?
Message-Id: <y1GTd.20683$hd6.20189@bignews1.bellsouth.net>
On 2005-02-25, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> What makes you think you can conserve memory that way?
This short paragraph (in perlthrtut):
Performance considerations
The main thing to bear in mind when comparing ithreads to
other threading models is the fact that for each new
thread created, a complete copy of all the variables and
data of the parent thread has to be taken. Thus thread
creation can be quite expensive, both in terms of memory
usage and time spent in creation. The ideal way to reduce
these costs is to have a relatively short number of long-
lived threads, all created fairly early on - before the
base thread has accumulated too much data.
> Unlike a child process, a thread handles concurrency in the address
> space of one process. It doesn't duplicate everything you have loaded
> at the point of dispatch.
I don't understand this. The man page explains that all existing variables
get copied over to the new thread (except they don't get shared unless
you explicitely request that). I tried starting threads earlier in the
program and noticed /substantial/ memory savings (several MB). And that
was just my own data structures taking up all that space! I haven't even
gotten to the point of replacing all the "use SomeModule;" lines with an
equivalent "require SomeModule; import SomeModule;" to avoid incurring
the overhead of unnecessary modules in threads which don't need them...
But back to the original question. Can I spawn a thread from within
another, or will that break anything?
------------------------------
Date: Fri, 25 Feb 2005 12:36:44 +0100
From: Robert Sedlacek <phaylon@dunkelheit.at>
Subject: Re: Division/math bug in perl?
Message-Id: <pan.2005.02.25.11.36.44.532779@dunkelheit.at>
Snail wrote:
> Any hand calculator I've tried gives -3 for int (-2.6), like a texas
> instruments graphing calc.
If you're looking for that, you may give the POSIX package a chance, I
think there were rounding functions. hth.
--
http://www.dunkelheit.at/
The first rule of project mayhem is: you do not ask questions.
-- Fight Club
------------------------------
Date: Fri, 25 Feb 2005 16:03:42 GMT
From: Geoff <geoff@invalid.invalid>
Subject: Re: Division/math bug in perl?
Message-Id: <gehu11tnvkscstie2tj0635le1fcvcvgnm@4ax.com>
On Thu, 24 Feb 2005 12:46:47 -0800, "Snail" <snail@localhost.com>
wrote:
>Why is this:
>
>$ perl -e 'print (int (-2.6), "\n")'
>-2
>
>Shouldn't it be -3? I thought converting from float to int is supposed
>to give the integer part, which is -3, and not round towards zero, as it
>seems to be doing, resulting in -2? For that matter, why does c/c++ do
>this too?
>
>Any hand calculator I've tried gives -3 for int (-2.6), like a texas
>instruments graphing calc.
>
>To it's credit, perl correctly does mod func correctly:
>
>$ perl -e 'print (-13 % 5, "\n")'
>2
>
>Where as in c/c++ you get -3, which is mathematically incorrect. (Any
>hand calculator I've tried gives 2 for the above operation.)
>
There is no int() function in C.
One may _cast_ a float to an int, but this is not a function call.
The effects of this are platform and implementation dependent per the
standard. This was due to the history of C from it's inception.
Here's what the ANSI C documentation has to say:
"When an object of floating type is converted to an integral type, the
fractional part is truncated. No rounding takes place in the
conversion process."
The ANSI, <float.h> was an attempt to characterize the
implementation-dependent behavior of the floating point types so that
a coder could detect at compile time the nature of the environment and
avoid errors. Likewise, <limits.h> was an attempt to characterize the
integral types.
For example, in Perl what would happen if you performed int(-33000.0)?
According to C's <limits.h> INT_MIN is -32767, unless Perl
automatically converts it to a long, the result should be an error. If
it silently converts it to a long how will the program behave if what
the programmer presumes is an int is used in a bitmap context?
In C++ it is the designer of the class who determines the behavior of
the operator. A proper numeric class might have an int operator that
takes the integer part of a floating type and a round operator that
rounds a float to the nearest integer.
------------------------------
Date: 25 Feb 2005 07:28:42 -0800
From: "Ian" <giblin@panix.com>
Subject: Do sparse arrays take up full memory?
Message-Id: <1109345322.783846.128100@l41g2000cwc.googlegroups.com>
I always thought that
my @array;
$array[0] = 1;
$array[99] = 1;
....would only use two array elements' worth of memory. After reading
some of the documentation, I'm not so sure. What's the real answer
please?
Thanks!
Ian.
------------------------------
Date: 25 Feb 2005 16:42:44 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: Do sparse arrays take up full memory?
Message-Id: <yzd4qg0y7bf.fsf@invalid.net>
"Ian" <giblin@panix.com> writes:
> I always thought that
>
> my @array;
> $array[0] = 1;
> $array[99] = 1;
>
> ....would only use two array elements' worth of memory. After reading
> some of the documentation, I'm not so sure. What's the real answer
> please?
As an experiment, I ran
#! /usr/local/bin/perl
$a[1] = 1;
sleep 10;
$a[10000000] = 1;
sleep 100000;
and used a process monitoring tool to see perl's memory usage. It
jumped from around 2 Meg to 66 Meg, so it seems it does fill in the
intermediate elements.
(This was in perl 5.8.5.)
If you use large sparse arrays a lot, maybe hash tables are better.
------------------------------
Date: 25 Feb 2005 07:53:47 -0800
From: francescomoi@europe.com
Subject: How to convert latin1 to utf8
Message-Id: <1109346827.595966.50590@z14g2000cwz.googlegroups.com>
Hi.
I've got some texts in Latin1 and like to convert to UTF-8.
Is this possible with 'Unicode::String'???
Thank you very much.
------------------------------
Date: Fri, 25 Feb 2005 16:57:10 +0100
From: Robert Sedlacek <phaylon@dunkelheit.at>
Subject: Re: How to convert latin1 to utf8
Message-Id: <pan.2005.02.25.15.57.10.950138@dunkelheit.at>
francescomoi wrote:
> Is this possible with 'Unicode::String'???
The Docs seem so, but I think I would C<use Encode;>.
--
http://www.dunkelheit.at/
...and in darkness bind them.
------------------------------
Date: Fri, 25 Feb 2005 15:48:03 -0000
From: "David K. Wall" <darkon.tdo@gmail.com>
Subject: Re: Incorrect password
Message-Id: <Xns96086DDF394CFdkwwashere@216.168.3.30>
Mounilk <mounilkadakia@hotmail.com> wrote:
> hi ted,
^
tr/et/aT/
:-)
------------------------------
Date: 25 Feb 2005 12:09:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: maximum size of a hash table
Message-Id: <cvn4ii$rek$1@mamenchi.zrz.TU-Berlin.DE>
John Bokma <postmaster@castleamber.com> wrote in comp.lang.perl.misc:
> Tassilo v. Parseval wrote:
>
> > Also sprach John Bokma:
>
> > Yet, the number of those bits (as
> > you put it) has no bearing on the capacity of a hash. You could use a
> > hash function that only returns 2bit-wide numbers and still store an
> > amount of items only limited by the available memory in the hash.
>
> Yes, but than one ends up with a hash table with O(n) look up time :-)
> So if the hash function is limited to n bits there is a point that the hash
> table acts more like 2^n big lists instead of a hash table.
That's no contradiction. A hash of size k (with this kind of collision
management) *is* a way to distribute a long list of length n over k
lists of average length n/k, no more, no less. Keeping the average
length <= 1 is an option, but not the only way to run a hash.
Anno
------------------------------
Date: 25 Feb 2005 15:20:39 GMT
From: Luotao Fu <luotao@milliways.kammer.uni-hannover.de>
Subject: Re: Parsing a chemical formal
Message-Id: <slrnd1ughm.5o3.luotao@milliways.kammer.uni-hannover.de>
Hi,
GreenLeaf <newspost@kohombanDELETE.net> schrieb:
> Abigail wrote:
>
>> I wouldn't use split, just parse what you want to keep. What you want is
>> very simple: exactly one capital letter, followed by zero or more lower
>> case letters, followed by zero or more numbers. Written as a regex, this
>> is:
>
@Abigail:
fancy idea! Now the famous Question to myself: If this is simple, why
haven't I gotten it myself? ;-) works like a charm, thanx a lot.
> to OP:
>
> If this is an exercise, considering the real world scenario, you might
> want to consider the rule that an element name is always exactly one
> capital letter followed by _exactly zero or one simple letter_, with the
> exception of elements that start with Uu. I'm assuming here that yours
> is a program for learning, since you admitted to write it 'since days'
>:). Considering these facts will make your re more robust.
;-) Actually it's not an exercise, the perlscript should format Database
Files for my C Programm, which handles with CT Scanners. On the other side,
I'm indeed learning Perl though writing this. I'd also had written it in C,
but I chose perl to refresh my Memory on RegExp.
>
> You might also want to consider the radicals (such as hydroxyl -OH)
> because they are sure to lead to incorrect results if you just ignore
> parenthesis: for instance Fe(OH)3. You can do this by first capturing
> parenthesis and numbers that follow, then running the same simple rules
> that you used to capture no-parenthesis case for the token within each
> set of parenthesis. Something along the line of
>
> my @atoms = /((?:\(.+\)|Uu.|[A-Z][a-z]?)\d*)/g;
>
> would work here.
>
Thanx for the advise, I didn't think about this one. However it might
not be a serious problem for me. We have limited the Input on only Stuffs
containing the first 100 Elements on the periodic Table. Which is more
important, I define the formatrules of the Inputfiles. I'll notice
in the Readme, that such formats are forbidden :-).
> Since Abigail's post clearly gave you almost everything you need to
> know, it would be quite straightforward to implement these simple
> changes. Good luck! :)
>
> Hope this helps,
Thanx a lot
> sat
Cheers
Luotao Fu
------------------------------
Date: 25 Feb 2005 07:48:22 -0800
From: "jamie@nospam.com" <jamiethacker@gmail.com>
Subject: perl network sniffer
Message-Id: <1109346502.419144.239280@o13g2000cwo.googlegroups.com>
I have a linux router/gateway in our office. The "pointy haired boss"
wants to moniter the internet activity for the office. I need to
capture the URL requested and the source ip for all the machines on the
network. Can anyone suggest some good places to start. I searched on
CPAN and am unsure which of the packages would be most useful. Any
help would be much appreciated.
Thanks
------------------------------
Date: Fri, 25 Feb 2005 16:54:19 +0100
From: Robert Sedlacek <phaylon@dunkelheit.at>
Subject: Re: perl network sniffer
Message-Id: <pan.2005.02.25.15.54.19.350316@dunkelheit.at>
jamie@nospam.com wrote:
> Can anyone suggest some good places to start.
Google for "Proxy", that's not a Perl related question.
--
http://www.dunkelheit.at/
The first rule of project mayhem is: you do not ask questions.
-- Fight Club
------------------------------
Date: 25 Feb 2005 07:58:11 -0800
From: "jamie@nospam.com" <jamiethacker@gmail.com>
Subject: Re: perl network sniffer
Message-Id: <1109347090.971005.152420@g14g2000cwa.googlegroups.com>
<Google for "Proxy">
I realize that it would be simple enought to place a proxy in the
"mix", however that is not possible with our current layout. The point
is that I would like to do it, if possible, with perl. I would like
the information to be inserted into a mysql db (which i have no
problems doing). Is this not possible using perl?
------------------------------
Date: Fri, 25 Feb 2005 17:02:52 +0100
From: Robert Sedlacek <phaylon@dunkelheit.at>
Subject: Re: perl network sniffer
Message-Id: <pan.2005.02.25.16.02.52.25593@dunkelheit.at>
jamie@nospam.com wrote:
> I realize that it would be simple enought to place a proxy in the "mix",
> however that is not possible with our current layout. The point is that I
> would like to do it, if possible, with perl. I would like the information
> to be inserted into a mysql db (which i have no problems doing). Is this
> not possible using perl?
Haven't you seen HTTP::Proxy at CPAN? What's wrong with it? Let me guess,
you wanted to hear "other opinions"?
--
http://www.dunkelheit.at/
-<[::..::::..::::..]>-
------------------------------
Date: Fri, 25 Feb 2005 14:41:47 +0100
From: "Marc" <dkm@kataplop.net>
Subject: Pure Perl OpenSSL Library
Message-Id: <421f2b0e@epflnews.epfl.ch>
Hi,
I'm developping a software that needs to act as a Certificate
Authority. I must use Perl for this.
I would like to avoid forking at each certificate request as there will
be several requests within seconds. The problem is that every SSL
modules I can find for Perl are using the openssl command line.
Can someone point me to/give me the name of a projet that has (even if
not complete) a pure Perl/C OpenSSL library?
I would be very surprised if no such project exist...but who knows? :)
Marc
------------------------------
Date: 25 Feb 2005 06:10:50 -0800
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: Read from keyboard
Message-Id: <1109340650.940454.291650@g14g2000cwa.googlegroups.com>
> jl_post@hotmail.com wrote:
> > So here's a question: Why does omitting "perl" prevent the
input
> > from being read in correctly?
GreenLeaf replied:
>
> I think this is answered above. 'Opening' a non-executable in windows
> means opening in it the designated application. Just curious: what's
> your default association for file type .pl? If it's the editor and if
> you had already opened the file, it may be the case that you did not
> notice it.
My default association for file type .pl is perl (specifically,
D:\Perl\bin\perl.exe). The script I showed you definitely runs. It's
hard to tell as that one-line script, so let me propose this slightly
longer script, named "cat.pl":
# Code:
print "Running $0 ...\n";
print <>;
Now, when I type:
cat.pl cat.pl
at the prompt I get the expected output:
Running path\cat.pl ...
# Code:
print "Running $0 ...\n";
print <>;
But when I type:
cat.pl < cat.pl
I just get:
Running path\cat.pl ...
and when I type this (using DOS "type" which is like Unix "cat"):
type cat.pl | cat.pl
I get the output:
Running path\cat.pl ...
The process tried to write to a nonexistent pipe.
I'm clueless as to why I get the error message of a nonexistent pipe.
When I place "perl" in front of cat.pl, like this:
perl cat.pl < cat.pl
or:
type cat.pl | perl cat.pl
I get the expected output of:
Running cat.pl ...
# Code:
print "Running $0 ...\n";
print <>;
Obviously, even without "perl" at the command line the Perl script
is still running (otherwise it wouldn't print "Running ..."), but it
seems to have problems reading in standard input when read from a pipe
or from re-direction. Of course, this problem only happens under
Win32-DOS (Unix flavors don't seem to have this problem).
This is an odd problem that can be easily "fixed" by placing "perl"
in front of the script to be executed, so it's not a huge show-stopper
problem. But still, it's nice to know about it in case it ever comes
up.
If anyone knows why this happens (that is, omitting "perl" under a
Win32-DOS command-line causes a script to have problems reading STDIN
from a pipe), feel free to let me know.
-- Jean-Luc
------------------------------
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 7831
***************************************