[28300] in Perl-Users-Digest
Perl-Users Digest, Issue: 9664 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 30 03:05:59 2006
Date: Wed, 30 Aug 2006 00:05:09 -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 Wed, 30 Aug 2006 Volume: 10 Number: 9664
Today's topics:
Re: 1 string from 3, making replacements more perlish <abeausoleil@gmail.com>
Re: 1 string from 3, making replacements more perlish <mritty@gmail.com>
Re: 1 string from 3, making replacements more perlish <DJStunks@gmail.com>
Re: 1 string from 3, making replacements more perlish <rvtol+news@isolution.nl>
Re: 1 string from 3, making replacements more perlish <mumia.w.18.spam+nospam.usenet@earthlink.net>
Re: 1 string from 3, making replacements more perlish <someone@example.com>
Re: Allowing threading with CGI <youknows@gmail.com>
Re: Allowing threading with CGI xhoster@gmail.com
Re: Allowing threading with CGI xhoster@gmail.com
Re: Allowing threading with CGI <youknows@gmail.com>
Compiling Perl with PAR <anton.vandersteen@chello.nl>
Re: Compiling Perl with PAR <john@castleamber.com>
Re: Compiling Perl with PAR <sisyphus1@nomail.afraid.org>
FormMail Error Bad/No Recipient, Browser Issue <coolboarder2224@gmail.com>
Gnome panel applets and Gtk2::TrayIcon tdelov@gmail.com
Hi Guys ! <rajeshmvj@gmail.com>
Re: Hi Guys ! <nospam@nospam.net>
new CPAN modules on Wed Aug 30 2006 (Randal Schwartz)
Re: Out of memory! When running perl script on windows <youknows@gmail.com>
Re: Problem handling a Unicode file <rvtol+news@isolution.nl>
Re: Problem handling a Unicode file <hjp-usenet2@hjp.at>
Returning raw xml in SOAP::Lite <admin@asarian-host.net>
Re: Serving a website based on internet source address <tadmc@augustmail.com>
Re: Serving a website based on internet source address <youknows@gmail.com>
Re: Serving a website based on internet source address <noreply@gunnar.cc>
Re: Stupid Q: How to preserve numeric characters <goodarm@gmail.com>
Re: Stupid Q: How to preserve numeric characters <goodarm@gmail.com>
Re: Working with Source Code to Insert Copyright Statem <rvtol+news@isolution.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Aug 2006 15:16:33 -0700
From: "Andre Beausoleil" <abeausoleil@gmail.com>
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <1156889793.139929.33100@m79g2000cwm.googlegroups.com>
StuPedaso wrote:
> I have 1 string made up of ones and zeros,
> a 2nd and 3rd of letters and number,
> and need to create a 4th where the 1's are successively pulled from 2,
> and the 1's from the 3rd.
>
<snip code>
>
> Not very perlish
> Also I don't want to modify srting1, as I will be using it again after
> I modify 2 and 3.
If I read correctly, you don't care about modifying 2 and 3, but in
your original program you don't seem to do that. Here's what I would
do:
foreach $digit (split(//,$string1)) {
if($digit) { # 1, so take from string 3
$string4 .= substr($string3,0,1,""); # Cuts off first character; no
need for position variable
} else {
$string4 .= substr($string2,0,1,"");
}
}
print $string4;
At the end, 2 and 3 will be empty, 1 will be unmodified, and 4 will
have the string you want.
Hope this helped you into the Perl way of thinking. :-)
Andre Beausoleil
------------------------------
Date: 29 Aug 2006 15:23:25 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <1156890205.232814.22900@h48g2000cwc.googlegroups.com>
StuPedaso wrote:
> I have 1 string made up of ones and zeros,
> a 2nd and 3rd of letters and number,
> and need to create a 4th where the 1's are successively pulled from 2,
> and the 1's from the 3rd.
Please check your message for typos before posting. It took me a great
while to figure out what you actually meant.
>
> I can this do this in a QB/VB type way with
> $string1="001010110";
> $string2="a1bd3";
> $string3="0XY0";
>
> $l=0;$m=0;$p=0;
> $string4="";
>
> for $i (0..(length $string1)){
> $x=substr($string1,$l,1);$l++;
> if ($x==1){$string4.=substr($string3,$p,1);$p++;}
> else {$string4.=substr($string2,$m,1);$m++;}
> }
> print $string4;
> #a10bXdY03
>
> Not very perlish
> Also I don't want to modify srting1, as I will be using it again after
> I modify 2 and 3.
I don't like this solution at all, but it's the best I can come up
with:
$ perl -le'
$string1="001010110";
$string2="a1bd3";
$string3="0XY0";
$string4 = $string1;
$string4 =~ s/(.)/$1 ? substr($string3, $i++, 1) : substr($string2,
$j++, 1)/ge;
print $string4;
'
a10bXdY03
Paul Lalli
------------------------------
Date: 29 Aug 2006 15:56:50 -0700
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <1156892210.708291.316400@m73g2000cwd.googlegroups.com>
StuPedaso wrote:
> I have 1 string made up of ones and zeros,
> a 2nd and 3rd of letters and number,
> and need to create a 4th where the 1's are successively pulled from 2,
> and the 1's from the 3rd.
>
> I can this do this in a QB/VB type way with
> $string1="001010110";
> $string2="a1bd3";
> $string3="0XY0";
>
> $l=0;$m=0;$p=0;
> $string4="";
>
> for $i (0..(length $string1)){
> $x=substr($string1,$l,1);$l++;
> if ($x==1){$string4.=substr($string3,$p,1);$p++;}
> else {$string4.=substr($string2,$m,1);$m++;}
> }
> print $string4;
> #a10bXdY03
>
> Not very perlish
> Also I don't want to modify srting1, as I will be using it again after
> I modify 2 and 3.
what do y'all think of this:
#!/usr/bin/perl
use strict;
use warnings;
my $key_string = '001010110';
my $string_0 = 'a1bd3';
my $string_1 = '0XY0';
my %hash = (
0 => [ split //, $string_0 ],
1 => [ split //, $string_1 ],
);
my $result;
for my $i (split //, $key_string) {
$result .= shift @{ $hash{$i} };
}
print "result: $result\n";
?
-jp
------------------------------
Date: Wed, 30 Aug 2006 00:50:24 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <ed2nk5.14o.1@news.isolution.nl>
StuPedaso schreef:
> I have 1 string made up of ones and zeros,
> a 2nd and 3rd of letters and number,
> and need to create a 4th where the 1's are successively pulled from 2,
> and the 1's from the 3rd.
>
> I can this do this in a QB/VB type way with
> $string1="001010110";
> $string2="a1bd3";
> $string3="0XY0";
>
> $l=0;$m=0;$p=0;
> $string4="";
>
> for $i (0..(length $string1)){
> $x=substr($string1,$l,1);$l++;
> if ($x==1){$string4.=substr($string3,$p,1);$p++;}
> else {$string4.=substr($string2,$m,1);$m++;}
> }
> print $string4;
> #a10bXdY03
>
> Not very perlish
> Also I don't want to modify srting1, as I will be using it again after
> I modify 2 and 3.
#!/usr/bin/perl
use warnings ;
use strict ;
my $points = '001010110' ;
my $string1 = 'a1bd3' ;
my $string2 = '0XY0' ;
my $result ;
$result .= substr( $_ ? $string2 : $string1, 0, 1, '')
for split //, $points ;
print "#$result\n" ;
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 30 Aug 2006 00:50:45 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <Fh5Jg.3088$xQ1.580@newsread3.news.pas.earthlink.net>
On 08/29/2006 04:55 PM, StuPedaso wrote:
> I have 1 string made up of ones and zeros,
> a 2nd and 3rd of letters and number,
> and need to create a 4th where the 1's are successively pulled from 2,
> and the 1's from the 3rd.
>
> I can this do this in a QB/VB type way with
> $string1="001010110";
> $string2="a1bd3";
> $string3="0XY0";
>
> $l=0;$m=0;$p=0;
> $string4="";
>
> for $i (0..(length $string1)){
> $x=substr($string1,$l,1);$l++;
> if ($x==1){$string4.=substr($string3,$p,1);$p++;}
> else {$string4.=substr($string2,$m,1);$m++;}
> }
> print $string4;
> #a10bXdY03
>
> Not very perlish
> Also I don't want to modify srting1, as I will be using it again after
> I modify 2 and 3.
>
I hope this is adequately perlish enough for you :-)
use strict;
use warnings;
sub promote(\@) {
my $array = shift;
$array->[0]++;
$array->[0] = 1 if ($array->[0] >= @{$array});
$array->[$array->[0]];
}
my @string1 = split //, '001010110';
my @string2 = (0, split //, 'a1bd3');
my @string3 = (0, split //, '0XY0');
my @string4 = map { $_ ? promote(@string3) : promote(@string2)
} @string1;
print @string4;
__HTH__
------------------------------
Date: Wed, 30 Aug 2006 02:23:55 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <%E6Jg.20352$Ch.4496@clgrps13>
StuPedaso wrote:
> I have 1 string made up of ones and zeros,
> a 2nd and 3rd of letters and number,
> and need to create a 4th where the 1's are successively pulled from 2,
> and the 1's from the 3rd.
>
> I can this do this in a QB/VB type way with
> $string1="001010110";
> $string2="a1bd3";
> $string3="0XY0";
>
> $l=0;$m=0;$p=0;
> $string4="";
>
> for $i (0..(length $string1)){
> $x=substr($string1,$l,1);$l++;
> if ($x==1){$string4.=substr($string3,$p,1);$p++;}
> else {$string4.=substr($string2,$m,1);$m++;}
> }
> print $string4;
> #a10bXdY03
>
> Not very perlish
> Also I don't want to modify srting1, as I will be using it again after
> I modify 2 and 3.
TIMTOWTDI
$ perl -le'
my $string1 = "001010110";
my $string2 = "a1bd3";
my $string3 = "0XY0";
my ( $l, $m );
my $string4 = join "",
map substr( $string1, $_, 1 )
? substr( $string3, $l++, 1 )
: substr( $string2, $m++, 1 ),
0 .. length( $string1 ) - 1;
print $string4;
'
a10bXdY03
$ perl -le'
my $string1 = "001010110";
my $string2 = "a1bd3";
my $string3 = "0XY0";
my ( $l, $m, $string4 );
substr $string4, $_, 1, substr( $string1, $_, 1 )
? substr $string3, $l++, 1
: substr $string2, $m++, 1
for 0 .. length( $string1 ) - 1;
print $string4;
'
a10bXdY03
$ perl -le'
my $string1 = "001010110";
my $string2 = "a1bd3";
my $string3 = "0XY0";
( my $string4 = $string1 ) =~ s{([01])}
{
( $1 ? $string3 : $string2 ) =~ /\G(.)/g; $1
}ge;
print $string4;
'
a10bXdY03
John
--
use Perl;
program
fulfillment
------------------------------
Date: 29 Aug 2006 18:52:02 -0700
From: "alpha_beta_release" <youknows@gmail.com>
Subject: Re: Allowing threading with CGI
Message-Id: <1156902721.736768.304730@h48g2000cwc.googlegroups.com>
That's the problem. Nothing 'informative' error. It just says,
"application.blablabla encountered problem. Please send blablabla"
(windows error, duh!). I try to run it locally (localhost). When i run
on Linux, nothing shows up on browser (as server reply).
But if i try run as script (not CGI), it works. Wonder why... :?
xhoster@gmail.com wrote:
> "alpha_beta_release" <youknows@gmail.com> wrote:
> > Hi,
> >
> > I'm doing CGI, and plan to use threads.pm for CGI application. I ran a
> > test, but unfortunately, my http server (Apache) won't allow multiple
> > threads ran within a CGI script. But the script works OK if not as CGI
> > and as local running script. Any suggestion?
>
> Yeah, tells what the problem is. Did you get the notorious
> "Neener-neener, your mom wears combat boots at line 42" error?
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 30 Aug 2006 03:27:27 GMT
From: xhoster@gmail.com
Subject: Re: Allowing threading with CGI
Message-Id: <20060829232745.747$p0@newsreader.com>
"alpha_beta_release" <youknows@gmail.com> wrote:
> It doesn't work either. I modify this code from the example given.
>
> [code]------------------------------
>
> foreach my $child ( 0 .. $#names ) {
> my $pid = $pm->start($names[$child]) and next;
> # $pm->finish($child);
> }
Don't comment out the $pm->finish. It is there for a reason
> [/code]----------------------------
>
> None of error messages, except system error :(
Which system error?
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 30 Aug 2006 03:33:03 GMT
From: xhoster@gmail.com
Subject: Re: Allowing threading with CGI
Message-Id: <20060829233321.687$mw@newsreader.com>
"alpha_beta_release" <youknows@gmail.com> wrote:
> That's the problem. Nothing 'informative' error.
Anything is more informative than nothing.
> It just says,
> "application.blablabla encountered problem. Please send blablabla"
> (windows error, duh!).
Sounds like the windows equivalent of unix's seg-fault. Someone more
familiar with Windows might be able to divine the entrails of the blablabla
if you would tell us what they actually are.
> I try to run it locally (localhost). When i run
> on Linux, nothing shows up on browser (as server reply).
I have no problem using either fork of threads with CGI on linux.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 29 Aug 2006 22:04:21 -0700
From: "alpha_beta_release" <youknows@gmail.com>
Subject: Re: Allowing threading with CGI
Message-Id: <1156914261.020448.34990@m73g2000cwd.googlegroups.com>
That's weird. Is it just my system?
I don't think there's any informative thing about the message. Anyway,
here's the message
"Perl Command Line Interpreter has encountered a problem and needs to
close. We are sorry for the inconvenience."
I run it on Windows, using Apache as HTTP server
Here's the code
[code]------------------------------------------------------------
#!c:/perl/bin/perl -Tw
use strict;
use Parallel::ForkManager;
use CGI;
use CGI::Carp 'fatalsToBrowser'; # debug
my $max_procs = 5;
my @names = qw( Fred Jim Lily Steve Jessica Bob Dave Christine Rico
Sara );
my $pm = new Parallel::ForkManager($max_procs);
$pm->run_on_finish(
sub {
my ($pid, $exit_code, $ident) = @_;
}
);
$pm->run_on_start(
sub {
my ($pid,$ident)=@_;
}
);
$pm->run_on_wait(
sub {},
0.5
);
foreach my $child ( 0 .. $#names ) {
my $pid = $pm->start($names[$child]) and next;
$pm->finish($child);
}
my $page = new CGI;
print $page->header,
$page->start_html,
'xxxxxx',
$page->end_html;
[/code]------------------------------------------------------------
xhoster@gmail.com wrote:
> "alpha_beta_release" <youknows@gmail.com> wrote:
> > That's the problem. Nothing 'informative' error.
>
> Anything is more informative than nothing.
>
> > It just says,
> > "application.blablabla encountered problem. Please send blablabla"
> > (windows error, duh!).
>
> Sounds like the windows equivalent of unix's seg-fault. Someone more
> familiar with Windows might be able to divine the entrails of the blablabla
> if you would tell us what they actually are.
>
> > I try to run it locally (localhost). When i run
> > on Linux, nothing shows up on browser (as server reply).
>
> I have no problem using either fork of threads with CGI on linux.
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 29 Aug 2006 21:06:46 -0700
From: "anton.vandersteen@chello.nl" <anton.vandersteen@chello.nl>
Subject: Compiling Perl with PAR
Message-Id: <1156910806.592346.135250@e3g2000cwe.googlegroups.com>
Hello Perl friends,
I am trying to compile a perl programme with :
ppm install PAR
> ppm install Module-ScanDeps
Then you can create an executable with the line:
> pp script.pl -o script.exe
to an ".exe" programme.
However when I run the executable "file.exe" there occur problem
because I use Tk.
Below you can see the original Perl programme:
#!perl/bin/perl -w
use Tk;
use Tk::Clock;
my $MW=MainWindow->new();
### --- Prevents Main Window Resizing
$MW->bind('<Configure>' => sub{
my $xe = $MW->XEvent;
$MW->maxsize($xe->w, $xe->h);
$MW->minsize($xe->w, $xe->h);
});
$MW->title("My Analog Clock");
$clock = $MW->Clock();
$clock->config(
useDigital => 1,
useAnalog => 1,
anaScale => 250,
handColor => 'Blue3',
secsColor => 'Yellow2',
tickColor => 'Orange',
);
$clock->pack();
MainLoop();
I am hoping that someone can help me.
The clock is a test. When this works I can solve a bigger problem.
Thanks in forehand.
------------------------------
Date: 30 Aug 2006 04:18:59 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Compiling Perl with PAR
Message-Id: <Xns982EED2F2818castleamber@130.133.1.4>
"anton.vandersteen@chello.nl" <anton.vandersteen@chello.nl> wrote:
> Hello Perl friends,
>
> I am trying to compile a perl programme with :
>
> ppm install PAR
>> ppm install Module-ScanDeps
>
> Then you can create an executable with the line:
>
>> pp script.pl -o script.exe
>
> to an ".exe" programme.
>
> However when I run the executable "file.exe" there occur problem
> because I use Tk.
And the problem is? I mean: do you get a warning?
Quite some time ago I used PAR with a project. PAR is quite smart with
finding which modules are needed, but sometimes you need to give it a hint
with "use modulename".
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: Wed, 30 Aug 2006 14:53:33 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Compiling Perl with PAR
Message-Id: <44f51ac9$0$5110$afc38c87@news.optusnet.com.au>
<anton.vandersteen@chello.nl> wrote in message
news:1156910806.592346.135250@e3g2000cwe.googlegroups.com...
> Hello Perl friends,
>
> I am trying to compile a perl programme with :
>
> ppm install PAR
> > ppm install Module-ScanDeps
>
> Then you can create an executable with the line:
>
> > pp script.pl -o script.exe
>
> to an ".exe" programme.
>
> However when I run the executable "file.exe" there occur problem
> because I use Tk.
>
You might specifically need to load Tk and/or Tk::Clock using the '-M'
switch (see perldoc pp). Something like:
pp -M Tk -M Tk::Clock -o script.exe script.pl
Not sure if you specify the '-M' switch the second time as I have done.
Cheers,
Rob
------------------------------
Date: 29 Aug 2006 21:40:15 -0700
From: "coolboarder2224" <coolboarder2224@gmail.com>
Subject: FormMail Error Bad/No Recipient, Browser Issue
Message-Id: <1156912815.864925.274800@h48g2000cwc.googlegroups.com>
I have been making a form for people so submit picks to my email
account, I'm using formmail.cgi. The form works perfect and couldnt be
happier, but found out it seems to only work in safari though. I have
no idea what to do, I am completely lost, and ya the error is the
Bad/No Recipient, and to me it seems that if that truly was the error
it wouldn't work in safari either. Well any help would be awesome,
thanks
------------------------------
Date: 29 Aug 2006 20:14:15 -0700
From: tdelov@gmail.com
Subject: Gnome panel applets and Gtk2::TrayIcon
Message-Id: <1156907655.389404.173960@e3g2000cwe.googlegroups.com>
Hi,
I'm using Gtk2::TrayIcon to run a program in the gnome panel.
Is there another module to use that would allow the perl script to be
placed anywhere with in the panel rather than being locked to the
"Tray" position?
Thanks
------------------------------
Date: 29 Aug 2006 22:56:18 -0700
From: "rajesh" <rajeshmvj@gmail.com>
Subject: Hi Guys !
Message-Id: <1156917378.295275.26390@b28g2000cwb.googlegroups.com>
i want to know about the recruitment in perl for 1 year !
------------------------------
Date: Wed, 30 Aug 2006 16:22:07 +1000
From: darkmoo <nospam@nospam.net>
Subject: Re: Hi Guys !
Message-Id: <pan.2006.08.30.06.22.07.172000@nospam.net>
On Tue, 29 Aug 2006 22:56:18 -0700, rajesh wrote:
> i want to know about the recruitment in perl for 1 year !
Do you have your own camel? Can't use company camel.
------------------------------
Date: Wed, 30 Aug 2006 04:42:08 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Aug 30 2006
Message-Id: <J4snq8.1zBB@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.
Best-0.07
http://search.cpan.org/~gaal/Best-0.07/
Fallbackable module loader
----
CGI-Wiki-Store-Mediawiki-0.02
http://search.cpan.org/~dprice/CGI-Wiki-Store-Mediawiki-0.02/
Mediawiki (MySQL) storage backend for CGI::Wiki
----
CPAN-Reporter-0.13
http://search.cpan.org/~dagolden/CPAN-Reporter-0.13/
Provides Test::Reporter support for CPAN.pm
----
Config-Wrest-1.036
http://search.cpan.org/~bbc/Config-Wrest-1.036/
Read and write Configuration data With References, Environment variables, Sections, and Templating
----
Crypt-Tea_JS-2.19
http://search.cpan.org/~pjb/Crypt-Tea_JS-2.19/
The Tiny Encryption Algorithm in Perl and JavaScript
----
DBIx-Romani-0.0.15
http://search.cpan.org/~dsnopek/DBIx-Romani-0.0.15/
----
DateTime-TimeZone-0.48
http://search.cpan.org/~drolsky/DateTime-TimeZone-0.48/
Time zone object base class and factory
----
Error-Subclasses-0.01
http://search.cpan.org/~pevans/Error-Subclasses-0.01/
----
FFmpeg-6036
http://search.cpan.org/~allenday/FFmpeg-6036/
Perl interface to FFmpeg, a video converter written in C
----
FFmpeg-Command-0.04
http://search.cpan.org/~mizzy/FFmpeg-Command-0.04/
A wrapper class for ffmpeg command line utility.
----
FSA-Rules-0.26
http://search.cpan.org/~dwheeler/FSA-Rules-0.26/
Build simple rules-based state machines in Perl
----
Markup-Perl-0.4
http://search.cpan.org/~mmathews/Markup-Perl-0.4/
turn your CGI inside-out
----
Module-CPANTS-Analyse-0.64
http://search.cpan.org/~domm/Module-CPANTS-Analyse-0.64/
Generate Kwalitee ratings for a distribution
----
POE-Component-Generic-0.0905
http://search.cpan.org/~gwyn/POE-Component-Generic-0.0905/
A POE component that provides non-blocking access to a blocking object.
----
POE-Component-IRC-4.99
http://search.cpan.org/~bingos/POE-Component-IRC-4.99/
a fully event-driven IRC client module.
----
Perl-Dist-0.0.5
http://search.cpan.org/~dagolden/Perl-Dist-0.0.5/
Create binary Perl distributions
----
Perl-Dist-Strawberry-0.1.2
http://search.cpan.org/~dagolden/Perl-Dist-Strawberry-0.1.2/
Strawberry Perl for win32
----
Perl-Dist-v0.0.4
http://search.cpan.org/~dagolden/Perl-Dist-v0.0.4/
Create binary Perl distributions
----
Plagger-0.7.10
http://search.cpan.org/~miyagawa/Plagger-0.7.10/
Pluggable RSS/Atom Aggregator
----
Rose-DB-0.724
http://search.cpan.org/~jsiracusa/Rose-DB-0.724/
A DBI wrapper and abstraction layer.
----
Rose-DB-Object-0.751
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.751/
Extensible, high performance RDBMS-OO mapper.
----
Sort-Key-Top-0.01
http://search.cpan.org/~salva/Sort-Key-Top-0.01/
select and sort top n elements
----
Test-Manifest-1.16_01
http://search.cpan.org/~bdfoy/Test-Manifest-1.16_01/
interact with a t/test_manifest file
----
Test-Number-Delta-1.02
http://search.cpan.org/~dagolden/Test-Number-Delta-1.02/
Compare the difference between numbers against a given tolerance
----
Tie-Trace-0.01
http://search.cpan.org/~ktat/Tie-Trace-0.01/
easy print debugging with tie
----
WWW-CybozuOffice6-0.03
http://search.cpan.org/~kazuho/WWW-CybozuOffice6-0.03/
Perl extension for accessing Cybozu Office 6
----
Want-0.12
http://search.cpan.org/~robin/Want-0.12/
A generalisation of wantarray
----
Wx-Demo-0.02
http://search.cpan.org/~mbarbon/Wx-Demo-0.02/
the wxPerl demo
----
XML-Liberal-0.15
http://search.cpan.org/~miyagawa/XML-Liberal-0.15/
Super liberal XML parser that parses broken XML
----
XML-Liberal-0.16
http://search.cpan.org/~miyagawa/XML-Liberal-0.16/
Super liberal XML parser that parses broken XML
----
Xmldoom-0.0.15
http://search.cpan.org/~dsnopek/Xmldoom-0.0.15/
The XML Document Object-Oriented Model
----
hub-standard-03.01.002
http://search.cpan.org/~ryangies/hub-standard-03.01.002/
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: 29 Aug 2006 19:09:21 -0700
From: "alpha_beta_release" <youknows@gmail.com>
Subject: Re: Out of memory! When running perl script on windows
Message-Id: <1156903761.660112.79400@b28g2000cwb.googlegroups.com>
Ah yes, that for automatic reallocation (using closure {}). To tell
Perl explicitly ('we are done with this thing here') we use undef. BTW
i'm also suggesting to try multi threading.
Dr.Ruud wrote:
> alpha_beta_release schreef:
>
> > 2- undef not-used variable in the middle of script (sometimes these
> > variables hold huge data from file, and used only before parsing).
> > So undef after parsing, and before doing other task, to save memory.
>
> The variable needs to get out of scope AND not being referenced anymore,
> for the memory to be returned.
>
> perldoc -q memory
> perldoc -q shrink
>
> --
> Affijn, Ruud
>
> "Gewoon is een tijger."
------------------------------
Date: Wed, 30 Aug 2006 02:23:55 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Problem handling a Unicode file
Message-Id: <ed2sui.1ig.1@news.isolution.nl>
Peter J. Holzer schreef:
> Dr.Ruud:
>> MoshiachNow:
>>> all bytes are interchanged within the words
>>
>> That
> ^^^^
> Could you quote what you mean by "that"? It makes the your posting a
> bit hard to understand.
>
>> is the UTF16-LE order,
>
> Nope. The sequence MoshiachNow called "bad" is UTF16-BE.
Sorry for the confusion. My "That" was only the quoted phrase itself
(and not the meaning that it had in the original posting), to express
that the interchanged bytes from C<print "\x{FEFF}"> to (binary display)
"FF FE" was the thing to go for.
> [...]
>> You'll also find an Encoding "Unicode big-endian" there, that is
>> UTF16-BE. But why would you want the bytes in a different order than
>> the default for the platform?
>
> He doesn't. He wants UTF16-LE (what he labeled "good input file") but
> gets UTF16-BE instead.
Yes, I mixed up there, I think because I couldn't understand why he
didn't just go for ':encoding(UTF16)'.
Sidenote:
#!/usr/bin/perl
# Script-ID: utf16.pl
use warnings ;
use strict ;
my ($fno, $eo) = ('utf16.txt', ':encoding(UTF16)') ;
open my $fho, ">$eo", $fno or die "open '$fno': $!" ;
print $fho "\n" ;
__END__
results in a 5 byte file (Windows, Perl 5.8.8):
FE FF 00 0D 0A
Anyone knows a good reason for why that doesn't result in:
FE FF 00 0D 00 0A
?
(I understand how it happens, but the "why" escapes me.)
With
':raw:encoding(UTF16)'
and
print $fho "\r\n"
one can produce the "right" output of course.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 30 Aug 2006 08:26:46 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Problem handling a Unicode file
Message-Id: <slrnefabt9.pgb.hjp-usenet2@yoyo.hjp.at>
On 2006-08-30 00:23, Dr.Ruud <rvtol+news@isolution.nl> wrote:
> Sidenote:
>
> #!/usr/bin/perl
> # Script-ID: utf16.pl
> use warnings ;
> use strict ;
>
> my ($fno, $eo) = ('utf16.txt', ':encoding(UTF16)') ;
> open my $fho, ">$eo", $fno or die "open '$fno': $!" ;
> print $fho "\n" ;
> __END__
>
> results in a 5 byte file (Windows, Perl 5.8.8):
> FE FF 00 0D 0A
>
> Anyone knows a good reason for why that doesn't result in:
> FE FF 00 0D 00 0A
> ?
> (I understand how it happens, but the "why" escapes me.)
I think the "why" is a simple bug.
> With
> ':raw:encoding(UTF16)'
> and
> print $fho "\r\n"
> one can produce the "right" output of course.
It looks like the :crlf layer is applied in the wrong place (after
:encoding(UTF16) instead of before).
my ($fno, $eo) = ('utf16.txt', 'encoding(UTF-16):crlf') ;
open my $fho, ">$eo", $fno or die "open '$fno': $!" ;
print $fho "\n" ;
also produces the right result (for Windows) on Linux, so I guess
my ($fno, $eo) = ('utf16.txt', ':raw:encoding(UTF-16):crlf') ;
open my $fho, ">$eo", $fno or die "open '$fno': $!" ;
print $fho "\n" ;
should work on Windows (don't have a Windows machine at hand to test
it).
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: Wed, 30 Aug 2006 07:20:48 +0200
From: "Mark" <admin@asarian-host.net>
Subject: Returning raw xml in SOAP::Lite
Message-Id: <JaGdnd-R8eWvvWjZRVnygg@giganews.com>
Dear Perl folks,
Using Perl 5.8.7 and SOAP::Lite 0.69, consider please this small example
from perl.com:
-----------------
#!perl -w
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
-> dispatch_to('Demo')
-> handle;
package Demo;
sub hi {
return "hello, world";
}
sub bye {
return "goodbye, cruel world";
}
-----------------
Now, I got SOAP service set up like that. But what I want, instead of,
say, return ("goodbye, cruel world");, is to return a RAW xml stream,
complete with xml envelope and all (the xml is generated in another
place), and parse that straight back to the client.
Now, I tried several things; like setting outputxml => 1. Or this:
$xml = SOAP::Data->type('xml' => $raw);
return ($xml);
(and yes, $raw is defined within the "Demo" package). But the result is
always the same: SOAP::Lite returns an empty SOAP envelope. For the life
of me I just cannot get SOAP::Lite to just output my raw data to the
client.
I am kinda new to SOAP, and quite obviously missing something. If someone
has any ideas, I'll be glad to hear them.
Thanks,
- Mark
------------------------------
Date: Tue, 29 Aug 2006 15:38:32 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Serving a website based on internet source address ?
Message-Id: <slrnef99e8.fkn.tadmc@magna.augustmail.com>
Skybuck <skybuck2000@hotmail.com> wrote:
> Based on the source internet address a different version of the website
> should be presented/served to the user/browser.
>
> For example in pseudo code:
>
> if SourceAddress = '143.3.5.1' then
> begin
> ShowBlueWebsite; // Load/Show BlueIndex.htm
> end else
> if SourceAddress = '124.5.15.7' then
> begin
> ShowRedWebsite; // LoadShow RedIndex.htm
> end;
>
> Is this possible with perl ?
Yes.
> is there any source code available to do
> this trick ?
If you know any Perl, it is so trivial that I doubt anyone
would package it up.
You need to write 5 or 10 lines of Perl code to do that.
http://learn.perl.org
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 29 Aug 2006 19:34:44 -0700
From: "alpha_beta_release" <youknows@gmail.com>
Subject: Re: Serving a website based on internet source address ?
Message-Id: <1156905284.540807.277390@74g2000cwt.googlegroups.com>
>> if SourceAddress = '124.5.15.7' then
And if you mean technical thing of how to get the address, look for
ENVironment variables
or some CGI modules may help (CGI.pm etc)
------------------------------
Date: Wed, 30 Aug 2006 09:03:07 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Serving a website based on internet source address ?
Message-Id: <4lkri0F2cohuU1@individual.net>
J. Gleixner wrote:
> With a CGI processing the request, you could send a "redirect" header,
> which would redirect the browser to a different URL, however that would
> mean that the page is being generated by a CGI in the first place. If
> that's the case, and you're using perl, look for 'redirect' and
> 'remote_host' in:
>
> perldoc CGI
What if it's a high traffic web site? CGI.pm is a heavyweight module,
and I would advise against using it for a redirect CGI script.
#!/usr/bin/perl
%redir = ('143.3.5.1' => 'BlueIndex', '124.5.15.7' => 'RedIndex');
print 'Location: /', $redir{ $ENV{REMOTE_ADDR} } || 'index', ".htm\n\n";
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 29 Aug 2006 23:39:08 -0700
From: "goodarm@gmail.com" <goodarm@gmail.com>
Subject: Re: Stupid Q: How to preserve numeric characters
Message-Id: <1156919948.112257.252510@h48g2000cwc.googlegroups.com>
Thanks a lot for your reply,
...unfortunately, doesn't seem to work. From the documentation you
refered to "By default, the attr and @attr argspecs will have general
entities for attribute values decoded. Enabling this attribute leaves
entities alone." - so I guess this applies to the attribute value,
while I am trying to scrap the text of the node.
In any case, I did as you suggested and got the same results.
It's drving me crazy, there has to be a very simple way to do that...
Victor
himanshu.garg@gmail.com wrote:
> goodarm@gmail.com wrote:
>
> > Gurus,
> >
> > I am relatively new to Perl so please bear with me. I am trying to
> > write a simple scrapper for a non-English Web pages. For that purpose I
> > am using HTML::TokeParser. Now, I am looking to extract some content I
> > need and generate another HTML page (whch potentially will have notes
> > in multiple languages). The pages I am scrapping are written using
> > numeric characters, e.g. оду, when I am extracting
> > them, then injecting into my HTML page they get converted into
> > charaecters. All I want - is to preserve the original numeric
> > characters, as it seems to be the easiest way to build my result page.
> > How do I do that?
> >
> > A sample code:
> >
> > sub parseResponce($$) {
> > my $data = shift;
> > my $stream = new HTML::TokeParser($data);
> >
> > while (my $tag = $stream->get_tag("p")) {
> > if (...) {
> > $buff = $stream->get_trimmed_text("/p");
> > }
> > }
>
> You could try the method from its parent class
>
> $stream->attr_encoded( 1 );
>
> before calling get_tag.
>
> See Also:-
>
> http://search.cpan.org/~gaas/HTML-Parser-3.55/Parser.pm
>
> >
> > Thanks in advance, Victor
>
> Thank You,
> ++imanshu
------------------------------
Date: 29 Aug 2006 23:46:29 -0700
From: "goodarm@gmail.com" <goodarm@gmail.com>
Subject: Re: Stupid Q: How to preserve numeric characters
Message-Id: <1156920389.776303.297110@i3g2000cwc.googlegroups.com>
...in the meantime I found a workaround:
instead of
$buff = $stream->get_trimmed_text("/p");
do
$buff = HTML::Entities::encode_entities_numeric(
$stream->get_trimmed_text("/p") );
I am still not convinced it's the right way of dealing with the stuff,
but at least it works...
V
goodarm@gmail.com wrote:
> Thanks a lot for your reply,
>
> ...unfortunately, doesn't seem to work. From the documentation you
> refered to "By default, the attr and @attr argspecs will have general
> entities for attribute values decoded. Enabling this attribute leaves
> entities alone." - so I guess this applies to the attribute value,
> while I am trying to scrap the text of the node.
>
> In any case, I did as you suggested and got the same results.
>
> It's drving me crazy, there has to be a very simple way to do that...
>
> Victor
>
>
> himanshu.garg@gmail.com wrote:
> > goodarm@gmail.com wrote:
> >
> > > Gurus,
> > >
> > > I am relatively new to Perl so please bear with me. I am trying to
> > > write a simple scrapper for a non-English Web pages. For that purpose I
> > > am using HTML::TokeParser. Now, I am looking to extract some content I
> > > need and generate another HTML page (whch potentially will have notes
> > > in multiple languages). The pages I am scrapping are written using
> > > numeric characters, e.g. оду, when I am extracting
> > > them, then injecting into my HTML page they get converted into
> > > charaecters. All I want - is to preserve the original numeric
> > > characters, as it seems to be the easiest way to build my result page.
> > > How do I do that?
> > >
> > > A sample code:
> > >
> > > sub parseResponce($$) {
> > > my $data = shift;
> > > my $stream = new HTML::TokeParser($data);
> > >
> > > while (my $tag = $stream->get_tag("p")) {
> > > if (...) {
> > > $buff = $stream->get_trimmed_text("/p");
> > > }
> > > }
> >
> > You could try the method from its parent class
> >
> > $stream->attr_encoded( 1 );
> >
> > before calling get_tag.
> >
> > See Also:-
> >
> > http://search.cpan.org/~gaas/HTML-Parser-3.55/Parser.pm
> >
> > >
> > > Thanks in advance, Victor
> >
> > Thank You,
> > ++imanshu
------------------------------
Date: Wed, 30 Aug 2006 02:56:42 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Working with Source Code to Insert Copyright Statements as a Header
Message-Id: <ed2v0f.j4.1@news.isolution.nl>
Peter J. Holzer schreef:
> Dr.Ruud:
>> Perlgirl:
>>> Insertion of a copyright statement needs to only search
>>> through all text_files
>>> (*.c, .doc, .java, .xml, .pl, .sh. assembler_source, .txt .vbs .any
>>> ascii english text, etc etc etc) at the top of the file
>>
>> This can not be done without breaking many of those files. At the
>> top of the file there is often specific information about how the
>> file should be handled.
>
> I don't think "at the top of the file" was meant so literally.
I didn't think so too, as you should have read in my sentence that
followed. But because of the increasing vagueness from ".doc" (certainly
not MS-Word too?) to ".sh. assembler source" to ".any ascii english
text" and then "etc"x3, I wouldn't bet any money on it either.
>> But even if you would insert it at line 2 or below, the file
>> would often no longer be useful as a .c/java/xml/pl/etc. file. Is
>> that not a problem?
>
> It just means you have to be more careful.
No, the list is just too vague and it's just to easy to create a
(possibly nasty) example for many of those types that would end up
corrupted.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
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 9664
***************************************