[21867] in Perl-Users-Digest
Perl-Users Digest, Issue: 4071 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 6 09:07:07 2002
Date: Wed, 6 Nov 2002 06:05:11 -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 Wed, 6 Nov 2002 Volume: 10 Number: 4071
Today's topics:
a perl poem <xnovotn3@informatics.muni.cz>
Re: a perl poem <zzapper@ntlworld.com>
Re: A vision for Parrot <slaven.rezic@berlin.de>
Re: A vision for Parrot <robin@jessikat.fsnet.co.uk>
Re: A vision for Parrot <graham.lee@wadham.ox.ac.uk>
Re: Do scripts use the CPU while sleeping? (Hobo)
Re: fork() and socket? edgue@web.de
Re: fork() and socket? <goldbb2@earthlink.net>
Re: fork() and socket? edgue@web.de
How much faster is dbm over MySQL (Hobo)
Re: How much faster is dbm over MySQL <bernard.el-hagin@DODGE_THISlido-tech.net>
How to convert an array of numbers to a single sting <tim@melonhead.remove.net>
Re: How to convert an array of numbers to a single stin edgue@web.de
Re: How to convert an array of numbers to a single stin <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: How to convert an array of numbers to a single stin <tim@melonhead.remove.net>
Re: How to convert an array of numbers to a single stin <bart.lateur@pandora.be>
Net::FTP how can I change directory? (Jim McCallum)
Re: Perl as scripting language <spam@all.costs.must.die>
Re: Perl script not writing under cron <spam@all.costs.must.die>
Re: Q: Reading process memory on Win32? (Andrea LN Spinelli)
Sending Ethernet RARP packets (Michel Tokic)
Simple question - What is unicode? <erdstein@telstra.com>
Re: Simple question - What is unicode? (Helgi Briem)
Re: split() results limited to 32k length? (Noam Stopak)
Re: Strange Performance Thing <me@privacy.net>
Re: Strange Performance Thing <goldbb2@earthlink.net>
Trapping System to System calls (amar)
Re: What port number is used when using POST <spam@all.costs.must.die>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 6 Nov 2002 09:56:49 GMT
From: Daniel Novotny <xnovotn3@informatics.muni.cz>
Subject: a perl poem
Message-Id: <H55FMK.CI0@news.muni.cz>
die if defined undef;
die ("ouch!") if not exists $meaning_of{life};
kill time;
do { not kill caller } if "phone rings";
------------------------------
Date: Wed, 06 Nov 2002 12:10:30 +0000
From: zzapper <zzapper@ntlworld.com>
Subject: Re: a perl poem
Message-Id: <ui1isu8skjhgvp43j1a4b8ke5p4gjni853@4ax.com>
On Wed, 6 Nov 2002 09:56:49 GMT, Daniel Novotny
<xnovotn3@informatics.muni.cz> wrote:
>die if defined undef;
>die ("ouch!") if not exists $meaning_of{life};
>kill time;
>do { not kill caller } if "phone rings";
2b||!2b?
------------------------------
Date: 06 Nov 2002 09:13:03 +0100
From: Slaven Rezic <slaven.rezic@berlin.de>
Subject: Re: A vision for Parrot
Message-Id: <87adknt8ts.fsf@vran.herceg.de>
Benjamin Goldberg <goldbb2@earthlink.net> writes:
> Frodo Morris wrote:
> >
> > Benjamin Goldberg wrote:
> > > Frodo Morris wrote:
[...]
>
> > Why not leave it running, so that any Perl/Python/Tcl/Ruby/Java/sh/
> > BASIC/whatever code can get to it immediately?
>
> Ignoring the problem of compiling those languages down to parrot
> bytecode...
>
> How should the kernel detect that a parrot-bytecode file is, in fact,
> parrot bytecode?
>
> For normal exe files, there's the execute bit and some standard headers.
> For normal scripts, there's the execute bit and the #! line.
At least on *BSD, /sys/kern/imgact_*.c control which executable types
are allowed. There are imgact_aout.c, imgact_elf.c, imgact_gzip.c and
imgact_shell.c, and maybe one could add an imgact_parrot.c?
Regards,
Slaven
--
Slaven Rezic - slaven.rezic@berlin.de
Berlin Perl Mongers - http://berliner.pm.org
------------------------------
Date: Wed, 6 Nov 2002 09:07:57 +0000
From: Robin Becker <robin@jessikat.fsnet.co.uk>
Subject: Re: A vision for Parrot
Message-Id: <3pE8dhAtvNy9EwoQ@jessikat.fsnet.co.uk>
.
......
>
>A key part of his proposal was that Guile would support translators
>from other languages, like Python, C, etc., to Guile.
>
>It didn't happen. Writing those translators are hard because each
>of the languages has different object models, which must be implemented
>nearly perfectly. Guile is a full-fledge language built on years of
>research into Lisp and scheme, so I would be surprised if it was any
>easier to implement in Parrot's byte code. It didn't happen with
>Guile, it's even less likely to happen with Parrot.
......
Isn't it a commonplace that the n x m translation problem is best solved
by having a common intermediate? This seems more efficient when
m+n < n*m
it seems that only those with sufficient muscle can force this on the
world eg Sun/IBM/M$. They can clearly see the need to support only one
backend.
Funnily enough they kept telling me that as soon as I switched to
F99/C++ etc etc that everything would be portable. Now the buzz is
C#/Mono or Java, and perhaps Parrot. As long as the wheels keep turning
and the $'s flow they'll keep promising the next sliced bread.
--
Robin Becker
------------------------------
Date: Wed, 06 Nov 2002 12:28:09 +0000
From: Frodo Morris <graham.lee@wadham.ox.ac.uk>
Subject: Re: A vision for Parrot
Message-Id: <aqb1pt$sdl$2@news.ox.ac.uk>
Benjamin Goldberg wrote:
> Frodo Morris wrote:
>
>>Benjamin Goldberg wrote:
>>
>>>Frodo Morris wrote:
>>>
>>>
>>>>Daniel Pfeiffer wrote:
>>>>
>>>>
>>>>>Hi,
>>>>>Apache would essentially have a mod_parrot. Maybe, if this can be
>>>>>tested very hard, we'd even have a Parrot kernel module for all
>>>>>Unices supporting that. Then exec() could perform compiled scripts
>>>>>right away, like machine code :-)
>>>>
>>>>I would have thought that a more platform-independent version of
>>>>this would be, say, a parrotd, which sits on top of the kernel,
>>>>intercepts calls to exec() bytecode and spawns the relevant
>>>>processes.
>>>
>>>
>>>What advantage would this have over putting a #! line in the
>>>bytecode?
>>>
>>
>>Faster, better, cheaper.
>>Imagine if parrot could understand all interpreted code.
>
>
> It can't. Parrot can only understand parrot bytecode.
>
>
>>Why not leave it running, so that any Perl/Python/Tcl/Ruby/Java/sh/
>>BASIC/whatever code can get to it immediately?
>
>
> Ignoring the problem of compiling those languages down to parrot
> bytecode...
>
> How should the kernel detect that a parrot-bytecode file is, in fact,
> parrot bytecode?
>
> For normal exe files, there's the execute bit and some standard headers.
> For normal scripts, there's the execute bit and the #! line.
It would be advantageous to performance if a pre-byte-compiled version
of the script hangs around that can be launched directly by parrot.
IANAE but doesn't Python do this already? And doesn't Java *require* this?
--
FM
------------------------------
Date: Wed, 06 Nov 2002 03:54:13 -0800
From: myusenetclient@requiresthis.com (Hobo)
Subject: Re: Do scripts use the CPU while sleeping?
Message-Id: <myusenetclient-0611020354130001@63-93-75-203.lsan.cwia.com>
In article <3DC8C2DE.3A667C6D@earthlink.net>, Benjamin Goldberg
<goldbb2@earthlink.net> wrote:
>
> Good! So, you're smart enough to switch from formmail.pl to something
> safer, more secure?
>
I am not referring to formmail. I should have made that more clear.
>
> None -- but that doesn't matter, since an attacker can make multiple
> connections to your web browser simultaneously, so you've got many
> instances of your script running... the 60 second sleep has very little
> effect at stopping spammers from taking advantage of it, except that it
> will annoy legitimate users of your program, and if your machine is
> attacked, it will use more resources on your computer.
1. If you have multiple instances and global variables and one of the
variables(email address) is changed in one awake instance do the sleeping
scripts use the new email address when they wake?
2. You used "web browser". I assume you meant something else.
3. Is "multiple connections" different from repeated connections? If the
spammer bot has to wait for the form result to return I believe that would
mean a 60 sec wait. If the spam bot is making what I would call parallel
attempts then I could see how the wait would be pointless. Please inform
me further on this topic.
------------------------------
Date: Wed, 06 Nov 2002 09:22:05 +0100
From: edgue@web.de
Subject: Re: fork() and socket?
Message-Id: <3DC8D12D.8070700@web.de>
Hi there,
> Another way to do this would be to have the child processes only
> communicate to the parent, which synchronizes the transactions and
> sends/receives on the socket itself.
>
> SOCKET <--> Parent process <--> Multiple child processes
>
> Then only one process, the parent, is talking on the socket.
Correct; but unfortunately we cant do that.
We are testing hardware here; the child process has to control
some environment conditions - the parent process is running
different test exercisers in the meantime. So the parent process
might be busy for several minutes ... during this time, the
child process would not be able to do its job ;-(
For the same reason we cant synchronize on the ONE socket;
that would block the child process, too.
Looks like we have to go for the "one-connection-per-process"
solution.
Thanks for making me aware of that ;-]
regards,
------------------------------
Date: Wed, 06 Nov 2002 04:08:04 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: fork() and socket?
Message-Id: <3DC8DBF4.84593894@earthlink.net>
edgue@web.de wrote:
>
> Hi there,
>
> > Another way to do this would be to have the child processes only
> > communicate to the parent, which synchronizes the transactions and
> > sends/receives on the socket itself.
> >
> > SOCKET <--> Parent process <--> Multiple child processes
> >
> > Then only one process, the parent, is talking on the socket.
>
> Correct; but unfortunately we cant do that.
>
> We are testing hardware here; the child process has to control
> some environment conditions - the parent process is running
> different test exercisers in the meantime. So the parent process
> might be busy for several minutes ... during this time, the
> child process would not be able to do its job ;-(
>
> For the same reason we cant synchronize on the ONE socket;
> that would block the child process, too.
I'm not sure what you mean, when you say that you aren't able to
synchronize on the one socket... You obtain a lock, write to the
socket, then release the lock. Since the data which you intend to write
was produced before the lock was obtained, very little time is spent
obtaining and holding onto the lock -- thus, the child process is not
blocked for very long.
> Looks like we have to go for the "one-connection-per-process"
> solution.
Naah, you just have to look for a fast method way to locking then write
then unlock.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Wed, 06 Nov 2002 10:14:41 +0100
From: edgue@web.de
Subject: Re: fork() and socket?
Message-Id: <3DC8DD81.2090500@web.de>
Benjamin Goldberg wrote:
> I'm not sure what you mean, when you say that you aren't able to
> synchronize on the one socket... You obtain a lock, write to the
> socket, then release the lock. Since the data which you intend to write
> was produced before the lock was obtained, very little time is spent
> obtaining and holding onto the lock -- thus, the child process is not
> blocked for very long.
Problem is: the program sends a request to the server and waits for
an answer ... and the server might spend several minutes before
coming back. So the other process is locked out as long as the server
needs to process the request.
As I said: the child process has to control some environment things
(like regulating the temperature of hardware components). And it is a
very bad idea to postpone a request like "temp xxx is way to high; do
something about it" for 10 minutes because the child process is blocked
by the main process.
The flaw was already part of the design my mind: we have to do things
in parallel - so it was a bad idea to create only a unique resource
for that task. Time to fix that.
------------------------------
Date: Wed, 06 Nov 2002 04:07:46 -0800
From: myusenetclient@requiresthis.com (Hobo)
Subject: How much faster is dbm over MySQL
Message-Id: <myusenetclient-0611020407460001@63-93-75-203.lsan.cwia.com>
(Apologies if this is OT)
I often read that the various key-value databases you use with dbmopen are
faster than MySQL, but have never seen anything quantifiable. Exactly how
much faster? A rough estimate in some form other than "very" would be
appreciated. Also, what is the largest value I can enter using dbmopen on
whatever vesion of dbm Red Hat uses? Also, what version of dbm does Red
Hat use? I want to do simple key-value retrieval with large values ranging
from 10-20K, would I be better off with MySQL?
TIA
------------------------------
Date: Wed, 6 Nov 2002 12:40:11 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: How much faster is dbm over MySQL
Message-Id: <slrnashvo0.53f.bernard.el-hagin@gdndev25.lido-tech>
Hobo wrote:
> (Apologies if this is OT)
What the hell do you mean "if"? Which part of your post makes you
doubt whether it's a Perl question or not? Here, I've quoted it for
your convenience, maybe you can enlighten us:
> I often read that the various key-value databases you use with
> dbmopen are faster than MySQL, but have never seen anything
> quantifiable. Exactly how much faster? A rough estimate in some form
> other than "very" would be appreciated. Also, what is the largest
> value I can enter using dbmopen on whatever vesion of dbm Red Hat
> uses? Also, what version of dbm does Red Hat use? I want to do
> simple key-value retrieval with large values ranging from 10-20K,
> would I be better off with MySQL?
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Wed, 6 Nov 2002 09:17:36 -0000
From: "Melonhead" <tim@melonhead.remove.net>
Subject: How to convert an array of numbers to a single sting
Message-Id: <1036574302.88017.0@doris.uk.clara.net>
how do i get this to work so that the result is "123456", instead of 21?
@numbers=("1", "2", "3", "4", "5", "6");
for ($index=0; $index<@numbers; $index++) {
$string+="$numbers[$index]";
}
print $string;
regards,
------------------------------
Date: Wed, 06 Nov 2002 10:30:48 +0100
From: edgue@web.de
Subject: Re: How to convert an array of numbers to a single sting
Message-Id: <3DC8E148.50701@web.de>
Hi there,
Melonhead wrote:
> how do i get this to work so that the result is "123456", instead of 21?
You can use join():
@numbers=("1", "2", "3", "4", "5", "6");
my $str = join("", @numbers);
print "now it is: $str\n";
Or you can use the correct operator.
This is not java; "+" doesnt concate strings - "." does.
> @numbers=("1", "2", "3", "4", "5", "6");
>
> for ($index=0; $index<@numbers; $index++) {
$string .="$numbers[$index]";
> }
> print $string;
I would recommend to scan through the Perl func and Perl operator
man pages; it really helps to know what basic things are inside
a language ;-)
------------------------------
Date: Wed, 6 Nov 2002 09:31:50 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: How to convert an array of numbers to a single sting
Message-Id: <slrnashkmr.13s.bernard.el-hagin@gdndev25.lido-tech>
In article <1036574302.88017.0@doris.uk.clara.net>, Melonhead wrote:
> how do i get this to work so that the result is "123456", instead of 21?
>
> @numbers=("1", "2", "3", "4", "5", "6");
>
> for ($index=0; $index<@numbers; $index++) {
> $string+="$numbers[$index]";
> }
> print $string;
$string = join '', @numbers;
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Wed, 6 Nov 2002 10:13:56 -0000
From: "Melonhead" <tim@melonhead.remove.net>
Subject: Re: How to convert an array of numbers to a single sting
Message-Id: <1036577681.89878.0@doris.uk.clara.net>
Thanks,
"Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net> wrote in
message news:slrnashkmr.13s.bernard.el-hagin@gdndev25.lido-tech...
> In article <1036574302.88017.0@doris.uk.clara.net>, Melonhead wrote:
> > how do i get this to work so that the result is "123456", instead of 21?
> >
> > @numbers=("1", "2", "3", "4", "5", "6");
> >
> > for ($index=0; $index<@numbers; $index++) {
> > $string+="$numbers[$index]";
> > }
> > print $string;
>
>
> $string = join '', @numbers;
>
>
> Cheers,
> Bernard
> --
> echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Wed, 06 Nov 2002 10:52:58 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: How to convert an array of numbers to a single sting
Message-Id: <qqshsu8jvm0nesv7882k5pmhu9j9i1nmu1@4ax.com>
Melonhead wrote:
>how do i get this to work so that the result is "123456", instead of 21?
>
>@numbers=("1", "2", "3", "4", "5", "6");
Either
$string = join '', @numbers;
or
local $" = ""; # or whatever you want between the elements
$string = "@numbers";
The latter is cute if you intend to use the concatenated string inside a
longer string anyway.
The local() is not absolute necessary (the assignment is). It is
intended to limit the scope of your modification to the block this
snippet is in (incl. subs called from this block), and not affect the
rest of the script. You may add an extra block on purpose, just to limit
the scope even more:
{
local $" = '';
$string = "@numbers";
}
--
Bart.
------------------------------
Date: Wed, 06 Nov 2002 13:53:42 GMT
From: 122@jmccallum.NOSPAMfree-online.co.uk (Jim McCallum)
Subject: Net::FTP how can I change directory?
Message-Id: <3dc91c47.17826696@newscore.theplanet.net>
Hi,
I'm runnig a perl program to do a bit of ftp'ing.
Its located and called
/home/myscripts/doftp.pl
It goes like this.
#!/usr/local/bin/perl -w
#
use Net::FTP;
$ftp = Net::FTP->new("$remote", Debug => 1);
$ftp->login("innova",'aspect47');
$ftp->cwd("/data/test/");
$ftp->get("that.file");
$ftp->quit;
Now that all seems fine, but the file "that.file" is
retrieved to the location from where I execute
my perl program, which is what I would expect.
What I would like to do is always retrieve to a
specific location.
I've tried $ftp->quot("lcd /home/specific/location");
before I do my get without any joy.
How can I do the above from within my perl program?
Jim
------------------------------
Date: Wed, 6 Nov 2002 23:23:29 +1100
From: "Tintin" <spam@all.costs.must.die>
Subject: Re: Perl as scripting language
Message-Id: <3dc909f2_1@news.iprimus.com.au>
"Seb Bean" <sebbean@charter.net> wrote in message
news:ushd1nsh8iasa3@corp.supernews.com...
> i've never used perl but i'm going to start soon
>
> i was just wondering...does perl have to be compiled or can it run by
itself
both.
------------------------------
Date: Wed, 6 Nov 2002 22:02:35 +1100
From: "Tintin" <spam@all.costs.must.die>
Subject: Re: Perl script not writing under cron
Message-Id: <3dc8f6fd_1@news.iprimus.com.au>
"John Joseph Trammell" <trammell+usenet@hypersloth.invalid> wrote in message
news:slrnasd49i.qsh.trammell+usenet@bayazid.el-swifto.com...
>> Cron can be a pain, as the environment can be very different
> from your user environment.
cron is never a pain if you write your scripts correctly and don't make
blind assumptions.
------------------------------
Date: Wed, 06 Nov 2002 10:54:08 GMT
From: aspinelli@etsteam.it (Andrea LN Spinelli)
Subject: Re: Q: Reading process memory on Win32?
Message-Id: <3dc8f420.4710888@powernews.iol.it>
On Tue, 05 Nov 2002 23:49:24 GMT, miketemp3@techinxs.com wrote:
>Hi,
>
>Currently, this problem has been addressed by several people with
>a C/C++ program to read an offset location in the client thread
>and display the decryption key/XXX number of bytes at that
>location.
If this is done just win Win32 API calls (kernel.dll or similar),
you just have to use Win32::API, which allows to call any
dll function from inside Perl (a nice Italian product..).
If you have access to the
C code, you should be able to translate easily.
Win32::API is available at
http://search.cpan.org/author/ACALPINI/Win32-API-0.20/
I am not aware of any direct implementation of what you
are requiring.
Good luck!
Andrea
--
Andrea Spinelli
IT&T, Via Sigismondi 40, Villa d'Alme', BG, Italy
e-mail: aspinelli@-deletehere-etsteam.it phone: +39-035-636029
"Truth hurts, but pimples much more!"
------------------------------
Date: 6 Nov 2002 02:17:03 -0800
From: michel@tokic.com (Michel Tokic)
Subject: Sending Ethernet RARP packets
Message-Id: <1e9d7925.0211060217.13616168@posting.google.com>
Hello,
in general how do I send I send Ethernet packets in Perl? Is there a
module other than NetPacket::ARP for sending RARP requests? Because
the encode function isn't implemented yet.
Does anyone has a sample script on how to send Ethernet packets?
Thanks a lot,
Michel
------------------------------
Date: Wed, 06 Nov 2002 13:46:11 GMT
From: "David" <erdstein@telstra.com>
Subject: Simple question - What is unicode?
Message-Id: <D29y9.20296$5u4.61793@news-server.bigpond.net.au>
What is unicode *.txt? There is an option to save a file in this format in
Excel.
The following code I wrote does not do what I expect it to do. It should
read in a file of names and then output the names, but when it outputs the
names it includes a space between each letter.
I spent close to an hour trying to solve this when I finally realised that I
had saved the original data file from Excel using unicode *.txt. When I
change to comma delimited *.txt it worked perfectly. But why? What is
unicode?
open (FILENAMES, $Filenames) || die "The file with the list of filenames
does not exist!\n Program Aborted!\n ";
while ($name_of_file = <FILENAMES>) { #look at each line in the list
chop($name_of_file);
print ("\n$name_of_file");
} #While loop
------------------------------
Date: Wed, 06 Nov 2002 14:03:01 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Simple question - What is unicode?
Message-Id: <3dc91fdf.1853265264@news.cis.dfn.de>
On Wed, 06 Nov 2002 13:46:11 GMT, "David"
<erdstein@telstra.com> wrote:
>What is unicode *.txt? There is an option to save a file in
>this format in Excel.
Unicode is a scheme for encoding alphabets other than
the Latin by encoding each character with 2 bytes instead
of 1. Perl 5.8 apparently has rather better unicode support
than previous Perls.
Here is a definition I found somewhere (don't ask):
Unicode
A standard, developed by the Unicode Consortium, that
governs character encoding and provides a 16-bit extensible
international character coding system for information
processing that covers the world's major languages. The
Unicode standard defines character encoding, and the
properties and algorithms that are used in its
implementation. The Unicode 2.1 standard defines encodings
for approximately 40,000 characters, and work is ongoing to
define encodings for additional characters.
--
Regards, Helgi Briem
helgi AT decode DOT is
A: Top posting
Q: What is the most irritating thing on Usenet?
- "Gordon" on apihna
------------------------------
Date: 6 Nov 2002 03:19:23 -0800
From: noam@orionsci.com (Noam Stopak)
Subject: Re: split() results limited to 32k length?
Message-Id: <8435e2fa.0211060319.2cd2262e@posting.google.com>
"F. Xavier Noria" <fxn@hashref.com> wrote in message news:<aqaf0h$ner$1@news.ya.com>...
> > - - - - cut here - - -
> > $chunk = " " x (37 * 1024);
> >
> > for (1..37) {
> > ~ $data .= $chunk . "x";
> > ~ }
> >
> > print "Data is ", length($data), " bytes long\n";
> >
> > print "Data has ", scalar split(/x/, $data), " chunks of ",
> > length((split(/x/, $data))[0]), " bytes each\n";
> > - - - - cut here - - -
>
> That code, once deleted those two "~", gives
>
> Data is 1401893 bytes long
> Data has 37 chunks of 37888 bytes each
>
> both with perl 5.6.1 and perl 5.8.0 under GNU/Linux.
>
> -- fxn
Thank you and also Mina Naguib for your helpful responses.
I'll have to take a closer look at both my data and regex.
Noam
------------------------------
Date: Wed, 06 Nov 2002 09:05:26 +0100
From: Sven <me@privacy.net>
Subject: Re: Strange Performance Thing
Message-Id: <me-4729AA.09052606112002@news.dplanet.ch>
Got it! Perl 5.8 seems to have problems handling UTF-8 files. There are
folks working on it, but don't expect a solution before 5.8.1. Meanwhile
add ...
binmode HANDLE, ':crlf';
... after you open a new filehandle to circumvent the trouble. The issue
is being discussed in a thread on P5P in case you're interested in
details:
http://archive.develooper.com/perl5-porters@perl.org/msg88580.html
Thanx for your help, Sven
------------------------------
Date: Wed, 06 Nov 2002 04:04:53 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Strange Performance Thing
Message-Id: <3DC8DB35.E11EB107@earthlink.net>
Sven wrote:
>
> Got it! Perl 5.8 seems to have problems handling UTF-8 files.
Ahh, no. The problem with Red Hat 8 that's being discussed currently on
p5p is that Red Hat sets an environment variable claiming to be fully
utf8... as a result, perl assumes that all newly opened filehandles
should be read as/written as utf8.
Thus, it's not that perl isn't handling utf8 files right, it's that it's
looking at text files, and thinking (because of this environment
variable) that those text files are utf8, when in fact they are not.
> There are folks working on it, but don't expect a solution before
> 5.8.1. Meanwhile add ...
>
> binmode HANDLE, ':crlf';
This merely turns on translation between "\015\012" and "\n"; it has
nothing whatsoever to do with utf8... Perhaps you're thinking of:
binmode HANDLE, ':bytes';
Which disables utf8-ness on a filehandle.
Of course, it would be just as effective to do:
binmode HANDLE;
Which has the added bonus of being backwards compatible with older
perls.
> ... after you open a new filehandle to circumvent the trouble. The
> issue is being discussed in a thread on P5P in case you're interested
> in details:
>
> http://archive.develooper.com/perl5-porters@perl.org/msg88580.html
>
> Thanx for your help, Sven
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: 6 Nov 2002 02:56:10 -0800
From: amarsantpur@hotmail.com (amar)
Subject: Trapping System to System calls
Message-Id: <51db1bd3.0211060256.412a37df@posting.google.com>
Hi,
Is it possible to trap signals from one system call to another. What i
am trying to say is i have a script which dumps a shell script and i
do a system of that script. This shell script in turns calls another
executable (perl script) which has system calls present in it. Now if
that executable doesnt get executed properly is it possible for my
script to get hold of the reasons for the failure of that executable.
Or is it possible to know that this executable has not run properly
due to some problems. if i do $? of the system call i am using in my
script it says it has passed. But that executable has not run. Can
anyone of you
suggest me is there any way of catching this error.
Thanks
Regards
Amar
------------------------------
Date: Wed, 6 Nov 2002 22:04:36 +1100
From: "Tintin" <spam@all.costs.must.die>
Subject: Re: What port number is used when using POST
Message-Id: <3dc8f781_1@news.iprimus.com.au>
"Cylurian" <fsromero@hotmail.com> wrote in message
news:326151f6.0211040011.30f8eeb3@posting.google.com...
> I have a router using NAT with a Server using port 80. When I use
> the GET method to transfer data from the client to the server, I have
> no problems. When I use the POST method no data is transfered. I
> know it has to do with the router, because I can run the script in the
> server and it runs fine.
>
> Any ideas?
Since when did a router have anything to do with Perl?
A POST method is no different to a GET method in regards to protocols and
port numbers.
Learn how to segment your problem.
------------------------------
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.
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 4071
***************************************