[28292] in Perl-Users-Digest
Perl-Users Digest, Issue: 9656 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 28 09:05:54 2006
Date: Mon, 28 Aug 2006 06:05:08 -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 Mon, 28 Aug 2006 Volume: 10 Number: 9656
Today's topics:
Re: A Sort Optimization Technique: decorate-sort-dedeco <w_a_x_man@yahoo.com>
Re: A Sort Optimization Technique: decorate-sort-dedeco <bj_666@gmx.net>
Re: Beginner: read $array with line breaks line by line <nobull67@gmail.com>
Re: Beginner: read $array with line breaks line by line <bik.mido@tiscalinet.it>
Better performance ... cms-team@ivi.de
Re: Better performance ... (Marc Espie)
Re: Better performance ... cms-team@ivi.de
Re: FAQ 4.22 How do I expand function calls in a string <RedGrittyBrick@SpamWeary.foo>
hi <ssivasish@yahoo.co.in>
Re: hi <David.Squire@no.spam.from.here.au>
Re: Improved with a hatchet? <nobull67@gmail.com>
Re: IO::Select::select() says no readable data even if jari.eskelinen@iki.fi
Mail-IMAPClient problem and suggestion needed debhatta@gmail.com
new CPAN modules on Mon Aug 28 2006 (Randal Schwartz)
Re: Out of memory! When running perl script on windows <klaus03@gmail.com>
Re: Perl's GUI <zentara@highstream.net>
Problem handling a Unicode file <lev.weissman@creo.com>
Re: Problem handling a Unicode file <nobull67@gmail.com>
Re: Problem handling a Unicode file <lev.weissman@creo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Aug 2006 01:28:40 -0700
From: "William James" <w_a_x_man@yahoo.com>
Subject: Re: A Sort Optimization Technique: decorate-sort-dedecorate
Message-Id: <1156753720.712245.172690@m79g2000cwm.googlegroups.com>
xahlee@gmail.com wrote:
> I would be interested in comments about how Common Lisp, Scheme, and
> Haskell deal with the decorate-sort-dedecorate technique.
%w(FORTRAN LISP COBOL).sort_by{|s| s.reverse}
==>["COBOL", "FORTRAN", "LISP"]
--
Common Lisp did kill Lisp. Period. ... It is to Lisp what
C++ is to C. A monstrosity that totally ignores the basics
of language design, simplicity, and orthogonality to begin
with. --- Bernard Lang
------------------------------
Date: Mon, 28 Aug 2006 10:53:11 +0200
From: Marc 'BlackJack' Rintsch <bj_666@gmx.net>
Subject: Re: A Sort Optimization Technique: decorate-sort-dedecorate
Message-Id: <pan.2006.08.28.08.53.08.647908@gmx.net>
In <1156723602.192984.49610@m79g2000cwm.googlegroups.com>, Tom Cole wrote:
> In Java, classes can implement the Comparable interface. This interface
> contains only one method, a compareTo(Object o) method, and it is
> defined to return a value < 0 if the Object is considered less than the
> one being passed as an argument, it returns a value > 0 if considered
> greater than, and 0 if they are considered equal.
>
> The object implementing this interface can use any of the variables
> available to it (AKA address, zip code, longitude, latitude, first
> name, whatever) to return this -1, 0 or 1. This is slightly different
> than what you mention as we don't have to "decorate" the object. These
> are all variables that already exist in the Object, and if fact make it
> what it is. So, of course, there is no need to un-decorate at the end.
Python has such a mechanism too, the special `__cmp__()` method
has basically the same signature. The problem the decorate, sort,
un-decorate pattern solves is that this object specific compare operations
only use *one* criteria.
Let's say you have a `Person` object with name, surname, date of birth and
so on. When you have a list of such objects and want to sort them by name
or by date of birth you can't use the `compareTo()` method for both.
Ciao,
Marc 'BlackJack' Rintsch
------------------------------
Date: 27 Aug 2006 23:47:32 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Beginner: read $array with line breaks line by line
Message-Id: <1156747652.463441.260790@p79g2000cwp.googlegroups.com>
Marek Stepanek wrote:
> foreach my $e (@complete_address)
> {
> $e =~ s!<span\s+class="comp2">([^<]+)</span>!Competition: $1\n\n!g;
> $e =~ s!<br />!\n!g;
> $e =~ s!<[^>]+>!!g;
> push (@competitions, $e);
> }
The note control variable, $e, is an _alias_ to elements of
@complete_address not a copy of them so at the end of that loop
@competitions and @complete_address will have the same content. (Given
that @competitions was emply initially).
You can therefore discard one of them.
This is also a case where using the implicit $_ would look tidier.
foreach (@complete_address)
{
s!<span\s+class="comp2">([^<]+)</span>!Competition: $1\n\n!g;
s!<br />!\n!g;
s!<[^>]+>!!g;
}
But really, unless you have very tight control over the input file
format, you should be using a real HTML parser.
------------------------------
Date: 28 Aug 2006 13:50:53 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Beginner: read $array with line breaks line by line
Message-Id: <oig5f2dfggu9rphpom0a5dvrpai4dch018@4ax.com>
On Sun, 27 Aug 2006 22:58:23 +0200, Marek Stepanek <mstep@t-online.de>
wrote:
>find the mistake(s) myself. (I am online only the evening). I am learning
>enormously with all your hints. Until now my script looks like follows:
Giving it a peek in some more detail...
>#! /usr/bin/perl
>
>use strict;
>use warnings;
>use HTML::Entities;
>
>$/ = undef;
Also,
undef $/;
But IMHO generally this kind of things should be done local()ly, in
which case it could simply be
local $/; # undef'd anyway
>my (@competitions, @complete_address);
>
>while (<>)
> {
> foreach my $entry ()
> {
> push (@complete_address, $entry);
How 'bout
push @complete_address, m"<dd>(.+?)</dd>"g; # instead?
in which case you can use
while <>
as a modifier.
Since you don't use /s, $/'s modification doesn't really buy you
anything, from the POV of what you get. I don't have the slightest
idea in terms of performance, but I'm confident it hardly matters in
this case.
>foreach my $e (@complete_address)
We recommend all the time to declare lexical variables as close as
possible to the point they're used. You declared @competitions above
but you're not using it yet. Maybe if you didn't you wouldn't have
needed such a long name as @complete_address: sensible variable naming
does matter!
> {
> $e =~ s!<span\s+class="comp2">([^<]+)</span>!Competition: $1\n\n!g;
> $e =~ s!<br />!\n!g;
> $e =~ s!<[^>]+>!!g;
> push (@competitions, $e);
> }
You know, some people uses C<for> loops to exploit their aliasing to
$_, although not everybody agrees on such a practice. Speaking of
sensible variable naming, IMHO $e buys you nothing. So I would go the
for (@complete_address) {
s!<span\s+class="comp2">([^<]+)</span>!Competition: $1\n\n!g;
s!<br />!\n!g;
s!<[^>]+>!!g;
push @competitions, $_;
}
way.
But then I notice you don't use @complete_address anymore, so you may
have avoided it altogether, courtesy of a map():
my @competition;
push @competition, map {
local $_=$_;
s!<span\s+class="comp2">([^<]+)</span>!Competition: $1\n\n!g;
s!<br />!\n!g;
s!<[^>]+>!!g;
$_;
} m"<dd>(.+?)</dd>"g while <>;
>my $out_file1 = 'letter_comp_addr_01.adr';
>open OUT1, "> $out_file1" or die "Connot create your out_file: $!";
>my $out_file2 = 'letter_comp_addr_02.adr';
>open OUT2, ">> $out_file2" or die "Connot create your out_file: $!";
It is now generally recommended to use lexical filehandles and the
three args form of open(). It would also be sensible to include the
file name in the error message. Thus
open my $out1, '>', $out_file1
or die "Cannot create `$out_file1': $!\n";
Since the two open()s are practically identical, you may even
factorize some code away
my ($out1, $out2)=map {
my $f="letter_comp_addr_$_.adr";
open my $fh, '>', $f or die "Can't create `$f': $!\n";
$fh;
} qw/01 02/;
This doesn't save you much typing as much as it allows you to have to
correct only one typo instead of two.
>print OUT1 join ("\n\n", @competitions);
>print OUT1 "\n\n";
set $, and $\ instead; e.g.:
local ($\,$,)=("\n\n") x 2;
Oh! I'm tired now. The rest another time...
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: 28 Aug 2006 03:31:48 -0700
From: cms-team@ivi.de
Subject: Better performance ...
Message-Id: <1156761108.773369.258590@m79g2000cwm.googlegroups.com>
Hy!
I've got the following code and would like to ask, if there is any
possibilty for more performance. The script inserts about 240
recordsets per second into a MySQL database.
The file (input.txt) contains about 365.000 lines/recordsets.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
# Grundwerte initialisieren
require "/home/vip/my.properties";
$IMPDAT=3D"$HOME_HOST/input.txt";
if (!open (FP1,"<$IMPDAT"))
{
print ("$IMPDAT nicht vorhanden!\n");
exit(3);
}
#Mit der DB verbinden
$rc=3D&connect_to_db();
$linecount =3D 0;
# Alte Tabelleninhalte vorher l=F6schen
$statment=3D"DROP TABLE IF EXISTS `testtabelle`";
$rv=3D$dbh->do($statment);
$statment=3D"CREATE TABLE `testtabelle` (`apl` varchar(2) NOT NULL
default '',`vsnr` varchar(11) NOT NULL default '',`pvsnr` varchar(8)
NOT NULL default '',`art` char(1) NOT NULL default '',`aktiv` char(1)
NOT NULL default '',`vmnr` varchar(4) NOT NULL default '',`vbeginn`
varchar(8) NOT NULL default '',`vende` varchar(8) default NULL,`zw`
int(1) NOT NULL default '0',`ikm` char(1) NOT NULL default '',`ktoidx`
char(1) default NULL,`nettobeitrag` decimal(9,2) NOT NULL default
'0.00',`bruttoratenbeitrag` decimal(9,2) NOT NULL default
'0.00',`produkttext` varchar(150) NOT NULL default '',`rohbau`
varchar(6) default NULL,PRIMARY KEY (`vsnr`),KEY `pvsnr` (`pvsnr`),KEY
`vm` (`vmnr`)) ENGINE=3DInnoDB DEFAULT CHARSET=3Dutf8;";
$rv=3D$dbh->do($statment);
# Nimmt die Startzeit der Anwendung
$startzeit =3D time;
# Zeilenweise Auslesen der Datei
while (<FP1>)
{
$line =3D $_;
chop ($line);
$linecount +=3D 1;
$line=3D~s/\"//g;
($apl,$vsnr1,$vsnr2,$pvsnr,$art,$aktiv,$vmnr,$vbeginn,$vende,$zw,$ikm,$kto=
idx,$nettobeitrag,$bruttoratenbeitrag,$produkttext,$rohbau)
=3D split(/;/,$line);
$vende=3D~s/ *$//g;
$vende=3D~s/,/\./g;
$ktoidx=3D~s/ *$//g;
$ktoidx=3D~s/,/\./g;
$nettobeitrag=3D~s/ *$//g;
$nettobeitrag=3D~s/,/\./g;
$bruttoratenbeitrag=3D~s/ *$//g;
$bruttoratenbeitrag=3D~s/,/\./g;
$produkttext=3D~s/ *$//g;
$produkttext=3D~s/,/\./g;
$rohbau=3D~s/ *$//g;
$rohbau=3D~s/,/\./g;
$statment=3D"INSERT into testtabelle
(apl,vsnr,pvsnr,art,aktiv,vmnr,vbeginn,vende,zw,ikm,ktoidx,nettobeitrag,bru=
ttoratenbeitrag,produkttext,rohbau)
value
('$apl','$vsnr1$vsnr2','$pvsnr','$art','$aktiv','$vmnr','$vbeginn',".($vende
eq "" ? "NULL" : "'".$vende."'").",$zw,'$ikm',".($ktoidx eq "" ? "NULL"
:
"'".$ktoidx."'").",$nettobeitrag,$bruttoratenbeitrag,'$produkttext',".($roh=
bau
eq "" ? "NULL" : "'".$rohbau."'").")";
$rv=3D$dbh->do($statment);
}
$rc =3D $dbh->disconnect;
close(FP1);
# Zeit ausgeben
&Dauer;
$est =3D $est =3D=3D 0 ? 1 : $est;
$dsek =3D int($linecount/$est);
print "Das Script 'laden_all_daten.pl' hat fuer
"=2Epunktuiere($linecount)." Datensaetze insgesamt ".$dauer." Minuten
gebraucht (".$dsek." Datensaetze pro Sekunde)\n";
unlink($TEMPDAT);
exit(0);
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Where can I make this thing run a little faster?
Thx in advance!
Greetings
Marcus Dau
------------------------------
Date: Mon, 28 Aug 2006 11:09:41 +0000 (UTC)
From: espie@lain.home (Marc Espie)
Subject: Re: Better performance ...
Message-Id: <ecuitl$1rn1$1@biggoron.nerim.net>
In article <1156761108.773369.258590@m79g2000cwm.googlegroups.com>,
<cms-team@ivi.de> wrote:
>Hy!
>
>I've got the following code and would like to ask, if there is any
>possibilty for more performance. The script inserts about 240
>recordsets per second into a MySQL database.
>
>The file (input.txt) contains about 365.000 lines/recordsets.
>
>Where can I make this thing run a little faster?
>
Turn autocommit off, and commit just once every n transactions.
Not sure how good it will be with mysql, but sqlite loves it quite
a bit.
Otherwise, use some other database engine. mysql is simple to set up,
but definitely not the fastest.
------------------------------
Date: 28 Aug 2006 05:16:55 -0700
From: cms-team@ivi.de
Subject: Re: Better performance ...
Message-Id: <1156767415.782093.102950@i3g2000cwc.googlegroups.com>
Thx a lot. This does the trick.
Performance went up from 50 minutes runtime for 30 scripts (tables) to
10 minutes!!!
Greetings
Marcus
------------------------------
Date: Mon, 28 Aug 2006 11:19:25 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: FAQ 4.22 How do I expand function calls in a string?
Message-Id: <G-mdndZWJNFHXW_ZnZ2dnUVZ8smdnZ2d@bt.com>
brian d foy wrote:
> We fix this by getting many eyes, such as yours, to constantly
> scruntize the answers and to update them where appropriate.
I'm confused ...
Just how many eyes does Justin have?
Please don't scruntize the answers, I like them unscrunted!
If Justin is constantly scruntizing, he has no time to eat, shower etc?
I think he should scruntize for no more than 8 hours a day, not constantly.
How do you get eyes to update the answers? Does Justin wear a special
hat for this? Are laser beams involved?
------------------------------
Date: 28 Aug 2006 05:41:20 -0700
From: "sivasish" <ssivasish@yahoo.co.in>
Subject: hi
Message-Id: <1156768880.586232.84650@m79g2000cwm.googlegroups.com>
its nt like that . i am learning by my own without any tutor.so.. i
need help. please help me out
------------------------------
Date: Mon, 28 Aug 2006 13:48:28 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: hi
Message-Id: <ecuoms$fp6$1@gemini.csx.cam.ac.uk>
sivasish wrote:
> its nt like that . i am learning by my own without any tutor.so.. i
> need help. please help me out
>
You need to start by helping yourself. First, learn how to use usenet.
For a start:
- Don't change the subject of a thread so that it has no relationship to
its original subject
- Quote context when you reply to a message (Your failure to do this,
along with the change of subject meant that I had no idea what this
message was about (until I remembered replying to you a little while ago
- most people here would have had no chance)
- Read the posting guidelines for this group (posted here twice a week)
and follow them when posting here. Most importantly, show us your code,
don't ask us to write it for you.
DS
------------------------------
Date: 27 Aug 2006 23:17:34 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Improved with a hatchet?
Message-Id: <1156745854.469568.200060@i42g2000cwa.googlegroups.com>
Ben Morrow wrote:
> As perl is currently implemented, it is. The scalar and list comma
> operators are actually the same underneath (a generic evaluate-and-build
> -a-list op), and the main use of the comma op in scalar context is as a
> sequence point.
That is true but to say that the list context comma is a sequence point
is a gross over- simplification...
my $foo = 1;
print $foo,$foo++; # prints 21
my @list = ('foo','bar');
print @list,do { $_=uc for @list; @list }; # prints FOOBARFOOBAR
It happens that the comma causes an array on its LHS to be resolved to
a list of lvalues before the RHS is evaluated but it does not cause
those lvalues to be resolved to rvalues.
It would be a relatively small future change for the comma operator to
leave the array unresolved.
------------------------------
Date: 28 Aug 2006 04:16:15 -0700
From: jari.eskelinen@iki.fi
Subject: Re: IO::Select::select() says no readable data even if there are
Message-Id: <1156763775.401572.158040@75g2000cwc.googlegroups.com>
> You should use a proper event system to handle this: perhaps POE or
> Event.pm. I confess I've never used either of these. I presume you could
> also use Glib.pm, if you like, to match the client.
Thanks Ben. I was too narrow-minded and thought that I have no energy
to learn using events in addition to learn how to use sockets. However
decided to give it a try and was then able to cut my
networkking/polling code to half and in general to make code much much
simpler using Glib::Event. Even more importantly my program now
responds immediadly instead of sleep():ing between polls.
Thanks to all helping me out, think I learnd a lot.
Best regards,
Jari Eskelinen
------------------------------
Date: 28 Aug 2006 05:22:48 -0700
From: debhatta@gmail.com
Subject: Mail-IMAPClient problem and suggestion needed
Message-Id: <1156767768.674802.117260@i42g2000cwa.googlegroups.com>
Hi
There are two issues for which I would like your opinion. First let me
post a bit of code :
use Mail::IMAPClient;
use strict;
use diagnostics;
my $imap = Mail::IMAPClient->new(
Server => $imap_server ,
User => $user_id ,
password => $password,
Uid => 1, # Optional
) or die "cant connect to imap server, $!";
$imap->select("INBOX");
my @msgs = $imap->search("ALL");
foreach my $msg (@msgs) {
print "This is $msg\n";
my @flags = $imap->flags($msg) or die " could not flags:
$!";
my $i;
for ( $i=0;$i<@flags;$i++) {
print "The flag is $flags[$i]\n";
}
..... etc.
Say there is one message in the INBOX, then the o/p of the above code
is
This is 26006
Uncaught exception from user code:
could not flags: at auto2.pl line 51.
Can anyone tell me why its failing while retrieving the flags ? Is it
because there are no flags set ?
Secondly I want your opinion on my approach. I have a mail account
where people send their queries and I reply back. Sometimes it leads to
mail chains, for example, I can ask for more information etc. Finally
when the issue is completed I move the mails to completed. Now, what I
want is a auto-reply, which will be sent to every 'new' mail that is
received. So I do some checks as to where it came from etc. and if it
fits the criteria, I send an auto-reply and put the subject in the log
file. Next time my auto-reply script runs in a cron and if it sees a
mail, it does the same validations and checks whether the subj is
present in the log file. If iyes, I assume its an old mail and do not
send an auto-reply. It serves the purpose for most issues but fails if
two people send a mail with same subject. One then misses the
auto-reply. Can you suggest any simple mechanism without using any
extra modules ( like the auto-reply berkely db - I cannot use a db ) ?
Main problem is identifying whether the mail is a new one or seen
before ? Note that I remove mails from the inbox every now and then. I
am thinking of adding a flag to a message , which is not shown to the
user by Outlook or mozilla and then read that. To that end I was trying
the first part of my query.
Sorry for the long mail. but any suggestions welcome.
Thanks,
Raj.
------------------------------
Date: Mon, 28 Aug 2006 04:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Aug 28 2006
Message-Id: <J4oyE9.1r72@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-Echo-0.01
http://search.cpan.org/~davidrw/Acme-Echo-0.01/
Display perl statements before, after, and/or during execution
----
Acme-MorningMusume-0.07
http://search.cpan.org/~kentaro/Acme-MorningMusume-0.07/
All about Japanese pop star "Morning Musume"
----
Alien-wxWidgets-0.21
http://search.cpan.org/~mbarbon/Alien-wxWidgets-0.21/
building, finding and using wxWidgets binaries
----
Authen-DecHpwd-2.0
http://search.cpan.org/~mikem/Authen-DecHpwd-2.0/
DEC VMS password hashing
----
Convert-Binary-C-0.65
http://search.cpan.org/~mhx/Convert-Binary-C-0.65/
Binary Data Conversion using C Types
----
Date-Tiny-0.01
http://search.cpan.org/~adamk/Date-Tiny-0.01/
A date object, with as little code as possible
----
Devel-RingBuffer-0.31
http://search.cpan.org/~darnold/Devel-RingBuffer-0.31/
Shared memory ring buffers for Perl scripts diagnosis/debug
----
Devel-STrace-0.31
http://search.cpan.org/~darnold/Devel-STrace-0.31/
strace-like runtime call trace for Perl applications
----
Games-Alak-0.18
http://search.cpan.org/~avif/Games-Alak-0.18/
simple game-tree implementation of a gomoku-like game
----
Geography-Countries-LatLong-0.922
http://search.cpan.org/~lgoddard/Geography-Countries-LatLong-0.922/
mean latitude and longitude
----
Gtk2-Notify-0.01
http://search.cpan.org/~flora/Gtk2-Notify-0.01/
Perl interface to libnotify
----
HTML-Template-Compiled-Plugin-InlineImage-0.02
http://search.cpan.org/~tinita/HTML-Template-Compiled-Plugin-InlineImage-0.02/
Inline-Images with HTML::Template::Compiled
----
IPC-Mmap-0.12
http://search.cpan.org/~darnold/IPC-Mmap-0.12/
provides a minimal mmap() interface for both POSIX and Win32
----
Mail-Summary-Tools-0.04
http://search.cpan.org/~nuffin/Mail-Summary-Tools-0.04/
Tools for mailing list summarization.
----
Module-ScanDeps-0.63
http://search.cpan.org/~smueller/Module-ScanDeps-0.63/
Recursively scan Perl code for dependencies
----
PAR-Dist-0.18
http://search.cpan.org/~smueller/PAR-Dist-0.18/
Create and manipulate PAR distributions
----
Spork-Shlomify-0.0200
http://search.cpan.org/~shlomif/Spork-Shlomify-0.0200/
An improved Spork.
----
Want-0.11
http://search.cpan.org/~robin/Want-0.11/
A generalisation of wantarray
----
Win32-IEFavorites-0.04
http://search.cpan.org/~ishigaki/Win32-IEFavorites-0.04/
handles Internet Explorer's Favorites
----
Win32-Useful-0.02
http://search.cpan.org/~esskar/Win32-Useful-0.02/
Collection of useful functions that extend Win32 functionality
----
Wx-0.57
http://search.cpan.org/~mbarbon/Wx-0.57/
interface to the wxWidgets cross-platform GUI toolkit
----
Wx-Demo-0.01
http://search.cpan.org/~mbarbon/Wx-Demo-0.01/
----
Wx-GLCanvas-0.04
http://search.cpan.org/~mbarbon/Wx-GLCanvas-0.04/
interface to wxWidgets' OpenGL canvas
----
XML-Atom-0.22_01
http://search.cpan.org/~miyagawa/XML-Atom-0.22_01/
Atom feed and API implementation
----
XML-Atom-0.23
http://search.cpan.org/~miyagawa/XML-Atom-0.23/
Atom feed and API implementation
----
XML-DOM-Lite-0.15
http://search.cpan.org/~rhundt/XML-DOM-Lite-0.15/
Lite Pure Perl XML DOM Parser Kit
----
XML-Liberal-0.14
http://search.cpan.org/~miyagawa/XML-Liberal-0.14/
Super liberal XML parser that parses broken XML
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: 28 Aug 2006 02:31:21 -0700
From: "Klaus" <klaus03@gmail.com>
Subject: Re: Out of memory! When running perl script on windows
Message-Id: <1156757481.138144.60020@i42g2000cwa.googlegroups.com>
felad wrote:
> I have Perl program on windows that suppose to run on about 10,000
> items in a loop ( should take 2-3 days for it to run )
> The problem is that after several hours I get this error:
> Out of memory!
> Callback called exit.
>
> I have found that every single loop the commit memory grow by 6000 K so
> I guess this is why the program crash
> But I really can't find that cause of it, most of my variable are local
> and I can't find any infinite loop
Can you post some code ?
(that might not be easy: preferrably a short but complete version of
the program, that still causes the Out of memory error)
------------------------------
Date: Mon, 28 Aug 2006 12:23:02 GMT
From: zentara <zentara@highstream.net>
Subject: Re: Perl's GUI
Message-Id: <5ln5f2557jpboucml7fcjigungb8tuu970@4ax.com>
On 27 Aug 2006 20:19:36 +0200, Michele Dondi <bik.mido@tiscalinet.it>
wrote:
>On Sun, 27 Aug 2006 13:02:13 GMT, zentara <zentara@highstream.net>
>wrote:
>
>>A few other comparisons bewtween Tk and Gtk2 (and WxWidgets built on
>>Gtk2).
>
>On an OT basis and on behalf of a friend of mine[*]: he's been having
>difficulties using threads with Tk. I don't have experience with
>either so I couldn't really help him, but from posts both here and on
>PM I already knew about the possible issues, so I just reminded him of
>good ol' fork(). Now the question is: is Gtk2 thread safe? Which
>toolkit is, if any?
>Michele
Well that is one of the good points about Gtk2 which I did not list.
It does have a "thread-safety mechanism", which appeared releatively
recently, around the 2.8 series of modules. Although it isn't perfect,
it does show that the Gtk2 developers are aware of the problems and
power of threads.
What it does, is allow you to set ( see the thread_usage.pl in the
examples subdir of the Perl/Gtk2 distro).
use Gtk2 qw/-init -threads-init 1.050/;
die "Glib::Object thread safetly failed"
unless Glib::Object->set_threadsafe (TRUE);
then in your threads, in the actual thread code block, you
can do things like below, where you use enter and leave,
to tell the main Gtk2 code that you are dipping into the thread and
are going to modify a widget in the main thread.
Gtk2::Gdk::Threads->enter;
$progress->set_fraction ($i);
$progress->set_text ($i * 100 .'%');
Gtk2::Gdk::Threads->leave;
# we're state employee's, so let's do some 'work'...
sleep $sleep;
This is a great advance, and similar code in Tk will result
in the dreaded "free to wrong pool error" or a segfault.
But as QoS pointed out, with proper precautions, threads can be
successfully used with a main thread containing Tk code, but it is
kind of a hack.
So yes, Gtk2 is thread-safe (with some limitations). I've tested this
quite a bit, and the Gtk2 thread-safety mechanism CAN be very finicky,
but it's a start.
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: 27 Aug 2006 23:34:23 -0700
From: "MoshiachNow" <lev.weissman@creo.com>
Subject: Problem handling a Unicode file
Message-Id: <1156746863.167695.246220@b28g2000cwb.googlegroups.com>
HI,
Got a file that when opened with a Notepad looks like (a sample line) :
[HKEY_LOCAL_MACHINE\
I know it's some type of Unicode (can not figure which one),since when
I print lines in Perl - get the following:
[ H K E Y _ L O C A L _ M A C H I N E \
I basicaly need to replace some strings inside the file,so I need to
decode it from Unicode,and eventually save it in unicode.
Have tried the following:
1.open(FILE, ":utf8", "Araxi.reg"); #no good,stll prints spaces
between charachters
2.my $STRING = decode("EBCDIC", $_); #no good,stll prints spaces
between charachters
All this did not get me far.
How do I achieve the above goals (after establishing the exact unicode
format) ?
Thanks
------------------------------
Date: 28 Aug 2006 00:37:00 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Problem handling a Unicode file
Message-Id: <1156750620.593298.298270@b28g2000cwb.googlegroups.com>
MoshiachNow wrote:
> HI,
>
> Got a file that when opened with a Notepad looks like (a sample line) :
>
> [HKEY_LOCAL_MACHINE\
>
> I know it's some type of Unicode (can not figure which one),since when
> I print lines in Perl - get the following:
>
> [ H K E Y _ L O C A L _ M A C H I N E \
>
> I basicaly need to replace some strings inside the file,so I need to
> decode it from Unicode,and eventually save it in unicode.
> Have tried the following:
>
> 1.open(FILE, ":utf8", "Araxi.reg"); #no good,stll prints spaces
> between charachters
When Microsoft adopted Unicode it had not yet become clear that utf8
was the "usual" encoding and they went for utf16le as their default
encoding.
open(FILE, "<:encoding(utf16le)", "Araxi.reg") or die $!;
Actaully you can leave out the 'le' as the BOM will tell Perl the
byte-order.
IIRC Windows puts a BOM on utf8 files too so it is in principle
possible to open a file that could be latin1, utf8, utf16be or utf16le
and infer the encoding.
AFAIF there's no simple encoding() in Perl to do this as BOMed utf8
post-dates the initial implementation of Unicode in Perl.
------------------------------
Date: 28 Aug 2006 03:11:46 -0700
From: "MoshiachNow" <lev.weissman@creo.com>
Subject: Re: Problem handling a Unicode file
Message-Id: <1156759905.976212.224560@b28g2000cwb.googlegroups.com>
Thanks,
did just that.Reads the file nicely.
Then I want to reolace strings in the file and write it back in utf16
to Araxi2.reg.
I use the code below,but the file does not look good in Notepad
anymore,meaning the format is not exactly utf16 ...
open (FILE,'<:encoding(utf16)',"Araxi.reg") || die "Could not open
Araxi.reg: $!"; #Read UNICODE FILE TO ASCII
open (FILE1,">Araxi1.reg") || die "Could not open Araxi1.reg: $!";
while (<FILE>) {
print FILE1;
}
close FILE;
close FILE1;
open (FILE1,"Araxi1.reg") || die "Could not open Araxi1.reg: $!";
#get old server name
while (<FILE1>) {
chomp;
if (/Host/) {
($OLDNAME) = m/"Host"="(\w*-\w*)"/;
#print "OLDNAME=$OLDNAME\n";
$OLDNAME_SMALL = lc $OLDNAME;
#print "OLDNAME_SMALL=$OLDNAME_SMALL\n";
last;
}
}
close FILE1;
open (FILE,'>:encoding(utf16)',"Araxi2.reg") || die "Could not open
Araxi2.reg: $!"; #CONVERT A UNICODE FILE TO ASCII
open (FILE1,"Araxi1.reg") || die "Could not open Araxi1.reg: $!";
while (<FILE1>) {
s/$OLDNAME/$computer/; #replace capitals
s/$OLDNAME_SMALL/$computer_small/; #replace small letters
names
print FILE "$_";
}
------------------------------
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 9656
***************************************