[30366] in Perl-Users-Digest
Perl-Users Digest, Issue: 1609 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 4 03:09:42 2008
Date: Wed, 4 Jun 2008 00:09: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 Wed, 4 Jun 2008 Volume: 11 Number: 1609
Today's topics:
Re: advice on good perl idiom <tadmc@seesig.invalid>
Re: advice on good perl idiom <willem@stack.nl>
building goocanvas <deadpickle@gmail.com>
eperl help: multi-pass processing <workitharder@gmail.com>
Re: formatting question <xiaoxia2005a@yahoo.com>
Re: formatting question <xiaoxia2005a@yahoo.com>
Re: How to set environmental variables before running a <brian.helterline@hp.com>
Re: How to set environmental variables before running a <m@rtij.nl.invlalid>
Re: MD5 and SHA1 fingerprint from SSL certificates <m@rtij.nl.invlalid>
new CPAN modules on Wed Jun 4 2008 (Randal Schwartz)
Re: OT: SI units (was sorting a hash / 2008-06-01) <tadmc@seesig.invalid>
Re: OT: SI units (was sorting a hash / 2008-06-01) <szrRE@szromanMO.comVE>
Re: OT: SI units (was sorting a hash / 2008-06-01) <m@rtij.nl.invlalid>
Re: Perl grep and Perl 4 <hansmu@xs4all.nl>
Re: The select() (IO::Select) function has a limit? <mcanato@gmail.com>
Re: XML::Parser Tree Style <rvtol+news@isolution.nl>
Re: XML::Parser Tree Style <rvtol+news@isolution.nl>
Re: XML::Parser Tree Style <szrRE@szromanMO.comVE>
Re: XML::Parser Tree Style <tadmc@seesig.invalid>
Re: XML::Parser Tree Style <someone@example.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 3 Jun 2008 20:25:03 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: advice on good perl idiom
Message-Id: <slrng4brnf.55g.tadmc@tadmc30.sbcglobal.net>
Jürgen Exner <jurgenex@hotmail.com> wrote:
> Mike Hunter <mhunter@lusArs.net> wrote:
>>Recently I was coding and wanted to see which of 4 strings had the
>>largest result when passed to a function.
> Conceptually you just loop through the data set and remember, which
> element produced the best result so far:
That is known as the "high water mark" algorithm.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 4 Jun 2008 06:01:10 +0000 (UTC)
From: Willem <willem@stack.nl>
Subject: Re: advice on good perl idiom
Message-Id: <slrng4cbt6.2vt5.willem@snail.stack.nl>
Mike wrote:
) Hey folks,
)
) Recently I was coding and wanted to see which of 4 strings had the
) largest result when passed to a function. This is what I ened up
) writing:
)
) while (...)
) {
)
) my @roundArr;
) push @roundArr, [$A, check($goodPrefix.$A)];
) push @roundArr, [$C, check($goodPrefix.$C)];
) push @roundArr, [$T, check($goodPrefix.$T)];
) push @roundArr, [$G, check($goodPrefix.$G)];
)
) @roundArr = sort {$b->[1] <=> $a->[1]} @roundArr;
) print $roundArr[0]->[0]." wins!\n";
)
) }
)
) The code works fine, but I can't help but think there's a better idiom
) for what I'm trying to do. I get a little bit of a creepy feeling by
) using an array, I feel like I should be doing something with a hash. I
) guess there's no way of getting around having to associate the given
) check() result with the particular input.
You only want the best result, right ? So there's no need to be
remembering the other results, let alone sorting them:
sub largest {
my $fun = shift;
my $maxStr = shift;
my $maxRes = $fun->($maxStr);
for (@_) {
my $res = $fun->($_);
if ($res > $maxRes) {
($maxStr, $maxRes) = ($_, $res);
}
}
return $maxStr;
}
my $winner = largest(sub { check($goodPrefix.shift) }, $A, $C, $T, $G);
print "$winner wins!\n";
) Any thoughts on some awesome one-liner that I can't see?
If you don't count the 'largest' function, it's a one-liner. :-)
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
------------------------------
Date: Tue, 3 Jun 2008 16:20:45 -0700 (PDT)
From: deadpickle <deadpickle@gmail.com>
Subject: building goocanvas
Message-Id: <889ad552-84f9-4088-a96f-af1640c4ee7c@d45g2000hsc.googlegroups.com>
I want to build goocanvas 0.10 on my windows system. how do I run ./
configure in windows?
------------------------------
Date: Tue, 3 Jun 2008 16:20:36 -0700 (PDT)
From: bukzor <workitharder@gmail.com>
Subject: eperl help: multi-pass processing
Message-Id: <675692f7-8947-4ecb-b755-a342295ed89a@y38g2000hsy.googlegroups.com>
I'm sorry this is about eperl. If you know a better place to post,
please let me know.
One of our systems uses a set of eperl files to hold our configuration
parameters. Multiple passes are done on the configuration file to make
sure that all eperl is interpolated. The problem is that sometimes the
printout of a variable gets moved to before the assignment of the
variable (don't ask why). For example:
[code]
PARAM1 = <:=$some_variable:>
<:
$some_variable="some_value"
:>
[/code]
Let's assume this can't be helped. On the first pass, the first line
is left alone because that variable has no value, but the second block
of eperl is deleted (since it doesn't print anything). We *do* have
the variable with the correct value in memory, but it doesn't help
much since we're past the point where it's used.
Two possible solutions (that I don't know how to implement):
1. Print out the values of all variables in memory into a file and
load them before starting the next pass of eperl
2. Somehow make eperl go back and interpolate the file again without
exiting.
Sorry again for being OT.
Thanks in advance,
--Buck
------------------------------
Date: Tue, 3 Jun 2008 17:44:31 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: Re: formatting question
Message-Id: <805075a9-15ab-4015-a074-b09669f46635@x35g2000hsb.googlegroups.com>
On Jun 3, 3:48=A0pm, RedGrittyBrick <RedGrittyBr...@SpamWeary.foo>
wrote:
> April wrote:
> > sprintf( "%s%$Fmt%s", ("%$Fmt=3D|", $TestStr, "|"))
>
> > This is in Perl for Dummies, 4th ed, p160.
>
> > I'm trying to understand this ...
>
> > the first part, "%s%$Fmt%s", my understanding is the format part,
> > which specifies the formats for the second part, thelist part, ("%
> > $Fmt=3D|", $TestStr, "|"): %s for "%$Fmt=3D|", %$Fmt for $TestStr, and %=
s
> > for "|", respectively. =A0Is this correct?
>
> > Then what is %$Fmt, it seems a % for format and then a variable $Fmt,
> > the book did not mention any format string like this ...
>
> Double quoted strings are processed and the results of that processing
> are then used in the rest of the expression. This applies everywhere in
> Perl. Part of that processing is interpolation of variables. This is
> part of string handling in general and not specifically part of the job
> done by printf() - which is why string-interpolation isn't mentioned in
> the documentation for printf.
>
> If $Fmt contains 's' then =A0"%s%$Fmt%s" is '%s%s%s'
>
> If $TestStr contains 'teststring' the result of the original sprintf()
> is then '%s=3D|teststring|'
>
>
>
> > Anyone can shed some light? =A0Thanks!
>
> Presumably the author uses this in some sort of loop to illustrate the
> effects of various formatting characters.
>
> --
> RGB
Thanks RGB, this is very helpful. Although it is at a higher level to
explain, comparing what Ben described in his post, I think I
understand what you explained. Thanks you again!
------------------------------
Date: Tue, 3 Jun 2008 17:48:29 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: Re: formatting question
Message-Id: <57a32495-0f27-4cdb-b581-b20b7e5f2a58@j22g2000hsf.googlegroups.com>
On Jun 3, 4:50=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth April <xiaoxia20...@yahoo.com>:
>
> > sprintf( "%s%$Fmt%s", ("%$Fmt=3D|", $TestStr, "|"))
>
> A few more lines of code showing what $Fmt and $TestStr are set to would
> be useful... I'm going to guess you were using something like
>
> =A0 =A0 my $Fmt =A0 =A0 =3D 'f';
> =A0 =A0 my $TestStr =3D '1.004';
>
> in which case you would get the string '%f=3D|1.004000|' back from
> sprintf.
>
> > This is in Perl for Dummies, 4th ed, p160.
>
> Hmmm, I would suggest you find a new book. Quite apart from the fact
> I've never heard anything good about any of the 'for Dummies' books,
> the expression you gave is *not* a clear way to write what they wanted.
> 'Learning Perl', published by O'Reilly, is the standard recommendation;
> for others, see perldoc -q book orhttp://books.perl.org.
>
> > I'm trying to understand this ...
>
> > the first part, "%s%$Fmt%s", my understanding is the format part,
> > which specifies the formats for the second part, thelist part, ("%
> > $Fmt=3D|", $TestStr, "|"):
>
> Firstly, there is no 'first part' and 'second part', and the inner set
> of parens are completely unnecessary. The important point is that
> sprintf treats its first argument specially, and uses it to format the
> rest.
>
> > %s for "%$Fmt=3D|", %$Fmt for $TestStr, and %s for "|", respectively. Is=
> > this correct?
>
> Yes.
>
> > Then what is %$Fmt, it seems a % for format and then a variable $Fmt,
> > the book did not mention any format string like this ...
>
> What you are not understanding is that there are two levels of
> intepretation going on here. (This is one of the reasons I would not
> write it like that: it's confusing.)
>
> First Perl expands the double-quoted strings, so given the values I was
> assuming above sprintf gets passed the list
>
> =A0 =A0 '%s%f%s', '%f=3D|', '1.004', '|'
>
> which I've written with single-quotes to show they aren't going to be
> expanded again by Perl. Then sprintf takes the first argument, and
> formats the rest in the appropriate places, so
>
> =A0 =A0 %s -> %f=3D|
> =A0 =A0 %f -> 1.004000
> =A0 =A0 %s -> |
>
> =A0 =A0 %s%f%s -> %f=3D|1.004000|
>
> I presume the aim here is to let you put in various values for $TestStr,
> and various formats, and show you how sprintf would intepret them.
>
> I would have writted it as
>
> =A0 =A0 sprintf "%%$Fmt=3D|%$Fmt|", $TestStr
>
> or perhaps even
>
> =A0 =A0 "%$Fmt=3D|" . sprintf("%$Fmt", $TestStr) . '|'
>
> which, although it still looks a little like line-noise, is probably
> easier to understand.
>
> Ben
>
> --
> Raise your hand if you're invulnerable.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[b...@morrow.me.uk]
Thank you very much Ben for spending so much time with details and
examples, you explained really well and I think I do understand this
piece of the language now. Thanks again Ben!
------------------------------
Date: Tue, 03 Jun 2008 20:58:09 -0700
From: Brian Helterlilne <brian.helterline@hp.com>
Subject: Re: How to set environmental variables before running another command?
Message-Id: <g253si$rv0$1@usenet01.boi.hp.com>
Meal wrote:
> On Jun 3, 2:02 pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>> Meal <meed...@gmail.com> wrote:
>>>> Just set the env vars in the parent process (i.e. your Perl script) and
>>>> the child processes (build script) will inherit them.
>>>> jue
>>> Thanks to both of you.
>>> It seems there's no other way.
>>> The .cmd file to set the variables is rather large, I definitely don't
>>> want to set that much variables manually.
>> Nobody is talking about setting them manually. Just set them in your
>> Perl script.
>>
>> jue
>
> Well, set them "manually" in my perl script.
> I want a way that I don't need to take care of the content of the .cmd
> file.
Why not read in the .cmd file and parse it and then set up your
environment from within your script? If the only thing in the .cmd file
is SET var=value then you can easily parse it and translate those into
$ENV{var}=value. If other things are allowed in .cmd then you'll have
to deal with them as well.
--
-brian
------------------------------
Date: Wed, 4 Jun 2008 08:36:57 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: How to set environmental variables before running another command?
Message-Id: <pan.2008.06.04.06.36.57@rtij.nl.invlalid>
On Tue, 03 Jun 2008 14:47:45 -0700, Meal wrote:
> Well, set them "manually" in my perl script. I want a way that I don't
> need to take care of the content of the .cmd file.
Solution #1
Write a perl program to write a commandfile. That commandfile calls the
commandfile with the settings and everything else. The Perl script first
writes the .cmd script with all the commands needed, then execs it.
Solution #2
Or create a wrapper .cmd script:
:: wrapper script
:: First set up the environment
call myenv.cmd
:: Now the environment is set up correctly, call the perl program
perl myprog.pl
( Never use REM, us :: for comments in .cmd scripts )
Solution #3
Or do a dirty trick (untested script)
#!/usr/bin/perl
use strict; use warnings;
use FindBin qw($Bin);
unless ($ENV{ENV_IS_SETUP}) {
$ENV{ENV_IS_SETUP} = 1;
exec "$Bin/myenv.cmd & $0";
die "Cannot exec";
}
... rest of script ...
In the last two solutions, it is hard to pass on any parameters to the
Perl script (correctly). This is because passing arguments and quoting is
hard in .cmd. Maybe there is a good solution in .cmd language, ask in an
appropriate group for that.
A way around that for the second solution would be to save the arguments
in the environment abd restore later (completely untested):
unless ($ENV{ENV_IS_SETUP}) {
$ENV{ENV_IS_SETUP} = 1;
my $n=0;
for (@ARGV) {
$ENV{"MY_ARG_$n"} = $_;
$n++;
}
exec "$Bin/myenv.cmd & $0";
die "Cannot exec";
}
# restore command lines args
for (grep /^MY_ARG_(\d+)/, keys %ENV) {
$ARGV[$1] = $ENV{$_};
}
... rest of script ...
HTH,
M4
------------------------------
Date: Wed, 4 Jun 2008 08:50:57 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: MD5 and SHA1 fingerprint from SSL certificates
Message-Id: <pan.2008.06.04.06.50.57@rtij.nl.invlalid>
On Tue, 03 Jun 2008 17:53:42 +0000, toralf wrote:
> I'm wondering,
>
> who I can derive these 2 values from my local https daemon. Currently I
> try it w/ IO::Socket::SSL, but do not know how to continue :
>
> tfoerste@n22 ~ $ perl -we 'use IO::Socket::SSL; my $client =
> IO::Socket::SSL->new("n22:https"); print
> $client->dump_peer_certificate(), $client->get_cipher(), "\n",
> $client->peer_certificate(), "\n";' Subject Name:
> /C=DE/ST=HAmburg/L=Hamburg/O=Apache HTTP Server/OU=Test
> Certificate/CN=n22/emailAddress=root@n22 Issuer Name:
> /C=DE/ST=Hamburg/L=Hamburg/O=Apache HTTP Server/OU=For testing purposes
> only/CN=n22/emailAddress=root@localhost DHE-RSA-AES256-SHA
> 137497664
Seems IO::Socket::SSL cannot do this, at least I could not find it in the
documentation. Nothing for it, but use Net::SSLeay directly and hope it's
dump_peer_certificate is better, otherwise get dirty with Net::SSLeay and
it's SSLeay low level bindings.
M4
------------------------------
Date: Wed, 4 Jun 2008 04:42:18 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Jun 4 2008
Message-Id: <K1x92I.1HK1@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.
AnyEvent-4.12
http://search.cpan.org/~mlehmann/AnyEvent-4.12/
provide framework for multiple event loops
----
Archive-Lha-0.03_02
http://search.cpan.org/~ishigaki/Archive-Lha-0.03_02/
extract .LZH archives
----
Business-OnlinePayment-Skipjack-0.04
http://search.cpan.org/~ivan/Business-OnlinePayment-Skipjack-0.04/
Skipjack backend module for Business::OnlinePayment
----
CPAN-Reporter-1.15_50
http://search.cpan.org/~dagolden/CPAN-Reporter-1.15_50/
Adds CPAN Testers reporting to CPAN.pm
----
CPAN-Reporter-Smoker-0.12
http://search.cpan.org/~dagolden/CPAN-Reporter-Smoker-0.12/
Turnkey CPAN Testers smoking
----
Catalyst-Devel-1.07
http://search.cpan.org/~mramberg/Catalyst-Devel-1.07/
Catalyst Development Tools
----
Catalyst-Manual-5.7012
http://search.cpan.org/~zarquon/Catalyst-Manual-5.7012/
The Catalyst developer's manual
----
Catalyst-Plugin-CustomErrorMessage-0.03_02
http://search.cpan.org/~jkutej/Catalyst-Plugin-CustomErrorMessage-0.03_02/
Catalyst plugin to have more "cute" error message.
----
Chart-Math-Axis-1.05
http://search.cpan.org/~adamk/Chart-Math-Axis-1.05/
Implements an algorithm to find good values for chart axis
----
DBIx-Class-ProxyTable-0.02
http://search.cpan.org/~nekokak/DBIx-Class-ProxyTable-0.02/
without generating a schema
----
DBIx-DBStag-0.10
http://search.cpan.org/~cmungall/DBIx-DBStag-0.10/
Relational Database to Hierarchical (Stag/XML) Mapping
----
Data-Stag-0.11
http://search.cpan.org/~cmungall/Data-Stag-0.11/
Structured Tags datastructures
----
DateTime-TimeZone-0.7701
http://search.cpan.org/~drolsky/DateTime-TimeZone-0.7701/
Time zone object base class and factory
----
Devel-Declare-0.001009
http://search.cpan.org/~mstrout/Devel-Declare-0.001009/
----
Devel-REPL-Plugin-NAS-0.0601
http://search.cpan.org/~oliver/Devel-REPL-Plugin-NAS-0.0601/
Add Perl to your network devices' command line interfaces
----
Devel-REPL-Plugin-NAS-0.0602
http://search.cpan.org/~oliver/Devel-REPL-Plugin-NAS-0.0602/
Add Perl to your network devices' command line interfaces
----
Finance-Currency-Convert-WebserviceX-0.07000
http://search.cpan.org/~claco/Finance-Currency-Convert-WebserviceX-0.07000/
Lightweight currency conversion using WebserviceX.NET
----
GRID-Machine-0.094
http://search.cpan.org/~casiano/GRID-Machine-0.094/
Remote Procedure Calls over a SSH link
----
IWL-0.60
http://search.cpan.org/~viktork/IWL-0.60/
A widget library for the web
----
IWL-SWFUpload-0.6.0
http://search.cpan.org/~viktork/IWL-SWFUpload-0.6.0/
a file upload widget using the flash swfupload library
----
JSON-XS-2.21
http://search.cpan.org/~mlehmann/JSON-XS-2.21/
JSON serialising/deserialising, done correctly and fast
----
LEOCHARRE-CLI-1.18
http://search.cpan.org/~leocharre/LEOCHARRE-CLI-1.18/
useful subs for coding cli scripts
----
Lingua-Jspell-1.55
http://search.cpan.org/~ambs/Lingua-Jspell-1.55/
Perl interface to the Jspell morphological analyser.
----
Lingua-RU-Detect-1.1
http://search.cpan.org/~andy/Lingua-RU-Detect-1.1/
Heuristics for guessing encoding sequence
----
Lingua-SA-0.06
http://search.cpan.org/~aschig/Lingua-SA-0.06/
Perl extension for the language Sanskrit
----
MIME-BodyMunger-0.003
http://search.cpan.org/~rjbs/MIME-BodyMunger-0.003/
rewrite the content of text parts, minding charset
----
MIME-BodyMunger-0.004
http://search.cpan.org/~rjbs/MIME-BodyMunger-0.004/
rewrite the content of text parts, minding charset
----
Mail-DKIM-0.32
http://search.cpan.org/~jaslong/Mail-DKIM-0.32/
Signs/verifies Internet mail with DKIM/DomainKey signatures
----
Mail-IMAPClient-3.08
http://search.cpan.org/~markov/Mail-IMAPClient-3.08/
An IMAP Client API
----
Math-Random-MT-Perl-1.05
http://search.cpan.org/~jfreeman/Math-Random-MT-Perl-1.05/
Pure Perl Mersenne Twister Random Number Generator
----
Net-Appliance-Phrasebook-1.2
http://search.cpan.org/~oliver/Net-Appliance-Phrasebook-1.2/
Network appliance command-line phrasebook
----
Net-Appliance-Session-1.23
http://search.cpan.org/~oliver/Net-Appliance-Session-1.23/
Run command-line sessions to network appliances
----
Net-OAuth-0.09
http://search.cpan.org/~kgrennan/Net-OAuth-0.09/
OAuth protocol support
----
Net-Rsh-0.05
http://search.cpan.org/~aslett/Net-Rsh-0.05/
perl client for Rsh protocol
----
Number-Phone-JP-0.12
http://search.cpan.org/~taniguchi/Number-Phone-JP-0.12/
Validate Japanese phone numbers
----
OpenResty-0.3.2
http://search.cpan.org/~agent/OpenResty-0.3.2/
General-purpose web service platform for web applications
----
PDF-Create-1.01
http://search.cpan.org/~markusb/PDF-Create-1.01/
create PDF files
----
PLP-3.22_01
http://search.cpan.org/~shiar/PLP-3.22_01/
Perl in HTML pages
----
POE-Loop-Glib-0.0034
http://search.cpan.org/~martijn/POE-Loop-Glib-0.0034/
a bridge that supports Glib's event loop from POE
----
Parse-Fedora-Packages-0.02
http://search.cpan.org/~szabgab/Parse-Fedora-Packages-0.02/
Parse Fedora package information
----
PerlIO-Util-0.32
http://search.cpan.org/~gfuji/PerlIO-Util-0.32/
A selection of general PerlIO utilities
----
Pod-Simple-3.06
http://search.cpan.org/~arandal/Pod-Simple-3.06/
framework for parsing Pod
----
RPC-JSON-0.12
http://search.cpan.org/~jshirley/RPC-JSON-0.12/
JSON-RPC Client Library
----
SQL-String-0.02
http://search.cpan.org/~adamk/SQL-String-0.02/
An object representation of a chunk of SQL
----
Scalar-Vec-Util-0.05
http://search.cpan.org/~vpit/Scalar-Vec-Util-0.05/
Utility routines for vec strings.
----
Sman-1.03_002
http://search.cpan.org/~joshr/Sman-1.03_002/
Tool for searching and indexing man pages
----
Test-Deep-0.103
http://search.cpan.org/~fdaly/Test-Deep-0.103/
Extremely flexible deep comparison
----
ThreatNet-0.20
http://search.cpan.org/~adamk/ThreatNet-0.20/
Pooled intelligence sharing of realtime hostile internet hosts
----
ThreatNet-DATN2004-0.20
http://search.cpan.org/~adamk/ThreatNet-DATN2004-0.20/
Proposal: The Decentralised Active Threat Network
----
URI-http-Dump-0.03
http://search.cpan.org/~ecarroll/URI-http-Dump-0.03/
A module to assist in the reverse engineering of URL parameters.
----
Validate-Net-0.6
http://search.cpan.org/~adamk/Validate-Net-0.6/
Format validation for Net:: related strings
----
WebService-Wedata-v0.0.4
http://search.cpan.org/~koyachi/WebService-Wedata-v0.0.4/
Perl Interface for wedata.net
----
Win32-WindowsMedia-0.253
http://search.cpan.org/~shamrock/Win32-WindowsMedia-0.253/
Base Module for Provisiong and control for Windows Media Services
----
XXX-0.12
http://search.cpan.org/~ingy/XXX-0.12/
See Your Data in the Nude
----
autobox-Numeric-Bytes-0.02
http://search.cpan.org/~hirose/autobox-Numeric-Bytes-0.02/
ActiveSupport equivalent to Perl numeric variables
----
autobox-Numeric-Time-0.02
http://search.cpan.org/~hirose/autobox-Numeric-Time-0.02/
ActiveSupport equivalent to Perl numeric variables
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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Tue, 3 Jun 2008 20:41:10 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: OT: SI units (was sorting a hash / 2008-06-01)
Message-Id: <slrng4bslm.55g.tadmc@tadmc30.sbcglobal.net>
sheinrich@my-deja.com <sheinrich@my-deja.com> wrote:
> But if a nation, claiming involvement in world leadership, is even
> after decades not even starting to adopt the actual world wide
> accepted standards it deservedly gives place to ridicule.
I agree.
> It looks to me like the US want to claim and preserve a history by
> clinging to states and singular events from the past.
Us Mercans are just an extremely old fashioned lot.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Tue, 3 Jun 2008 20:51:21 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: OT: SI units (was sorting a hash / 2008-06-01)
Message-Id: <g253fq06pd@news4.newsguy.com>
sheinrich@my-deja.com wrote:
[...]
> BTW: I think that when I'm negotiating for a used car in Outback
> Australia, then I can't complain if the owner is fussing about how low
> she's running in miles per gallon - although Australia officially
> adopted SI units some time ago (1960).
> But if a nation, claiming involvement in world leadership, is even
> after decades not even starting to adopt the actual world wide
> accepted standards it deservedly gives place to ridicule.
Granted, though a lot of ridicule seem to also come from the UK, despite
the fact that they use some of their own units for certai nthings (like
their own Gallons and Ounces.) It's not just the USA that uses different
units for some things, any many people who ridicule the USA for it
forget that all too easily.
--
szr
------------------------------
Date: Wed, 4 Jun 2008 09:00:27 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: OT: SI units (was sorting a hash / 2008-06-01)
Message-Id: <pan.2008.06.04.07.00.27@rtij.nl.invlalid>
On Tue, 03 Jun 2008 20:51:21 -0700, szr wrote:
> Granted, though a lot of ridicule seem to also come from the UK, despite
> the fact that they use some of their own units for certai nthings (like
> their own Gallons and Ounces.) It's not just the USA that uses different
> units for some things, any many people who ridicule the USA for it
> forget that all too easily.
Don't worry, we ridicule them all. :-)
M4
------------------------------
Date: Wed, 04 Jun 2008 00:17:09 +0200
From: Hans Mulder <hansmu@xs4all.nl>
Subject: Re: Perl grep and Perl 4
Message-Id: <4845c2e0$0$14345$e4fe514c@news.xs4all.nl>
Glenn Jackman wrote:
> At 2008-06-03 12:50PM, "fourfour2@gmail.com" wrote:
>> I'm using Perl 4 and .....
[....]
>> print "Not found in list....\n"
>> }
That's not valid perl 4. In perl 4 you must write a ';' at the end
of each statement. In perl 5 it's optional for the last statement
in the block; not so in perl 4.
> see: perldoc -f quotemeta
Perl 4 did not have quotemeta (nor perldoc, for that matter).
> print "in list" if grep(/^\Q$potatoe\E$/, @listofpotatoes);
Nor did it have \Q.
> or, since you're just testing for equality:
>
> print "in list" if grep($_ eq $potatoe, @listofpotatoes)
>
> (tested in perl 5.8.8)
Try:
$potatoe="thisisstring(one)";
@listofpotatoes=("thisisstring(one)", "thisisafunnystring");
$quayle = $potatoe;
$quayle =~ s/(\W)/\\$1/g;
if ( !grep(/$quayle/, @listofpotatoes)) {
print "Not found in list....\n";
}
(tested in perl 4.036)
The OP should try to find a 15 year old copy of the FAQ.
This s/(\W)/\\$1/g thing was discussed in the FAQ back then.
Hope this helps,
-- HansM
------------------------------
Date: Tue, 3 Jun 2008 23:44:40 -0700 (PDT)
From: peste <mcanato@gmail.com>
Subject: Re: The select() (IO::Select) function has a limit?
Message-Id: <31933bd9-6413-49a0-aa9b-806c74f81d70@8g2000hse.googlegroups.com>
thanks to all, i was thinking to migrate to another protocol (like
xmpp) and now i start to implement the new protocol in other
programming languages like C.
Thanks again.
M.Canato
------------------------------
Date: Wed, 4 Jun 2008 00:21:14 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: XML::Parser Tree Style
Message-Id: <g24ne2.1ks.1@news.isolution.nl>
NiallBCarter schreef:
> $parser = new XML::Parser( Style => 'Tree' );
Better written as
$parser = XML::Parser->new( Style => 'Tree' );
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 4 Jun 2008 00:38:48 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: XML::Parser Tree Style
Message-Id: <g24opj.13s.1@news.isolution.nl>
A. Sinan Unur schreef:
> NiallBCarter:
>> $stuff =~ s/\s//g;
>
> $stuff holds the string produced by Dumper. The line above gets rid of
> all the spaces in that string.
Not only spaces, any whitespace.
I would expect s/\s+//g to be slightly faster.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Tue, 3 Jun 2008 17:41:54 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: XML::Parser Tree Style
Message-Id: <g24oci02q1f@news4.newsguy.com>
Dr.Ruud wrote:
> NiallBCarter schreef:
>
>> $parser = new XML::Parser( Style => 'Tree' );
>
> Better written as
>
> $parser = XML::Parser->new( Style => 'Tree' );
I think better is really in the eye of the beholder. True, there may be
certain reasons to use the direct CLASS->new style over the indirect
new CLASS style, but the indirect could be used just as well when done
correctly. After all, in Perl, TMTOWTDI :-)
--
szr
------------------------------
Date: Tue, 3 Jun 2008 20:20:55 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: XML::Parser Tree Style
Message-Id: <slrng4brfn.55g.tadmc@tadmc30.sbcglobal.net>
NiallBCarter <NiallBCarter@googlemail.com> wrote:
[ please provide an attribution when you quote someone. ]
>> while ($stuff =~/firstname.*?(\w+)'\]/g) {
>> print "$1\n";
>
> From what I can gather (I have come across these before when politely
> asked to STFW)
> it is regarding a search and replace function?
No. It is regarding the match operator.
The "m" at the beginning is optional when using slashes as the delimter,
therefore it is a short-hand way of writing:
while ($stuff =~ m/firstname.*?(\w+)'\]/g) {
then
perldoc -f m
followed by
perldoc perlop
>> > So as I originally stated, could anyone help me to try to use the Tree
>> > Style to parse out the value contained in the firstname element?
>>
>> That's easy:
[ snip code ]
This is even easier:
------------------------------------
#!/usr/bin/perl
use warnings;
use strict;
use XML::XPath;
my $xml=<<EOF;
<?xml version='1.0' encoding='UTF-8'?>
<list name="Nialls list">
<person>
<firstname>Niall</firstname>
<lastname>Carter</lastname>
<age>24</age>
</person>
<person>
<firstname>Ruth</firstname>
<lastname>Brewster</lastname>
<age>22</age>
</person>
<person>
<firstname>Cas</firstname>
<lastname>Creer</lastname>
<age>23</age>
</person>
</list>
EOF
my $xp = XML::XPath->new(xml => $xml);
my $nodeset = $xp->find('/list/person/firstname'); # find all firstnames
foreach my $node ($nodeset->get_nodelist) {
print "FOUND\n\n", XML::XPath::XMLParser::as_string($node), "\n\n";
}
------------------------------------
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 04 Jun 2008 03:53:49 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: XML::Parser Tree Style
Message-Id: <hlo1k.956$Gn.408@edtnps92>
Dr.Ruud wrote:
> A. Sinan Unur schreef:
>> NiallBCarter:
>
>>> $stuff =~ s/\s//g;
>> $stuff holds the string produced by Dumper. The line above gets rid of
>> all the spaces in that string.
>
> Not only spaces, any whitespace.
>
> I would expect s/\s+//g to be slightly faster.
And tr/ \t\f\r\n//d faster still.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
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 V11 Issue 1609
***************************************