[28311] in Perl-Users-Digest
Perl-Users Digest, Issue: 9675 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 2 09:05:45 2006
Date: Sat, 2 Sep 2006 06:05:05 -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 Sat, 2 Sep 2006 Volume: 10 Number: 9675
Today's topics:
Re: (Off topic) Cyberwar question <prejt@vsb.cz>
Re: (Off topic) Cyberwar question <bik.mido@tiscalinet.it>
Re: Beginner: read $array with line breaks line by line <bik.mido@tiscalinet.it>
Re: Beginner: read $array with line breaks line by line <hjp-usenet2@hjp.at>
Re: Beginner: read $array with line breaks line by line <bik.mido@tiscalinet.it>
Re: browser-dependent cookie behavior <tintin@invalid.invalid>
Re: Can anyone explain this code? <bik.mido@tiscalinet.it>
Re: Can anyone explain this code? <joe@inwap.com>
Re: Can anyone explain this code? <hjp-usenet2@hjp.at>
Re: Can I monitor the execution of a perl script <rvtol+news@isolution.nl>
Re: FAQ 6.22 How can I match strings with multibyte cha <hjp-usenet2@hjp.at>
Re: Help diagnosing why my program isn't trapping SIGTE <news@lawshouse.org>
Re: Help diagnosing why my program isn't trapping SIGTE <hjp-usenet2@hjp.at>
Re: Help with 4 dimensional implementation <David.Squire@no.spam.from.here.au>
Re: Help with 4 dimensional implementation <someone@example.com>
lwp and utf8 characters devs@usa.net
new CPAN modules on Sat Sep 2 2006 (Randal Schwartz)
Re: New Group Cgi:Perl <joe@inwap.com>
Re: Win32::SerialPort null char/0 RX/TX issue <joe@inwap.com>
Re: Win32::SerialPort null char/0 RX/TX issue <dthusma@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 02 Sep 2006 10:46:37 +0200
From: Prejt <prejt@vsb.cz>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <edbgde$as0$2@server4.gts.cz>
John Bokma wrote:
> Tad McClellan <tadmc@augustmail.com> wrote:
>
>> Skybuck <skybuck2000@hotmail.com> wrote:
>>
>>
>>> Subject: (Off topic) Cyberwar question
>>
>> Making off topic posts is rude.
>
> Skybuck is a 15 year old kid (?) that has been kicked away by at least one
> ISP for a good reason. A welcome addition to a kill file, but on the other
> hand, he has a short attention span, and might be gone tomorrow.
>
What does exactly mean skybuck2000 ?
------------------------------
Date: 2 Sep 2006 12:33:10 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <5dnif2ln0c5vnc8bbdbovvisg1qn51ii6o@4ax.com>
On Sat, 02 Sep 2006 10:46:37 +0200, Prejt <prejt@vsb.cz> wrote:
>John Bokma wrote:
[snip]
>> Skybuck is a 15 year old kid (?) that has been kicked away by at least one
>> ISP for a good reason. A welcome addition to a kill file, but on the other
>> hand, he has a short attention span, and might be gone tomorrow.
>
>What does exactly mean skybuck2000 ?
Who knows? Who cares? Why do you ask him anyway?!?
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: 2 Sep 2006 11:55:46 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Beginner: read $array with line breaks line by line
Message-Id: <88lif2t3mohknecq4dgtjoansuci1k083e@4ax.com>
On Wed, 30 Aug 2006 22:50:30 +0200, Marek Stepanek <mstep@t-online.de>
wrote:
>> All in all clumsy clumsy stuff. How 'bout an $addr example along with
>> a description of how you want it to be parsed?
[snip]
>ok, dear Michele, I see I abused your time and patience. I will try this
You *didn't* abuse either my time or patience. Otherwise I would have
pointed out so.
>only in a wacky way. Probably the data are not regular enough, to automat an
>output with Perl ...
cit
>If you read in this script
>
> % ./addresses_comp.pl competitionsfunds.htm
>
>against the page on:
>
>http://podiuminternational.org/htdocs/addresses/competitions/competitionsfun
>ds.htm
ITY want s|htdocs/||;
>you will get the example you are asking about.
I'm checking it out;
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: Sat, 2 Sep 2006 12:27:23 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Beginner: read $array with line breaks line by line
Message-Id: <slrnefin4f.ne6.hjp-usenet2@yoyo.hjp.at>
On 2006-08-30 13:18, Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Tue, 29 Aug 2006 22:19:12 +0200, Marek Stepanek <mstep@t-online.de>
> wrote:
>>my ($competition, $email, $first_name, $last_name, $gender, $phone,
>>$comment);
>>foreach my $addr (@competitions)
>> {
>> foreach (split(/\n/, $addr))
>> {
>> ($competition) = $1 if m/^Competition:\s+(.+)/;
>> if ($comment and m/^\s?((?:International|National)
>>Competition)\s*$/i)
> [snip]
>
> All in all clumsy clumsy stuff.
Clumsiness is the mark of the beginner. Elegance comes with practice.
And maybe we should have formulated our suggestions in a more clumsy
manner, because while Marek has copied pieces of code we suggested he
may not have understood them. For example I suggested the line
>> ($competition) = $1 if m/^Competition:\s+(.+)/;
(although without the first set of parentheses, IIRC), but of course my
advice didn't apply only to this line but to all lines where he extracts
variables in a similar manner. Maybe it would have been more clear what
his error was (and still is in other places of the code) if I had
suggested
if (m/^Competition:\s+(.+)/) {
$competition = $1;
}
instead.
Instead of giving more advice on the code, I'd like to suggest to Marek
to learn to use the Perl debugger (perl -d script.pl). Step through your
script line by line and see how what values the variables have: That way
you will get a better understanding on how your program works and where
the errors are.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: 2 Sep 2006 12:31:26 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Beginner: read $array with line breaks line by line
Message-Id: <manif2lhlo8cu4ejo8psflirc41t2qoase@4ax.com>
On 2 Sep 2006 11:55:46 +0200, Michele Dondi <bik.mido@tiscalinet.it>
wrote:
>>only in a wacky way. Probably the data are not regular enough, to automat an
>>output with Perl ...
>
>cit
Oops! This should have been a remark that a stated design goal of Perl
is to "make easy tasks easy and difficult tasks possible".
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: Sat, 2 Sep 2006 14:38:25 +1200
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: browser-dependent cookie behavior
Message-Id: <44f8e182$0$19732$88260bb3@free.teranews.com>
<rallabs@adelphia.net> wrote in message
news:1157113513.258838.195960@74g2000cwt.googlegroups.com...
>I have a string of cgi scripts which successively set and use cookies
> on the user's browser. The first page sets a 'dummy' cookie and
> redirects to a second page which attempts to read the cookie and sends
> the user a message if the read was unsuccessful, telling him to re-set
> their browser to accept cookies. My problem is that with Internet
> Explorer, even when it is set up properly to accept cookies, and even
> though it successfully passes through the cookie test, it loses one of
> the cookies when it tries to read it in a later page. It returns a
> null for that cookie and that cookie only. The cookie does not have a
> weird name; it is named PT. It is very frustrating because Firefox
> proceeds along through the entire chain of scripts and does not lose
> the cookie. I have tried it on Internet Explorer using several
> different PC computers. I didn't copy down all the version numbers,
> but on this computer it is
> version 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
>
> One thing I don't know how to do as a new cgi scripter is to examine
> the IE cookies. There's a folder on my computer named 'cookies' whose
> only file is called 'index' but it's unreadable. I know how to look at
> the cookies in Firefox, but it behaves properly anyway. My IE settings
> are to accept all cookies from all sites.
> This is a Perl question and I am posting it on a Perl newsgroup so
> don't dump on me if you don't think it adheres closely enough to your
> standards for posting.
What bizzare line of logic led you to conclude this is a Perl question?
All your questions are browser/cookie related and you don't even show any
Perl code.
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 2 Sep 2006 09:34:45 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Can anyone explain this code?
Message-Id: <jmcif25aog2jb90cv8m773nt10ajsem65h@4ax.com>
On 1 Sep 2006 15:26:03 -0700, "PerlNovice" <mfarid1@yahoo.com> wrote:
>One more thing. I want to put this in a file called MyProc.sh and
>execute like this:
>
>perl -ne MyProc.sh
>
>What do I need to do that?
Put everything that is in between single quotes into a MyProc.sh,
period. But then, although it's only a naming convention, I'd call it
MyProc.pl; also, rather than the original one you may want to use
David Filmer's tidied up version.
PS: note that the original program being a oneliner forces it to be
golfed, and I can see some issues with the code. If you want to use it
on a regular basis you *may* encounter problems first or later...
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: Sat, 02 Sep 2006 02:36:02 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: Can anyone explain this code?
Message-Id: <uOednTMGseYkzWTZnZ2dnUVZ_rWdnZ2d@comcast.com>
PerlNovice wrote:
> 1),">".(join"_",@F).".log" or die "@F $!"
> 2)if @F=/(\d+)\s+(\w+)\s+(\d+)\s+(\d\d):(\d\d):(\d\d).*MATCHED/
The following is not an exact translation,
but should help you understand.
# Expecting input like "1 Sept 2006 01:23:45 some text MATCHED"
@F=/(\d+)\s+(\w+)\s+(\d+)\s+(\d\d):(\d\d):(\d\d).*MATCHED/;
if (@F) {
$filename = "$F[0]_$F[1]_$F[2]_$F[3]_$F[4]_$F[6].log";
open F,'>',$filename or die "$filename $!";
}
> 3)$m{$2}=$1 if /(\d+)\s+(?=(.))(MATCHED|DUPLICATE|RESIDUAL)/
$m{M} = $1 if /(\d+)\s+MATCHED/;
$m{D} = $1 if /(\d+)\s+DUPLICATE/;
$m{R} = $1 if /(\d+)\s+RESIDUAL/;
> 4)@m{qw(M D R)}}
printf ".....",$m{M},$m{D},$m{R};
-Joe
------------------------------
Date: Sat, 2 Sep 2006 12:59:50 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Can anyone explain this code?
Message-Id: <slrnefip1a.ne6.hjp-usenet2@yoyo.hjp.at>
On 2006-09-01 22:09, PerlNovice <mfarid1@yahoo.com> wrote:
> Thank you David, Chris and Michele for your responses. This is what I
> understand and this is what I don't understand.
>
> Please correct me if I am wrong:
>
> -n : Loop around the code after the space for as many file names as has
> been provided. In my example, just 1.
No it loops around every *line* in the files.
> -e: This is telling the compiler that a one line script is being
> entered at the command line.
> ': Beginning of the code to be executed
Actually, the single quotes are to prevent the shell from messing with
the script. The shell will take everything within the single quotes
unaltered and pass it as a single argument to perl.
> open F,: Open a file with file handle F followed by separator between 2
> arguments of filename
>
> Of the rest, I only understand bits. for example,
> @F: An arrary named F. This is defined later.
> printf F "MATCHED DUPLICATE RESIDUAL\n%-7d %-9d %-7d\n": Printing a
> line to the newly created file sandwiched between 2 newline characters
> ; : I know they are end of line characters
> or die: If the file is not found then send a file not found message to
> stdout
>
> Here are the pieces I don't understand:
>
> 1),">".(join"_",@F).".log" or die "@F $!"
That's not one piece, that's two pieces. Everything before the "or"
belongs to the open before it. Since it's a bit useless to talk about
pieces of code which were cut apart at random places, I've sent the
complete script through Deparse:
perl -MO=Deparse -ne 'open F,">".(join"_",@F).".log" or die "@F $!" if @F=/(\d+)\s+(\w+)\s+(\d+)\s+(\d\d):(\d\d):(\d\d).*MATCHED/; $m{$2}=$1 if /(\d+)\s+(?=(.))(MATCHED|DUPLICATE|RESIDUAL)/; END{printf F "MATCHED DUPLICATE RESIDUAL\n%-7d %-9d %-7d\n",@m{qw(M D R)}}' INPUTFILE
results in:
LINE: while (defined($_ = <ARGV>)) {
open F, '>' . join('_', @F) . '.log' or die "@F $!" if @F = /(\d+)\s+(\w+)\s+(\d+)\s+(\d\d):(\d\d):(\d\d).*MATCHED/;
$m{$2} = $1 if /(\d+)\s+(?=(.))(MATCHED|DUPLICATE|RESIDUAL)/;
sub END {
printf F "MATCHED DUPLICATE RESIDUAL\n%-7d %-9d %-7d\n", @m{'M', 'D', 'R'};
}
;
}
Now let's move the END block to the end where it belongs:
LINE: while (defined($_ = <ARGV>)) {
open F, '>' . join('_', @F) . '.log' or die "@F $!" if @F = /(\d+)\s+(\w+)\s+(\d+)\s+(\d\d):(\d\d):(\d\d).*MATCHED/;
$m{$2} = $1 if /(\d+)\s+(?=(.))(MATCHED|DUPLICATE|RESIDUAL)/;
}
printf F "MATCHED DUPLICATE RESIDUAL\n%-7d %-9d %-7d\n", @m{'M', 'D', 'R'};
and rearrange the if statements in the loop:
LINE: while (defined($_ = <ARGV>)) {
if (@F = /(\d+)\s+(\w+)\s+(\d+)\s+(\d\d):(\d\d):(\d\d).*MATCHED/) {
open F, '>' . join('_', @F) . '.log'
or die "@F $!"
}
if (/(\d+)\s+(?=(.))(MATCHED|DUPLICATE|RESIDUAL)/) {
$m{$2} = $1
}
}
printf F "MATCHED DUPLICATE RESIDUAL\n%-7d %-9d %-7d\n", @m{'M', 'D', 'R'};
Is it clearer now? You may have to read
perldoc perlsyn
perldoc perlvar
perldoc perlre
perldoc -f open
perldoc perldata
to understand what's going on.
(and to to really understand what it's supposed to do you also need to
know what the file that is read looks like).
BTW, while perl golf and obfuscations are lots of fun and educational,
I don't think it gains you much if you don't even understand basic perl
constructs yet. Start with perl code that's written to be readable, not
as short as possible.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: Sat, 2 Sep 2006 14:59:21 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Can I monitor the execution of a perl script
Message-Id: <edc69e.1es.1@news.isolution.nl>
linq936 schreef:
> I have a Perl script which starts with #! /bin/perl_5.8.0/bin/perl.
>
> Now I does not run as I expected, I wonder if there is any simple
> way to monitor the execution of the script just like I can run "set
> -xv" in BASH and see BASH script running?
First find out what `which -a perl` reports, and what `perl -v` shows.
perl 5.8.0 is not good.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 2 Sep 2006 12:12:26 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 6.22 How can I match strings with multibyte characters?
Message-Id: <slrnefim8e.ne6.hjp-usenet2@yoyo.hjp.at>
On 2006-08-31 16:19, brian d foy <brian.d.foy@gmail.com> wrote:
> In article <slrnefbvau.bkv.hjp-usenet2@yoyo.hjp.at>, Peter J. Holzer
><hjp-usenet2@hjp.at> wrote:
>
>> On 2006-08-30 15:19, brian d foy <brian.d.foy@gmail.com> wrote:
>> > In article <slrnef9bi8.db6.hjp-usenet2@yoyo.hjp.at>, Peter J.
>> > Holzer
>> ><hjp-usenet2@hjp.at> wrote:
>
>> >> On 2006-08-29 19:03, PerlFAQ Server <brian@stonehenge.com> wrote:
>> >> > 6.22: How can I match strings with multibyte characters?
>
>> >> > Starting from Perl 5.6 Perl has had some level of multibyte
>> >> > character support. Perl 5.8 or later is recommended.
>> >> > Supported multibyte character repertoires include Unicode,
>> >> > and legacy encodings through the Encode module. See
>> >> > perluniintro, perlunicode, and Encode.
>
>> >> > If you are stuck with older Perls, ...
>
>> >> I get the impression from this article that these problems are
>> >> present in perl's unicode support.
>
>> > The problems with multi-character support are in the older versions
>> > of Perl.
>
>> Yes. I know that. But when I ignore what I know and just read the
>> article that isn't clear at all.
>
> Perhaps you missed that last line that I quoted. The paragraph starts
> with "If you are stuck with older Perls".
I didn't miss the line, I just don't think it is clear that it covers
the rest of the article and not just the rest of the paragraph. When I
try to read the whole article like someone who doesn't know the answer
already, it consists of three parts:
1) Starting from Perl 5.6 ...
2) If you are stuck with older Perls, ...
3) Finally, ...
Since the first two parts already cover all versions of Perl and don't
contain an answer to the question, the solutions given in the third part
must apply to both older and newer Perls.
> What change would you make? How would you like the answer to read?
The main problem with many multibyte encodings is that the end of
one character together with the start of the next character may form
a byte sequence which also represents a valid character. So you
cannot simply search for a byte sequence. Some multibyte encodings
(e.g., UTF-8) were designed to avoid this problem.
Starting from Perl 5.6 Perl has had some level of multibyte character
support. Perl 5.8 or later is recommended. Supported multibyte character
repertoires include Unicode, and legacy encodings through the Encode
module. See perluniintro, perlunicode, and Encode.
So, in recent perls the easiest way is to convert everything to
perl's internal character encoding (which happen's to be UTF-8, but
you're not supposed to know that) and match that:
use Encode;
my $haystack = decode($my_encoding, $haystack_in_my_encoding);
if ($haystack =~ /$pattern/) ...
or, if you are reading from a file:
open (my $fh, "<:encoding($my_encoding)", $filename) or die;
while (<$fh>) {
if (/$pattern/) ...
}
($pattern is of course also supposed to be a character string)
If you are stuck with older Perls, you can do Unicode with the
[...]
I believe this puts proper weights on the solutions. First, try to use
perl character strings with a recent perl and avoid all the hassle.
Second, if you are stuck with an older perl, you can still use Unicode.
Finally (if you don't want to use Unicode for some reason), you can do
it the hard way.
I wonder if a sentence about the difference between byte and character
strings is needed, though.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: Sat, 02 Sep 2006 10:25:04 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: Help diagnosing why my program isn't trapping SIGTERM on shutdown
Message-Id: <1157189101.87742.0@iris.uk.clara.net>
xhoster@gmail.com wrote:
> Henry Law <news@lawshouse.org> wrote:
>> I have a program which runs in the background, doing its thing. When it
>> receives a SIGTERM it will tidy up and then exit. In test - running it
>> from a TTY, either in foreground or background, it behaves as expected.
>> But when I restart Linux (Fedora Core 4, using 'shutdown -r now') the
>> code that traps SIGTERM isn't executed
> What happens if you send warnings into your own file, rather than using
> syslogd?
For the record, I swapped my "syslog" code for some other code I have
which writes to its own log, after Xho's suggestion, and all works as
required. Thanks - I should have thought of that, since I don't use
syslog at all frequently and am not familiar with it.
--
Henry Law <>< Manchester, England
------------------------------
Date: Sat, 2 Sep 2006 13:32:59 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Help diagnosing why my program isn't trapping SIGTERM on shutdown
Message-Id: <slrnefiqvf.qg5.hjp-usenet2@yoyo.hjp.at>
On 2006-09-02 09:25, Henry Law <news@lawshouse.org> wrote:
> xhoster@gmail.com wrote:
>> Henry Law <news@lawshouse.org> wrote:
[script traps SIGTERM and logs to syslog]
>>> But when I restart Linux (Fedora Core 4, using 'shutdown -r now') the
>>> code that traps SIGTERM isn't executed
>
>> What happens if you send warnings into your own file, rather than using
>> syslogd?
>
> For the record, I swapped my "syslog" code for some other code I have
> which writes to its own log, after Xho's suggestion, and all works as
> required.
And if you compare the timestamp of your file with the time that syslogd
was shut down you will probably guess what happened.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: Sat, 02 Sep 2006 03:56:38 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: Help with 4 dimensional implementation
Message-Id: <edart6$mr6$1@gemini.csx.cam.ac.uk>
David Squire wrote:
> foreach my $Key (sort keys %Transitions) {
perhaps you might prefer
foreach my $Key (sort {$Transitions{$b} <=> $Transitions{$a}} keys
%Transitions) {
DS
------------------------------
Date: Sat, 02 Sep 2006 04:38:49 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Help with 4 dimensional implementation
Message-Id: <tV7Kg.1590$aj6.649@edtnps82>
John W. Krahn wrote:
>
> $ echo "SA
> SB
> SC
> SD
> SE
> SF
> SC
> SD
> SE
> SA
> SB
> SC
> SD" | perl -lne'
> push @x, $_;
> @x == 4 && ++$x{ join $;, @x } && shift @x
> }{
> print join( " -> ", split $; ), " = $x{ $_ }" for sort keys %x
> '
> SA -> SB -> SC -> SD = 2
> SB -> SC -> SD -> SE = 1
> SC -> SD -> SE -> SA = 1
> SC -> SD -> SE -> SF = 1
> SD -> SE -> SA -> SB = 1
> SD -> SE -> SF -> SC = 1
> SE -> SA -> SB -> SC = 1
> SE -> SF -> SC -> SD = 1
> SF -> SC -> SD -> SE = 1
perl -lne'
push( @x, $_ ) && @x == 4 && ++$x{ join " -> ", @x } && shift @x
}{
print "$_ = $x{ $_ }" for sort keys %x
'
John
--
use Perl;
program
fulfillment
------------------------------
Date: 2 Sep 2006 00:31:14 -0700
From: devs@usa.net
Subject: lwp and utf8 characters
Message-Id: <1157182274.791229.79320@m73g2000cwd.googlegroups.com>
hello,
i am trying to write a bot to download wkipedia artictles using
WWW:Wikipedia, a subclass of LWP::UserAgent. pages returned by the
wikipedia
server contains utf8 characters such as LATIN CAPITAL LETTER O WITH
DIAERESIS. however, i see that the lwp module is not handling the
search
results as utf8 encoded. i see that th e character =D6 is treated as
three
individual bytes and not a single character. how do i specify that the
lwp useragent must handle utf8 chars?
thanks in advance,
dave
------------------------------
Date: Sat, 2 Sep 2006 04:42:11 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Sep 2 2006
Message-Id: <J4y7qB.r4v@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.
Apache2-Mogile-Dispatch-0.1_1
http://search.cpan.org/~sock/Apache2-Mogile-Dispatch-0.1_1/
An Apache2 MogileFS Dispatcher
----
Authen-Passphrase-0.004
http://search.cpan.org/~zefram/Authen-Passphrase-0.004/
hashed passwords/passphrases as objects
----
Catalyst-Plugin-Log-Message-0.02
http://search.cpan.org/~michiel/Catalyst-Plugin-Log-Message-0.02/
Alternative catalyst log module
----
Catalyst-Plugin-Params-Profile-0.02
http://search.cpan.org/~michiel/Catalyst-Plugin-Params-Profile-0.02/
Parameter checking with Params::Profile
----
DBIx-Log4perl-0.07
http://search.cpan.org/~mjevans/DBIx-Log4perl-0.07/
Perl extension for DBI to selectively log SQL, parameters, result-sets, transactions etc to a Log::Log4perl handle.
----
EVDB-API-0.99
http://search.cpan.org/~radcliff/EVDB-API-0.99/
Perl interface to EVDB public API
----
Error-0.17004
http://search.cpan.org/~pevans/Error-0.17004/
Error/exception handling in an OO-ish way
----
ExtUtils-MakeMaker-6.30_02
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.30_02/
Create a module Makefile
----
ExtUtils-MakeMaker-6.30_03
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.30_03/
Create a module Makefile
----
Games-Mastermind-Solver-0.02
http://search.cpan.org/~mbarbon/Games-Mastermind-Solver-0.02/
a Master Mind puzzle solver
----
Google-Adwords-v0.0.1
http://search.cpan.org/~rohan/Google-Adwords-v0.0.1/
an interface which abstracts the Google Adwords SOAP API
----
HTML-WikiConverter-MediaWiki-0.54
http://search.cpan.org/~diberri/HTML-WikiConverter-MediaWiki-0.54/
Convert HTML to MediaWiki markup
----
Lingua-MAF-0.1.1
http://search.cpan.org/~grousse/Lingua-MAF-0.1.1/
Multi-Annotation Framework format writer
----
Lingua-TagSet-0.3.2
http://search.cpan.org/~grousse/Lingua-TagSet-0.3.2/
Natural language tagset conversion
----
Linux-Sysfs-0.02
http://search.cpan.org/~flora/Linux-Sysfs-0.02/
Perl interface to libsysfs
----
Log-Funlog-0.86
http://search.cpan.org/~korsani/Log-Funlog-0.86/
Log module with fun inside!
----
Moose-0.12
http://search.cpan.org/~stevan/Moose-0.12/
A complete modern object system for Perl 5
----
Net-Flickr-API-1.6
http://search.cpan.org/~ascope/Net-Flickr-API-1.6/
base API class for Net::Flickr::* libraries
----
Net-Flickr-Backup-2.92
http://search.cpan.org/~ascope/Net-Flickr-Backup-2.92/
OOP for backing up your Flickr photos locally
----
Net-Flickr-RDF-1.92
http://search.cpan.org/~ascope/Net-Flickr-RDF-1.92/
a.k.a RDF::Describes::Flickr
----
Net-Squid-Purge-0.1
http://search.cpan.org/~sock/Net-Squid-Purge-0.1/
Send purge requests to squid easily
----
Net-UKDomain-Nominet-Automaton-1.05
http://search.cpan.org/~cliffordj/Net-UKDomain-Nominet-Automaton-1.05/
Module to handle the Nominet Automaton for domain registration and modification.
----
Net-xFTP-0.16
http://search.cpan.org/~turnerjw/Net-xFTP-0.16/
Common wrapper functions for use with either Net::FTP or Net::xFTP.
----
Object-InsideOut-1.52
http://search.cpan.org/~jdhedden/Object-InsideOut-1.52/
Comprehensive inside-out object support module
----
POE-Component-Client-Ident-1.02
http://search.cpan.org/~bingos/POE-Component-Client-Ident-1.02/
A component that provides non-blocking ident lookups to your sessions.
----
POE-Component-Client-Whois-1.06
http://search.cpan.org/~bingos/POE-Component-Client-Whois-1.06/
A one shot non-blocking RFC 812 WHOIS query.
----
POE-Filter-CSV-1.01
http://search.cpan.org/~bingos/POE-Filter-CSV-1.01/
A POE-based parser for CSV based files.
----
POE-Filter-IRCD-1.9
http://search.cpan.org/~bingos/POE-Filter-IRCD-1.9/
A POE-based parser for the IRC protocol.
----
POE-Filter-LZO-1.3
http://search.cpan.org/~bingos/POE-Filter-LZO-1.3/
A POE filter wrapped around Compress::LZO
----
POE-Filter-LZW-1.3
http://search.cpan.org/~bingos/POE-Filter-LZW-1.3/
A POE filter wrapped around Compress::LZW
----
POE-Filter-Zlib-1.5
http://search.cpan.org/~bingos/POE-Filter-Zlib-1.5/
A POE filter wrapped around Compress::Zlib
----
RobotDB-0.01
http://search.cpan.org/~apatwa/RobotDB-0.01/
----
Test-Exception-0.22
http://search.cpan.org/~adie/Test-Exception-0.22/
Test exception based code
----
Text-Template-Inline-0.12
http://search.cpan.org/~zgh/Text-Template-Inline-0.12/
Quick and easy formatting of data
----
Text-Template-Inline-0.13
http://search.cpan.org/~zgh/Text-Template-Inline-0.13/
Easy formatting of hierarchical data
----
Tk-XMLViewer-0.18
http://search.cpan.org/~srezic/Tk-XMLViewer-0.18/
Tk widget to display XML
----
WWW-Myspace-0.53
http://search.cpan.org/~grantg/WWW-Myspace-0.53/
Access MySpace.com profile information from Perl
----
WebService-Eventful-1.0
http://search.cpan.org/~radcliff/WebService-Eventful-1.0/
Perl interface to EVDB public API
----
WebServices-Eventful-1.0
http://search.cpan.org/~radcliff/WebServices-Eventful-1.0/
----
Wx-App-Mastermind-0.02
http://search.cpan.org/~mbarbon/Wx-App-Mastermind-0.02/
a nontrivial example of wxPerl threads
----
XML-Writer-0.601
http://search.cpan.org/~josephw/XML-Writer-0.601/
Perl extension for writing XML documents.
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: Sat, 02 Sep 2006 02:11:25 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: New Group Cgi:Perl
Message-Id: <2YOdnRPefs1v12TZnZ2dnUVZ_vydnZ2d@comcast.com>
rock wrote:
> Introducing a new group Cgi:Perl for everyone ..
What the hell are you talking about?
I am reading this on the USENET newsgroup comp.lang.perl.misc,
and 'Cgi:Perl' is not a legal name of a USENET newsgroup.
------------------------------
Date: Sat, 02 Sep 2006 02:46:15 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: Win32::SerialPort null char/0 RX/TX issue
Message-Id: <vIadnQ39AemwzmTZnZ2dnUVZ_vqdnZ2d@comcast.com>
gluphus wrote:
> my $pkt = 0x00;
That is the same as
my $pkt = 0;
which is not the same as
my $pkt = "\0";
or
my $pkt = "\x00";
Try again after using a proper NULL character.
-Joe
------------------------------
Date: 2 Sep 2006 05:33:03 -0700
From: "gluphus" <dthusma@hotmail.com>
Subject: Re: Win32::SerialPort null char/0 RX/TX issue
Message-Id: <1157200383.474224.210650@m79g2000cwm.googlegroups.com>
Joe,
Thanks.
Any idea on how I can get the Perl rcving side to actually read and
process the 0 that comes across from the MCU?
I was looking at the ignore_null, but cannot find any info on it or
others...
Joe Smith wrote:
> gluphus wrote:
> > my $pkt = 0x00;
>
> That is the same as
> my $pkt = 0;
> which is not the same as
> my $pkt = "\0";
> or
> my $pkt = "\x00";
>
> Try again after using a proper NULL character.
> -Joe
------------------------------
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 9675
***************************************