[31081] in Perl-Users-Digest
Perl-Users Digest, Issue: 2326 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 8 03:09:40 2009
Date: Wed, 8 Apr 2009 00:09:07 -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, 8 Apr 2009 Volume: 11 Number: 2326
Today's topics:
Re: Extremely long Perl debugger output in Windows <brian.helterline@hp.com>
Re: I hate having to say the exists argument twice jidanni@jidanni.org
Re: I hate having to say the exists argument twice sln@netherlands.com
Re: I hate having to say the exists argument twice jidanni@jidanni.org
Re: I hate having to say the exists argument twice <uri@stemsystems.com>
Re: I hate having to say the exists argument twice jidanni@jidanni.org
Modification of a hash-by-reference parameter in a recu <CoDeReBeL@live.com>
Re: Modification of a hash-by-reference parameter in a <jurgenex@hotmail.com>
Re: Modification of a hash-by-reference parameter in a <uri@stemsystems.com>
new CPAN modules on Wed Apr 8 2009 (Randal Schwartz)
Re: perl values for batch script to use sln@netherlands.com
XML::LibXML UTF-8 toString() -vs- nodeValue() <hsomob1999@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 07 Apr 2009 20:57:41 -0700
From: Brian Helterline <brian.helterline@hp.com>
Subject: Re: Extremely long Perl debugger output in Windows
Message-Id: <grh7bm$k0e$1@usenet01.boi.hp.com>
Dr.Ruud wrote:
> perl my_prog.plx 2>&1 > output.txt
This doesn't put stderr and stdout in output.txt. stderr still goes to
the console. The order needs to be reversed.
perl my_prog.plx >output.txt 2>&1
--
-brian
------------------------------
Date: Wed, 08 Apr 2009 08:29:37 +0800
From: jidanni@jidanni.org
Subject: Re: I hate having to say the exists argument twice
Message-Id: <87hc10m1hq.fsf@jidanni.org>
I'm sorry I don't understand smallpond and Dr. Rudd's answers.
Is there a solution that won't make a warning when -w is in use and the
item doesn't exist or is defined I suppose?
------------------------------
Date: Tue, 07 Apr 2009 18:20:09 -0700
From: sln@netherlands.com
Subject: Re: I hate having to say the exists argument twice
Message-Id: <qrunt4tnve2uh8runef86u3jd6hbup9rji@4ax.com>
On Wed, 08 Apr 2009 05:42:23 +0800, jidanni@jidanni.org wrote:
>I hate having to say things twice,
> print $h{$key}{$_} if exists $h{$key}{$_};
>But I can't do
> print if exists $_ for $h{$key}{$_};
>Bzzt: exists argument is not a HASH or ARRAY element.
I didn't see the Bzzt exists conditional.
What happens she $h exists?
-sln
------------------------------
Date: Wed, 08 Apr 2009 10:04:47 +0800
From: jidanni@jidanni.org
Subject: Re: I hate having to say the exists argument twice
Message-Id: <871vs3nbnk.fsf@jidanni.org>
> I didn't see the Bzzt exists conditional.
OK, I don't want to repeat $m[$_] (or something much longer actually),
$ perl -wle '@m=(1,2); for(0..3){print $m[$_] if exists $m[$_]}'
1
2
Nor do I want to use a temporary variable. But I can't just do
$ perl -wle '@m=(1,2); for(0..3){for($m[$_]){print $_ if exists $_}}'
exists argument is not a HASH or ARRAY element at -e line 1.
------------------------------
Date: Tue, 07 Apr 2009 22:16:24 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: I hate having to say the exists argument twice
Message-Id: <x7r603ga9z.fsf@mail.sysarch.com>
>>>>> "j" == jidanni <jidanni@jidanni.org> writes:
j> Nor do I want to use a temporary variable. But I can't just do
j> $ perl -wle '@m=(1,2); for(0..3){for($m[$_]){print $_ if exists $_}}'
j> exists argument is not a HASH or ARRAY element at -e line 1.
you at least need to repeat the hash if you want that style of code. if
the hash is deeper than one level you can take a ref to the desired
level and simplify that way (and speed it up).
but i will ask if this is an xy problem. exists is a useful but in
general rarely needed function. if you are stuck on calling it maybe you
have a design that can be improved so you don't need exists. checking
with exists and then accessing the element is also not common IMO. maybe
you only need defined or boolean? or you want to initialize an element
if it wasn't already (//= should do that fine).
so what is the bigger picture that you are addressing and don't mention
exists in your description. exists is a solution to a small specific
problem and not a problem description.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 08 Apr 2009 12:36:47 +0800
From: jidanni@jidanni.org
Subject: Re: I hate having to say the exists argument twice
Message-Id: <87myarlq1s.fsf@jidanni.org>
I see in man perldelta that // is not a typo. OK, I'll try that.
------------------------------
Date: Tue, 7 Apr 2009 19:46:04 -0700 (PDT)
From: CoDeReBeL <CoDeReBeL@live.com>
Subject: Modification of a hash-by-reference parameter in a recursive sub
Message-Id: <4783dcdd-9a2f-4983-b597-471f664473d2@w40g2000yqd.googlegroups.com>
OK, it's like this... I am far from an expert in Perl but I really
think this should work...
use strict;
use warnings;
use diagnostics;
use HTML::TreeBuilder;
use HTML::Entities;
use HTML::Element;
sub traverse {
foreach (@_) {
if (ref $_) {
if ($_->tag() ne "head"
&& $_->tag() ne "script"
&& $_->tag() ne "img"
&& $_->tag() ne "object"
&& $_->tag() ne "applet") {
my @contents = $_->content_list() ;
foreach my $next (@contents) {
traverse ($next) ;
}
}
}
else {
$_ =~ s/\s&\s/ & /g ;
$_ =~ s/</</g ;
$_ =~ s/>/>/g ;
$_ =~ s/'em\s/’em /g ;
$_ =~ s/'tis\s/’tis /g ;
$_ =~ s/'twas\s/’twas /g ;
$_ =~ s/'Twas\s/’Twas /g ;
$_ =~ s/'Tis\s/’Tis / ;
$_ =~ s/'\s/’ /g ;
$_ =~ s/^'/‘/g ;
$_ =~ s/(\s)'/$1‘/g ;
$_ =~ s/"'/“lsquo;/g ;
$_ =~ s/'"/’”/g ;
$_ =~ s/\s"/ “/g ;
$_ =~ s/^'/‘/g ;
$_ =~ s/^"/“/g ;
$_ =~ s/"\s/” /g ;
$_ =~ s/'$/’/g ;
$_ =~ s/"$/”/g ;
$_ =~ s/(,|\.)'/$1’/g ;
$_ =~ s/(,|\.)"/$1”/g ;
$_ =~ s/(\S)'(\S)/$1’$2/g ;
}
}
return $_ ;
}
foreach my $file_name (@ARGV) {
my $tree = HTML::TreeBuilder->new ;
$tree->parse_file($file_name);
$tree = traverse ($tree);
$tree = $tree->delete ;
}
sub traverse ;
I've spent about 36 hours now chugging coffee and Mountain Dew, trying
every possible thing I could think of or find reference to in any Perl
documentation anywhere, and for the life of me I can't get the altered
text strings to keep their value. I've had all kind of print
statements inserted everywhere in the traverse subroutine and I have
run the program about 100 times today. Every time that I said
print $_ ; (Or $_[0] or any of the other 20 things that I've called it
today) I've seen the string altered just like it should be by the
regular expressions. The HTML::Tree package is just a little weird
with the argument being passed to the recursive routine ... it might
be a reference to a hash and it might be a string. But the ref check
is working and execution proceeds accordingly.
I've had $tree be local to the main function at the bottom, I've had
it be global, etc. I've tried everything I could think of. I've run it
in debug mode and checked and verified that the check_persistence()
routine (which I left out here for brevity but is identical to the
traverse sub except that it only prints the string and doesn't modify
it) was looking at the same address ... oh, sorry, sorry ... the C++
in me came out a little bit there ... the REFERENCE was represented by
the same exact 7 or 8 digit hexadecimal number that looks a lot like a
pointer ...
I've tried just returning the damn $_ reference at the end of the
routine. It shows all the elements of whatever file I test it with
just like it was... but the text components snap back to their
original values as soon as the traverse routine exits no matter what I
try.
At this point I'm pretty much fed up with trying, since the whole
exercise is just to give me a little script to save myself the trouble
of typing those damn entities all the time and curling the quotes,
etc. I can easily open an output file in the main routine just before
traverse, pass in a *<glob> with the $tree reference and write the
string to the file at the end of traverse, where the text strings are
what I want them to be and just print the whole damn thing inside
traverse to a file.
So this is not really a problem per se as much as a puzzle, since
there's MORE THAN ONE WAY TO DO IT! :) But my curiosity remains
piqued. Why the hell won't this work? Is it just plain impossible or
what? From what I've read on the topic it seems like it just might be
impossible. I've searched high and low and have yet to find an example
anywhere that does just quite the same thing.
I also read somewhere that if you assign $_ or @_ to any variable or
ref inside the sub that there is no way in hell that they will stay
modified when the sub exits, so I've done my best not to call them in
any way, but I can tell you right now for sure that Perl does not like
it when you call the $s->tag() method on a string, so I have to do the
ref check. Pretty much have to call the tag() method and the
content_list() method too.
Anyway, I've had it. I give up. You guys are the experts. Clue me in,
willya?
Thanks.
------------------------------
Date: Tue, 07 Apr 2009 22:11:13 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Modification of a hash-by-reference parameter in a recursive sub
Message-Id: <m6cot416a8rcm7sho2qgj4p97d17sqccmn@4ax.com>
Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "C" == CoDeReBeL <CoDeReBeL@live.com> writes:
>
> C> sub traverse {
> C> foreach (@_) {
> C> if (ref $_) {
> C> if ($_->tag() ne "head"
> C> && $_->tag() ne "script"
> C> && $_->tag() ne "img"
> C> && $_->tag() ne "object"
> C> && $_->tag() ne "applet") {
It may be more readable to put all those values as keys into a hash
%mytags and then simply check for
unless (exists ($mytags{$_->tag()} )) {
....
jue
------------------------------
Date: Wed, 08 Apr 2009 00:38:11 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Modification of a hash-by-reference parameter in a recursive sub
Message-Id: <x7d4bng3po.fsf@mail.sysarch.com>
>>>>> "C" == CoDeReBeL <CoDeReBeL@live.com> writes:
C> sub traverse {
C> foreach (@_) {
C> if (ref $_) {
C> if ($_->tag() ne "head"
C> && $_->tag() ne "script"
C> && $_->tag() ne "img"
C> && $_->tag() ne "object"
C> && $_->tag() ne "applet") {
just for speed ups you should get $_->tag() into a temp var so you don't
call the method over and over. another way would be to check the value
against a hash of those tag names. a series of compares to the same
value in perl is usually a bad idea.
C> my @contents = $_->content_list() ;
you make a copy of the list so any changes to it will not seen be in the
original tree.
C> foreach my $next (@contents) {
try this:
foreach my $next ($_->content_list()) {
that will alias $next to each element of the tree so changes to $next
will be seen in the actual tree.
C> traverse ($next) ;
C> }
C> }
C> }
C> else {
C> $_ =~ s/\s&\s/ & /g ;
$_ is the default for s/// ops so you can lose all the $_ =~ redundant noise.
C> $_ =~ s/</</g ;
C> $_ =~ s/>/>/g ;
i know there is a better way to do all these s/// calls but i am not in
the mood to work on it.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 8 Apr 2009 04:42:27 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Apr 8 2009
Message-Id: <KHrMEs.3GJ@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.
Alien-WiX-0.305207
http://search.cpan.org/~csjewell/Alien-WiX-0.305207/
Installing and finding Windows Installer XML (WiX)
----
App-Munchies-0.1.646
http://search.cpan.org/~pjfl/App-Munchies-0.1.646/
Catalyst example application using food recipes as a data set
----
CGI-ValidOp-0.52
http://search.cpan.org/~hdp/CGI-ValidOp-0.52/
Simple validation of CGI parameters and runmodes.
----
CPANPLUS-Dist-Build-0.20
http://search.cpan.org/~bingos/CPANPLUS-Dist-Build-0.20/
CPANPLUS plugin to install packages that use Build.PL
----
CPANPLUS-YACSmoke-0.33_03
http://search.cpan.org/~bingos/CPANPLUS-YACSmoke-0.33_03/
Yet Another CPANPLUS Smoke Tester
----
Catalyst-Controller-SOAP-1.14
http://search.cpan.org/~druoso/Catalyst-Controller-SOAP-1.14/
Catalyst SOAP Controller
----
Catalyst-Plugin-Authentication-Credential-HTTP-Proxy-0.02
http://search.cpan.org/~mramberg/Catalyst-Plugin-Authentication-Credential-HTTP-Proxy-0.02/
----
CatalystX-Usul-0.1.437
http://search.cpan.org/~pjfl/CatalystX-Usul-0.1.437/
A base class for Catalyst MVC components
----
Class-DBI-Lite-0.023
http://search.cpan.org/~johnd/Class-DBI-Lite-0.023/
Lightweight ORM for Perl
----
Class-Implant-0.01
http://search.cpan.org/~shelling/Class-Implant-0.01/
Manipulating mixin and inheritance out of packages
----
Class-MOP-0.81
http://search.cpan.org/~drolsky/Class-MOP-0.81/
A Meta Object Protocol for Perl 5
----
Config-IniFiles-2.48
http://search.cpan.org/~shlomif/Config-IniFiles-2.48/
A module for reading .ini-style configuration files.
----
DBD-SQLite-1.20
http://search.cpan.org/~adamk/DBD-SQLite-1.20/
Self Contained RDBMS in a DBI Driver
----
DBD-SQLite-1.21
http://search.cpan.org/~adamk/DBD-SQLite-1.21/
Self Contained RDBMS in a DBI Driver
----
DBD-SQLite-1.22_01
http://search.cpan.org/~adamk/DBD-SQLite-1.22_01/
Self Contained RDBMS in a DBI Driver
----
DBIx-Class-InflateColumn-FS-0.01002
http://search.cpan.org/~mmims/DBIx-Class-InflateColumn-FS-0.01002/
store BLOBs in the file system
----
DBIx-Class-QueryLog-1.1.5
http://search.cpan.org/~gphat/DBIx-Class-QueryLog-1.1.5/
Log queries for later analysis.
----
DBIx-Report-Excel-0.1
http://search.cpan.org/~dmytro/DBIx-Report-Excel-0.1/
creating Excel reports from SQL statements
----
Env-Sanctify-1.02
http://search.cpan.org/~bingos/Env-Sanctify-1.02/
Lexically scoped sanctification of %ENV
----
Fey-ORM-0.23
http://search.cpan.org/~drolsky/Fey-ORM-0.23/
A Fey-based ORM
----
File-History-0.00002
http://search.cpan.org/~nishikawa/File-History-0.00002/
It is a simple history file maker.
----
GNTP-Growl-0.02
http://search.cpan.org/~mattn/GNTP-Growl-0.02/
Perl implementation of GNTP Protocol (Client Part)
----
GNTP-Growl-0.03
http://search.cpan.org/~mattn/GNTP-Growl-0.03/
Perl implementation of GNTP Protocol (Client Part)
----
Games-Sudoku-SudokuTk-0.14
http://search.cpan.org/~cguine/Games-Sudoku-SudokuTk-0.14/
Sudoku Game
----
Geo-Distance-XS-0.01
http://search.cpan.org/~gray/Geo-Distance-XS-0.01/
speed up Geo::Distance
----
Gtk2-ImageView-0.05
http://search.cpan.org/~ratcliffe/Gtk2-ImageView-0.05/
Perl bindings to the GtkImageView image viewer widget
----
HTML-Perlinfo-1.55
http://search.cpan.org/~accardo/HTML-Perlinfo-1.55/
Display a lot of Perl information in HTML format
----
HTTP-Engine-Middleware-0.11_01
http://search.cpan.org/~yappo/HTTP-Engine-Middleware-0.11_01/
middlewares distribution
----
IO-Async-Loop-linux-0.02
http://search.cpan.org/~pevans/IO-Async-Loop-linux-0.02/
pick the best Loop implementation on Linux
----
Lingua-EN-Titlecase-0.14
http://search.cpan.org/~ashley/Lingua-EN-Titlecase-0.14/
Titlecase English words by traditional editorial rules.
----
Log-Facile-1.02
http://search.cpan.org/~sera/Log-Facile-1.02/
Perl extension for facile logging
----
Log-Facile-1.03
http://search.cpan.org/~sera/Log-Facile-1.03/
Perl extension for facile logging
----
Log-Log4perl-Appender-DBIx-Class-0.01
http://search.cpan.org/~gphat/Log-Log4perl-Appender-DBIx-Class-0.01/
appender for DBIx::Class
----
MOSES-MOBY-0.88
http://search.cpan.org/~ekawas/MOSES-MOBY-0.88/
Perl extension for the automatic generation of BioMOBY web services
----
Math-Random-ISAAC-XS-1.0.1
http://search.cpan.org/~frequency/Math-Random-ISAAC-XS-1.0.1/
C implementation of the ISAAC PRNG Algorithm
----
MediaWiki-Bot-Plugin-ImageTester-0.2.5
http://search.cpan.org/~dcollins/MediaWiki-Bot-Plugin-ImageTester-0.2.5/
a plugin for MediaWiki::Bot which contains image copyright checking and analysis for the english wikipedia
----
Module-Util-1.07
http://search.cpan.org/~mattlaw/Module-Util-1.07/
Module name tools and transformations
----
Moose-0.74
http://search.cpan.org/~drolsky/Moose-0.74/
A postmodern object system for Perl 5
----
MooseX-ClassAttribute-0.08
http://search.cpan.org/~drolsky/MooseX-ClassAttribute-0.08/
Declare class attributes Moose-style
----
MooseX-Declare-0.10
http://search.cpan.org/~flora/MooseX-Declare-0.10/
Declarative syntax for Moose
----
MooseX-Method-Signatures-0.14
http://search.cpan.org/~flora/MooseX-Method-Signatures-0.14/
Method declarations with type constraints and no source filter
----
MooseX-Singleton-0.15
http://search.cpan.org/~drolsky/MooseX-Singleton-0.15/
turn your Moose class into a singleton
----
MooseX-StrictConstructor-0.08
http://search.cpan.org/~drolsky/MooseX-StrictConstructor-0.08/
Make your object constructors blow up on unknown attributes
----
Moxy-0.54
http://search.cpan.org/~tokuhirom/Moxy-0.54/
Mobile web development proxy
----
NEXT-0.62
http://search.cpan.org/~flora/NEXT-0.62/
Provide a pseudo-class NEXT (et al) that allows method redispatch
----
Net-ParSCP-0.08
http://search.cpan.org/~casiano/Net-ParSCP-0.08/
Parallel secure copy
----
Net-SFTP-Foreign-1.51
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.51/
SSH File Transfer Protocol client
----
News-Pictures-0.13
http://search.cpan.org/~cguine/News-Pictures-0.13/
The great new News::Pictures!
----
Numeric-LL_Array-0.01
http://search.cpan.org/~ilyaz/Numeric-LL_Array-0.01/
Perl extension for blah blah blah
----
Olson-Abbreviations-0.01
http://search.cpan.org/~ecarroll/Olson-Abbreviations-0.01/
globally unique timezones abbreviation handling
----
Olson-Abbreviations-0.02
http://search.cpan.org/~ecarroll/Olson-Abbreviations-0.02/
globally unique timezones abbreviation handling
----
POE-Component-Server-DNS-0.18
http://search.cpan.org/~bingos/POE-Component-Server-DNS-0.18/
A non-blocking, concurrent DNS server POE component
----
POE-Component-Server-DNS-0.20
http://search.cpan.org/~bingos/POE-Component-Server-DNS-0.20/
A non-blocking, concurrent DNS server POE component
----
POE-Component-SmokeBox-Recent-1.14
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Recent-1.14/
A POE component to retrieve recent CPAN uploads.
----
POE-Component-SmokeBox-Recent-1.16
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Recent-1.16/
A POE component to retrieve recent CPAN uploads.
----
Perlanet-0.09
http://search.cpan.org/~davecross/Perlanet-0.09/
A program for creating web pages that aggregate web feeds (both RSS and Atom).
----
Process-0.23
http://search.cpan.org/~adamk/Process-0.23/
Objects that represent generic computational processes
----
Provision-Unix-0.51
http://search.cpan.org/~msimerson/Provision-Unix-0.51/
provision accounts on unix systems
----
RT-Extension-MergeUsers-0.03_02
http://search.cpan.org/~falcone/RT-Extension-MergeUsers-0.03_02/
----
String-Prettify-1.04
http://search.cpan.org/~leocharre/String-Prettify-1.04/
subs to cleanup a filename and or garble for human eyes
----
Template-Provider-HTTP-0.02
http://search.cpan.org/~evdb/Template-Provider-HTTP-0.02/
fetch templates from a webserver
----
Template-Toolkit-2.20_1
http://search.cpan.org/~abw/Template-Toolkit-2.20_1/
Template Processing System
----
Test-Database-0.99_03
http://search.cpan.org/~book/Test-Database-0.99_03/
Database handles ready for testing
----
Test-MockTime-0.10
http://search.cpan.org/~ddick/Test-MockTime-0.10/
Replaces actual time with simulated time
----
Test-MockTime-0.11
http://search.cpan.org/~ddick/Test-MockTime-0.11/
Replaces actual time with simulated time
----
Test-POE-Client-TCP-1.02
http://search.cpan.org/~bingos/Test-POE-Client-TCP-1.02/
A POE Component providing TCP client services for test cases
----
Test-POE-Server-TCP-1.02
http://search.cpan.org/~bingos/Test-POE-Server-TCP-1.02/
A POE Component providing TCP server services for test cases
----
Test-Reporter-1.53_01
http://search.cpan.org/~dagolden/Test-Reporter-1.53_01/
sends test results to cpan-testers@perl.org
----
Text-Diff-HTML-0.06
http://search.cpan.org/~dwheeler/Text-Diff-HTML-0.06/
XHTML format for Text::Diff::Unified
----
Text-Template-Simple-0.62_08
http://search.cpan.org/~burak/Text-Template-Simple-0.62_08/
Simple text template engine
----
Tk-MK-0.17
http://search.cpan.org/~mikra/Tk-MK-0.17/
----
WebService-TVRage-0.01
http://search.cpan.org/~kbrandt/WebService-TVRage-0.01/
Perl extension for using TVRage's XML Service
----
WebService-TVRage-0.011
http://search.cpan.org/~kbrandt/WebService-TVRage-0.011/
Perl extension for using TVRage's XML Service
----
Win32-Process-Kill-v0.2
http://search.cpan.org/~rootkwok/Win32-Process-Kill-v0.2/
Perl extension for Terminating Process in Win32 (R3)
----
Win32-SysPrivilege-v1.3
http://search.cpan.org/~rootkwok/Win32-SysPrivilege-v1.3/
Perl extension for Running external programs with SYSTEM Privilege
----
X11-Resolution-0.0.0
http://search.cpan.org/~vvelox/X11-Resolution-0.0.0/
Get information on the current resolution for X.
----
XML-CompactTree-0.02
http://search.cpan.org/~pajas/XML-CompactTree-0.02/
builder of compact tree structures from XML documents
----
XML-CompactTree-0.03
http://search.cpan.org/~pajas/XML-CompactTree-0.03/
builder of compact tree structures from XML documents
----
XML-CompactTree-XS-0.02
http://search.cpan.org/~pajas/XML-CompactTree-XS-0.02/
a fast builder of compact tree structures from XML documents
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Tue, 07 Apr 2009 15:50:52 -0700
From: sln@netherlands.com
Subject: Re: perl values for batch script to use
Message-Id: <73mnt4ta3qc0mj41orfe7c135uf8l0apfb@4ax.com>
On Tue, 7 Apr 2009 14:09:10 -0700 (PDT), Ron Bergin <rkb@i.frys.com> wrote:
>On Apr 7, 10:58 am, Slickuser <slick.us...@gmail.com> wrote:
>> I have a filename (file.txt)
>>
>> file.txt contains:
>> Sample4.1.2009_US
>> Sample4.2.2009_ASIA
>>
>> I can parse this file in Perl fine. Now I want this value to be
>> available to use in a batch script.
>> I try using "set" but the info get clear once I exit perl script.
>>
>> perl_script.pl
>> open file.txt
>> parse info
>> use system to execute command ("set xxyz_US=Sample4.1.2009_US")
>> ("set xxyz_ASIA=Sample4.2.2009_ASIA")
>>
>Use setenv instead of the set command.
>
>http://barnyard.syr.edu/~vefatica/#SETENV
>
>Or, you could use the standard set command and then use Win32::API to
>call 2 C functions (RegFlushKey and BroadcastSystemMessage) to force
>that setting to be retained after the perl script ends, which is
>basically what setenv does.
>
>Win32::API
>http://search.cpan.org/~cosimo/Win32-API-0.58/API.pm
>
>RegFlushKey in Advapi32.lib
>http://msdn.microsoft.com/en-us/library/ms724867(VS.85).aspx
>
>BroadcastSystemMessage in user32.dll
>http://msdn.microsoft.com/en-us/library/ms644932(VS.85).aspx
I don't understand posters taken verbatim. The dumb shmuks here
think a perl script can realistically shine shoes if asked. Literally.
-sln
------------------------------
Date: Tue, 7 Apr 2009 16:07:05 -0700 (PDT)
From: MaggotChild <hsomob1999@yahoo.com>
Subject: XML::LibXML UTF-8 toString() -vs- nodeValue()
Message-Id: <9caad06e-6903-464a-99b0-d6327f7808aa@r34g2000vba.googlegroups.com>
I need to send data across the network and I'm confused by the
UTF-8ness of the values returned by toString() and nodeValue().
I know that toString() will give me what I need -octets regardless of
the underlying encoding- yet I can't understand how the character is
represented by the output of each method.
For example (note that the mangled char is the starting single char
quote) :
use strict;
use warnings;
use XML::LibXML;
use Encode;
$\=3D"\n";
my $parser =3D XML::LibXML->new;
my $dom =3D $parser->parse_file(shift);
my $node =3D ($dom->getElementsByTagName('title'))[0];
print $dom->actualEncoding;
print 'is utf-8: ' . Encode::is_utf8($node->firstChild->nodeValue,1);
print "node value";
print $node->firstChild->nodeValue;
print "to string";
my $txt =3D $node->firstChild->toString(0,1);
print $txt;
print 'is utf-8: ' . Encode::is_utf8($txt,1);
Outputs:
UTF-8
is utf-8: 1
txt content
Wide character in print at ./utf8-lib-xml.pl line 18.
=E2ER=E2
to string
=E2ER=E2
is utf-8:
Why is toString no longer UTF-8?
And, since the wide char has been broken down into octets, how does
one know that it's composed of 2 octets when its interpreted on the
receiving end (or even in my terminal)?
On the surface it seems as if I'd be breaking the UTF-8.
Is the toSting() method the preferred way to send the value of a
TextNode across the network?
------------------------------
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 2326
***************************************