[31091] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2336 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 14 03:09:44 2009

Date: Tue, 14 Apr 2009 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           Tue, 14 Apr 2009     Volume: 11 Number: 2336

Today's topics:
    Re: (newbie) need help understanding a few lines of cod <jbenjam@gmail.com>
    Re: (newbie) need help understanding a few lines of cod <tadmc@seesig.invalid>
    Re: (newbie) need help understanding a few lines of cod <noreply@gunnar.cc>
        =?windows-1256?B?x9bb2CDa4ewgx+HV5tHlIMfh0Owgz87hINrh7Q <smsmegypt20002000@yahoo.com>
    Re: foreach performance <RedGrittyBrick@SpamWeary.foo>
        new CPAN modules on Tue Apr 14 2009 (Randal Schwartz)
    Re: Pipe Between Programs <ben@morrow.me.uk>
        UTF-32 and Regular Expressions on Binary Data  (was Re: sln@netherlands.com
    Re: XML::LibXML UTF-8 toString() -vs- nodeValue() <liarafan@xs4all.nl>
    Re: XML::LibXML UTF-8 toString() -vs- nodeValue() <tadmc@seesig.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 13 Apr 2009 00:41:51 -0700 (PDT)
From: jbenjam <jbenjam@gmail.com>
Subject: Re: (newbie) need help understanding a few lines of code
Message-Id: <36a8c0ff-e118-4207-b181-6c67cbff516e@y7g2000yqa.googlegroups.com>


Thank you Gunnar for a friendly and helpful response!

Perldoc is my new friend.  :-)

-Ben

On Apr 12, 6:02=A0pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> Ben wrote:
> > I'm =A0still learning some of the basic element of Perl. =A0In the
> > following segment,
>
> > =A0 #!/usr/bin/perl -w
> > =A0 use strict;
> > =A0 use OpenGL qw/ :all /;
> > =A0 use Math::Trig;
> > =A0 eval 'use Time::HiRes qw( gettimeofday )';
>
> Loads the Time::HiRes module at run time; eval() prevents that the
> program dies for the case Perl fails to find Time::HiRes.
>
> > =A0 my $hasHires =3D !$@;
>
> If Time::HiRes was found, the $@ variable contains a null string, i.e. a
> false value. !$@ means that a true value is assigned to $hasHires.
>
> =A0 =A0 =A0perldoc -f eval
>
> > =A0 $|++;
>
> Sets $| to a true value (adds 1). See "perldoc perlvar" about the
> meaning of $|.
>
> > Later on in the script:
> > =A0 =A0my $now =3D $hasHires ? gettimeofday() : time();
>
> > What's the function of =A0"?" in this context?
>
> See "perldoc perlop", the "Conditional Operator" section.
>
> Personally I find the coding style somewhat obfuscated. I would probably
> have said something like:
>
> =A0 =A0 =A0my $noHires =3D $@;
>
> and later:
>
> =A0 =A0 =A0my $now =3D $noHires ? time() : gettimeofday();
>
> But that's probably just a matter of taste. :)
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl



------------------------------

Date: Mon, 13 Apr 2009 06:23:33 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: (newbie) need help understanding a few lines of code
Message-Id: <slrngu685l.ik4.tadmc@tadmc30.sbcglobal.net>

jbenjam <jbenjam@gmail.com> wrote:


> Perldoc is my new friend.  :-)


Since you did not put the subject of your article in the Subject of
your article, included "newbie" in your Subject, top-posted, 
quoted a .sig and did not know about perldoc, I assume that you have 
not yet seen the Posting Guidelines that are posted here frequently.

It contains many pointers that will help you get solutions to
Perl programming problems.


     http://www.rehabitation.com/clpmisc.shtml


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Mon, 13 Apr 2009 14:56:35 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: (newbie) need help understanding a few lines of code
Message-Id: <74gr46F12rl6nU1@mid.individual.net>

Tad J McClellan wrote:
> jbenjam <jbenjam@gmail.com> wrote:
>> 
>> Perldoc is my new friend.  :-)
> 
> Since you did not put the subject of your article in the Subject of
> your article,

Your criticizing of the subject is somewhat misplaced this time IMO.

>      http://www.rehabitation.com/clpmisc.shtml

But the posting guidelines are always a good idea to study. :)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Mon, 13 Apr 2009 09:56:40 -0700 (PDT)
From: alagmy <smsmegypt20002000@yahoo.com>
Subject: =?windows-1256?B?x9bb2CDa4ewgx+HV5tHlIMfh0Owgz87hINrh7Q==?= =?windows-1256?B?5ccgx9/L0SDj5Dgg4+Ht5uQg1M7VIM3K7CDH4cPk?=
Message-Id: <95d0f251-4b0c-4d58-af7d-2170bfe3ba82@o34g2000vbi.googlegroups.com>

x9bb2CDa4ewgx+HV5tHlIMfh0Owgz87hINrh7eXHIMffy9Eg4+Q4IOPh7ebkINTO1SDNyuwgx+HD
5AoKx+HV5tHlIN3sIMfa4ewgx+HV3c3lIObl7CDayMfR5SDa5CDRx8zhINTH7eEg0+3dCgrH4dHH
yNggaHR0cDovL2hvc3NhbWFsYWdteS5yYWI3bmV0Lm9yZy92Yi8KCg==


------------------------------

Date: Mon, 13 Apr 2009 11:42:54 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: foreach performance
Message-Id: <DbydnRkjYJyuin7UnZ2dnUVZ8qudnZ2d@bt.com>

shurikgefter@gmail.com wrote:
> 
> What is a better for performance:
> 

 From http://www.cs.cmu.edu/~jch/java/optimization.html

Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
- M.A. Jackson

"More computing sins are committed in the name of efficiency (without 
necessarily achieving it) than for any other single reason - including 
blind stupidity."
- W.A. Wulf

"We should forget about small efficiencies, say about 97% of the time: 
premature optimization is the root of all evil."
- Donald Knuth

"The best is the enemy of the good."
- Voltaire



or, perhaps more persuasively,

http://www.cs.cmu.edu/~jch/java/rules.html


Note, none of the above are Java specific and apply just as well to 
Perl. According to Google, Java programmers must be most in need of such 
advice :-)

-- 
RGB


------------------------------

Date: Tue, 14 Apr 2009 04:42:26 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue Apr 14 2009
Message-Id: <KI2qEq.EoJ@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Acme-CPANAuthors-Russian-0.10
http://search.cpan.org/~sharifuln/Acme-CPANAuthors-Russian-0.10/
We are Russian CPAN authors 
----
App-Rad-1.01
http://search.cpan.org/~garu/App-Rad-1.01/
Rapid (and easy!) creation of command line applications 
----
Audio-Scan-0.05
http://search.cpan.org/~agrundma/Audio-Scan-0.05/
Fast C parser for MP3, Ogg Vorbis, FLAC, ASF 
----
CORBA-MICO-0.6.7
http://search.cpan.org/~logvinon/CORBA-MICO-0.6.7/
Perl module implementing CORBA 2.0 via MICO 
----
CPAN-1.93_52
http://search.cpan.org/~andk/CPAN-1.93_52/
query, download and build perl modules from CPAN sites 
----
Catalyst-Action-Role-ACL-0.01
http://search.cpan.org/~converter/Catalyst-Action-Role-ACL-0.01/
User role-based authorization action class. 
----
Catalyst-Model-SOAP-0.0.8
http://search.cpan.org/~druoso/Catalyst-Model-SOAP-0.0.8/
Map a WSDL to a catalyst model class. 
----
Catalyst-Runtime-5.8000_07
http://search.cpan.org/~mramberg/Catalyst-Runtime-5.8000_07/
The Catalyst Framework Runtime 
----
Convert-Color-0.04
http://search.cpan.org/~pevans/Convert-Color-0.04/
color space conversions and named lookups 
----
Convert-Color-XTerm-0.03
http://search.cpan.org/~pevans/Convert-Color-XTerm-0.03/
indexed colors used by xterm 
----
DBD-Pg-2.13.0
http://search.cpan.org/~turnstep/DBD-Pg-2.13.0/
PostgreSQL database driver for the DBI module 
----
DBD-mysql-4.011
http://search.cpan.org/~capttofu/DBD-mysql-4.011/
MySQL driver for the Perl5 Database Interface (DBI) 
----
DateTime-TimeZone-0.89
http://search.cpan.org/~drolsky/DateTime-TimeZone-0.89/
Time zone object base class and factory 
----
Elive-0.02
http://search.cpan.org/~warringd/Elive-0.02/
Elluminate Live (c) client library 
----
File-Find-Rule-Perl-1.06
http://search.cpan.org/~adamk/File-Find-Rule-Perl-1.06/
Common rules for searching for Perl things 
----
Finance-Quote-1.16
http://search.cpan.org/~ecocode/Finance-Quote-1.16/
Get stock and mutual fund quotes from various exchanges 
----
Finance-QuoteDB-0.02
http://search.cpan.org/~ecocode/Finance-QuoteDB-0.02/
User database tools based on Finance::Quote 
----
Finance-QuoteDB-0.03
http://search.cpan.org/~ecocode/Finance-QuoteDB-0.03/
User database tools based on Finance::Quote 
----
Geography-Countries-2009041301
http://search.cpan.org/~abigail/Geography-Countries-2009041301/
2-letter, 3-letter, and numerical codes for countries. 
----
Graphics-Primitive-Driver-Cairo-0.35
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.35/
Cairo backend for Graphics::Primitive 
----
HTML-Toc-1.11
http://search.cpan.org/~fvulto/HTML-Toc-1.11/
Generate, insert and update HTML Table of Contents. 
----
HTTP-Engine-0.1.7
http://search.cpan.org/~yappo/HTTP-Engine-0.1.7/
Web Server Gateway Interface and HTTP Server Engine Drivers (Yet Another Catalyst::Engine) 
----
IO-Moose-0.1003
http://search.cpan.org/~dexter/IO-Moose-0.1003/
Reimplementation of IO::* with improvements 
----
Math-GSL-0.19_01
http://search.cpan.org/~leto/Math-GSL-0.19_01/
Perl interface to the GNU Scientific Library (GSL) 
----
MediaWiki-Bot-2.2.2
http://search.cpan.org/~dcollins/MediaWiki-Bot-2.2.2/
a Wikipedia bot framework written in Perl 
----
Module-Changes-ADAMK-0.06
http://search.cpan.org/~adamk/Module-Changes-ADAMK-0.06/
Parse a traditional Changes file (as ADAMK interpretes it) 
----
Module-Changes-ADAMK-0.07
http://search.cpan.org/~adamk/Module-Changes-ADAMK-0.07/
Parse a traditional Changes file (as ADAMK interpretes it) 
----
Module-Changes-ADAMK-0.08
http://search.cpan.org/~adamk/Module-Changes-ADAMK-0.08/
Parse a traditional Changes file (as ADAMK interpretes it) 
----
Module-Changes-ADAMK-0.09
http://search.cpan.org/~adamk/Module-Changes-ADAMK-0.09/
Parse a traditional Changes file (as ADAMK interpretes it) 
----
MooseX-MultiMethods-0.01
http://search.cpan.org/~flora/MooseX-MultiMethods-0.01/
Multi Method Dispatch based on Moose type constraints 
----
PDF-FDF-Simple-0.18
http://search.cpan.org/~schwigon/PDF-FDF-Simple-0.18/
Read and write (Acrobat) FDF files. 
----
POE-API-Peek-1.33
http://search.cpan.org/~sungo/POE-API-Peek-1.33/
Peek into the internals of a running POE environment 
----
POE-Component-Client-Icecast-0.1
http://search.cpan.org/~sharifuln/POE-Component-Client-Icecast-0.1/
non-blocking client to Icecast server for getting tags 
----
POE-Component-WakeOnLAN-1.02
http://search.cpan.org/~bingos/POE-Component-WakeOnLAN-1.02/
A POE Component to send packets to power on computers. 
----
Package-Subroutine-0.15
http://search.cpan.org/~sknpp/Package-Subroutine-0.15/
minimalistic import/export and other util methods 
----
Pid-File-Flock-0.01
http://search.cpan.org/~lonerr/Pid-File-Flock-0.01/
PID file operations 
----
Pod-Simple-Wiki-Googlecode-0.03
http://search.cpan.org/~fayland/Pod-Simple-Wiki-Googlecode-0.03/
A class for creating Pod to Google Code Wiki filters. 
----
Process-0.25
http://search.cpan.org/~adamk/Process-0.25/
Objects that represent generic computational processes 
----
Queue-Q4M-0.00019
http://search.cpan.org/~dmaki/Queue-Q4M-0.00019/
Simple Interface To q4m 
----
SQL-Beautify-0.03
http://search.cpan.org/~jkramer/SQL-Beautify-0.03/
----
Simo-0.1101
http://search.cpan.org/~kimoto/Simo-0.1101/
Very simple framework for Object Oriented Perl. 
----
Simo-0.1102
http://search.cpan.org/~kimoto/Simo-0.1102/
Very simple framework for Object Oriented Perl. 
----
TM-1.45
http://search.cpan.org/~drrho/TM-1.45/
Topic Maps, Base Class 
----
Test-MockTime-DateCalc-1
http://search.cpan.org/~kryde/Test-MockTime-DateCalc-1/
fake time for Date::Calc functions 
----
Test-SharedFork-0.05
http://search.cpan.org/~tokuhirom/Test-SharedFork-0.05/
fork test 
----
Tie-Handle-Flock-0.01
http://search.cpan.org/~iheffner/Tie-Handle-Flock-0.01/
exclusive locking write handle 
----
TipJar-MTA-0.31
http://search.cpan.org/~davidnico/TipJar-MTA-0.31/
outgoing SMTP with exponential random backoff. 
----
Tk-ForDummies-Graph-1.06
http://search.cpan.org/~djibel/Tk-ForDummies-Graph-1.06/
Extension of Canvas widget to create a graph like GDGraph. 
----
TkUtil-Gui-0.01
http://search.cpan.org/~thecramps/TkUtil-Gui-0.01/
Easy access to a Perl/Tk GUI state 
----
UUID-Generator-PurePerl-0.04
http://search.cpan.org/~banb/UUID-Generator-PurePerl-0.04/
Universally Unique IDentifier (UUID) Generator 
----
UUID-Object-0.03
http://search.cpan.org/~banb/UUID-Object-0.03/
Universally Unique IDentifier (UUID) Object Class 
----
UUID-Object-0.03_01
http://search.cpan.org/~banb/UUID-Object-0.03_01/
Universally Unique IDentifier (UUID) Object Class 
----
WWW-Shorten-RevCanonical-0.03
http://search.cpan.org/~miyagawa/WWW-Shorten-RevCanonical-0.03/
Shorten URL using rev="canonical" 
----
WebService-Solr-0.05
http://search.cpan.org/~bricas/WebService-Solr-0.05/
Module to interface with the Solr (Lucene) webservice 
----
XML-Compile-SOAP-2.04
http://search.cpan.org/~markov/XML-Compile-SOAP-2.04/
base-class for SOAP implementations 


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: Mon, 13 Apr 2009 22:16:13 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Pipe Between Programs
Message-Id: <tlmcb6-9dr2.ln1@osiris.mauzo.dyndns.org>


Quoth "E.D.G." <edgrsprj@ix.netcom.com>:
> CREATING A PIPE BETWEEN TWO PERL PROGRAMS
> 
> Windows and ActiveState Perl are being used
> 
> Can anyone supply the code for creating two direction pipes between two Perl 
> programs that are running at the same time?

If you want bi-directional pipes on Win32, you are best off using
sockets. See IO::Socket and IO::Socket::INET.

> A separate goal is to learn how to establish two direction pipes between a 
> Perl program and some other language program.  It is assumed that the same 
> type of procedure would be used.

Most languages provide some way to create and use sockets. 

> The following code is presently being used to create a one direction pipe 
> between a Perl program and the Gnuplot graphics program.  I have not yet 
> been able to learn how to easily modify it so that a connection can be 
> established between two Perl programs.
> 
> open gnuplot, 'pgnuplot.exe';

Don't use global bareword filehandles. Keep your filehandles in
variables instead.

*Always* check the return value of open.

It is conventional to make filehandle names all-uppercase.

You have omitted the '|' symbol here. Please post code you have
*actually* *run*, to avoid unnecessary confusion.

Assuming you meant '|pgnuplot.exe', you should be using 3-arg open
rather than the magical 2-arg open, unless you understand everything
2-arg open does and what the risks of using it are.

It will make your programs more portable if you omit the '.exe' when
invoking progams.

    open my $GNUPLOT, "|-", "gnuplot"
        or die "can't run gnuplot: $!";

> use FileHandle;
> gnuplot->autoflush(1);
> 
> print gnuplot 'some command', "\n";
> 
> close gnuplot;

If you have a filehandle open for writing, *always* check the return
value of close. If the filehandle was a piped open close will fail if
the program exits with an error.

> Using that code, the Gnuplot graphics programs pgnuplot.exe and wgnuplot.exe 
> both need to be in the same directory as the Perl program.

Or in the %PATH%, presumably. You could also use an absolute path to
pgnuplot.exe.

> After the pipe is created, how does one Perl program input information from 
> the other?  I am guessing that it is some variation of the readline command 
> such as:
> 
> $temp = readline program2;

If you have a socket or pipe open for reading you can read from it with
readline or with <>. Most Perl programmers will find the <> form more
familiar, so you might want to consider using it.

Ben



------------------------------

Date: Mon, 13 Apr 2009 13:59:10 -0700
From: sln@netherlands.com
Subject: UTF-32 and Regular Expressions on Binary Data  (was Re: XML::LibXML UTF-8 toString() -vs- nodeValue())
Message-Id: <kt77u4dkgq0spiqvtknpk2dekq4fbefaun@4ax.com>

On Sat, 11 Apr 2009 11:59:55 +0200, "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
[snip]
>Code is always nice because it is unambiguous (unlike the English
>language). However, keep in mind that this is a discussion group, not a
>code repository. Any code example longer than 50 lines or so is unlikely
>to be read.
>	hp

Hey Peter,

Thanks for your insight. Any other Unicode guru's out there would like to steer me
in the more right direction would be greatly appretiated.

I didn't want to start a new thread, so this is a branch on a recent one.
I finally have a grasp of encodings, albeit a small but significant glimmer.

My goal is to convert 32-bit binary data to Unicode character's that can
be used as both the data and the pattern in regular expression matching.

I believe I am halfway there, the binary to Unicode (Perl internal utf8) conversion,
which at least will do (I think) from 0..10FFFF (hex). We need 0..(2**32 - 1), but the
references I looked at are pretty old (@2002) so this may be possible now.
Formulating a regex via sprintf of binary may be a little bit more involved but I am 
encouraged by the below code. The data side of the regex is not a problem. And if
the data conversion to strings is not a problem then its not going to be a problem
constructing pattern strings.

Sample is below. Note that some of the characters in the utf8 string output translates to
'?' characters in my Agent reader.
TIA.

-sln

==========================================================================================
## fr7.pl
##
## References: (UTF-32 - http://www.unicode.org/reports/tr19/tr19-9.html (@2002)
## (todo add more.. the links are endless)
##

use warnings;
use strict;

use Encode;
#use Encode::Unicode; # strange, 'decode()' is not found, thought it might be a base class, but not so.

binmode STDOUT, ':utf8';

# This is a shortened sample to test we get back what we put in. At the least we want to get an
# uninterrupted output from 0..10FFFF (hex). We need 0..(2**32 - 1), don't know how but this is a start.
# my @ar = (ord('a'),20000,20001,20002,20003,20004,20005,23336,20007,20008,20009,30000);

# Supersize it, inject some non utf-8 (thats why we are using utf-32) between code points to test
# conversion. Hey, it works! We get back what we put in.
my @ar = (ord('a'),0 .. 300);

# ----------------------------

print "\n";
print "Numeric array:\n@ar\n";

my $str = "\x{ff}\x{fe}\x{0}\x{0}" . pack 'L*', @ar;
# my $str = "\x{0}\x{0}\x{fe}\x{ff}".$str;  # Apparently, the endianess is different on my machine.
                                            # This is going to be an issue since we need strings.
print "\n";
dumpstr_d ("Packed 'L*' string with UTF-32 BOM prepended - ", $str);

print "\n";
$str = decode("UTF-32", $str);
dumpstr_d ("Decoded UTF-32. String - ", $str);

print "\n";
print "utf8 string:\n", $str ,"\n";

# ----------------------------

sub dumpstr_h {
    my ($comment,$s) = @_;
    print "(Hex Dump) $comment";
    print utf8::is_utf8($s) ? "char" : "byte";
    print "[", length($s), "]";
    print ":\n";
    for (split //, $s) {
	printf "%#02x ", ord($_);
    }
    print "\n";
}

sub dumpstr_d {
    my ($comment,$s) = @_;
    print "(Decimal Dump) $comment";
    print utf8::is_utf8($s) ? "char" : "byte";
    print "[", length($s), "]";
    print ":\n";
    for (split //, $s) {
	printf "%d ", ord($_);
    }
    print "\n";
}

__END__

c:\temp>perl fr7.pl

Numeric array:
97 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 8
2 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
 287 288 289 290 291 292 293 294 295 296 297 298 299 300

(Decimal Dump) Packed 'L*' string with UTF-32 BOM prepended - byte[1212]:
255 254 0 0 97 0 0 0 0 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0 7 0
 0 0 8 0 0 0 9 0 0 0 10 0 0 0 11 0 0 0 12 0 0 0 13 0 0 0 14 0 0 0 15 0 0 0 16 0
0 0 17 0 0 0 18 0 0 0 19 0 0 0 20 0 0 0 21 0 0 0 22 0 0 0 23 0 0 0 24 0 0 0 25 0
 0 0 26 0 0 0 27 0 0 0 28 0 0 0 29 0 0 0 30 0 0 0 31 0 0 0 32 0 0 0 33 0 0 0 34
0 0 0 35 0 0 0 36 0 0 0 37 0 0 0 38 0 0 0 39 0 0 0 40 0 0 0 41 0 0 0 42 0 0 0 43
 0 0 0 44 0 0 0 45 0 0 0 46 0 0 0 47 0 0 0 48 0 0 0 49 0 0 0 50 0 0 0 51 0 0 0 5
2 0 0 0 53 0 0 0 54 0 0 0 55 0 0 0 56 0 0 0 57 0 0 0 58 0 0 0 59 0 0 0 60 0 0 0
61 0 0 0 62 0 0 0 63 0 0 0 64 0 0 0 65 0 0 0 66 0 0 0 67 0 0 0 68 0 0 0 69 0 0 0
 70 0 0 0 71 0 0 0 72 0 0 0 73 0 0 0 74 0 0 0 75 0 0 0 76 0 0 0 77 0 0 0 78 0 0
0 79 0 0 0 80 0 0 0 81 0 0 0 82 0 0 0 83 0 0 0 84 0 0 0 85 0 0 0 86 0 0 0 87 0 0
 0 88 0 0 0 89 0 0 0 90 0 0 0 91 0 0 0 92 0 0 0 93 0 0 0 94 0 0 0 95 0 0 0 96 0
0 0 97 0 0 0 98 0 0 0 99 0 0 0 100 0 0 0 101 0 0 0 102 0 0 0 103 0 0 0 104 0 0 0
 105 0 0 0 106 0 0 0 107 0 0 0 108 0 0 0 109 0 0 0 110 0 0 0 111 0 0 0 112 0 0 0
 113 0 0 0 114 0 0 0 115 0 0 0 116 0 0 0 117 0 0 0 118 0 0 0 119 0 0 0 120 0 0 0
 121 0 0 0 122 0 0 0 123 0 0 0 124 0 0 0 125 0 0 0 126 0 0 0 127 0 0 0 128 0 0 0
 129 0 0 0 130 0 0 0 131 0 0 0 132 0 0 0 133 0 0 0 134 0 0 0 135 0 0 0 136 0 0 0
 137 0 0 0 138 0 0 0 139 0 0 0 140 0 0 0 141 0 0 0 142 0 0 0 143 0 0 0 144 0 0 0
 145 0 0 0 146 0 0 0 147 0 0 0 148 0 0 0 149 0 0 0 150 0 0 0 151 0 0 0 152 0 0 0
 153 0 0 0 154 0 0 0 155 0 0 0 156 0 0 0 157 0 0 0 158 0 0 0 159 0 0 0 160 0 0 0
 161 0 0 0 162 0 0 0 163 0 0 0 164 0 0 0 165 0 0 0 166 0 0 0 167 0 0 0 168 0 0 0
 169 0 0 0 170 0 0 0 171 0 0 0 172 0 0 0 173 0 0 0 174 0 0 0 175 0 0 0 176 0 0 0
 177 0 0 0 178 0 0 0 179 0 0 0 180 0 0 0 181 0 0 0 182 0 0 0 183 0 0 0 184 0 0 0
 185 0 0 0 186 0 0 0 187 0 0 0 188 0 0 0 189 0 0 0 190 0 0 0 191 0 0 0 192 0 0 0
 193 0 0 0 194 0 0 0 195 0 0 0 196 0 0 0 197 0 0 0 198 0 0 0 199 0 0 0 200 0 0 0
 201 0 0 0 202 0 0 0 203 0 0 0 204 0 0 0 205 0 0 0 206 0 0 0 207 0 0 0 208 0 0 0
 209 0 0 0 210 0 0 0 211 0 0 0 212 0 0 0 213 0 0 0 214 0 0 0 215 0 0 0 216 0 0 0
 217 0 0 0 218 0 0 0 219 0 0 0 220 0 0 0 221 0 0 0 222 0 0 0 223 0 0 0 224 0 0 0
 225 0 0 0 226 0 0 0 227 0 0 0 228 0 0 0 229 0 0 0 230 0 0 0 231 0 0 0 232 0 0 0
 233 0 0 0 234 0 0 0 235 0 0 0 236 0 0 0 237 0 0 0 238 0 0 0 239 0 0 0 240 0 0 0
 241 0 0 0 242 0 0 0 243 0 0 0 244 0 0 0 245 0 0 0 246 0 0 0 247 0 0 0 248 0 0 0
 249 0 0 0 250 0 0 0 251 0 0 0 252 0 0 0 253 0 0 0 254 0 0 0 255 0 0 0 0 1 0 0 1
 1 0 0 2 1 0 0 3 1 0 0 4 1 0 0 5 1 0 0 6 1 0 0 7 1 0 0 8 1 0 0 9 1 0 0 10 1 0 0
11 1 0 0 12 1 0 0 13 1 0 0 14 1 0 0 15 1 0 0 16 1 0 0 17 1 0 0 18 1 0 0 19 1 0 0
 20 1 0 0 21 1 0 0 22 1 0 0 23 1 0 0 24 1 0 0 25 1 0 0 26 1 0 0 27 1 0 0 28 1 0
0 29 1 0 0 30 1 0 0 31 1 0 0 32 1 0 0 33 1 0 0 34 1 0 0 35 1 0 0 36 1 0 0 37 1 0
 0 38 1 0 0 39 1 0 0 40 1 0 0 41 1 0 0 42 1 0 0 43 1 0 0 44 1 0 0

(Decimal Dump) Decoded UTF-32. String - char[302]:
97 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 8
2 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
 287 288 289 290 291 292 293 294 295 296 297 298 299 300

utf8 string:
a ????
?¤????¶§?????????? !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
^_`abcdefghijklmnopqrstuvwxyz{|}~¦-Ç-ü-é-â-ä-à-å-ç-ê-ë-è-ï-î-ì-Ä-Å-É-æ-Æ-ô-ö-ò-û
-ù-ÿ-Ö-Ü-¢-£-¥-P-ƒ-á-í-ó-ú-ñ-Ñ-ª-º-¿-¬-¬-½-¼-¡-«-»-¦-¦-¦-¦-¦-¦-¦-+-+-¦-¦-+-+-+-+
-++Ç+ü+é+â+ä+à+å+ç+ê+ë+è+ï+î+ì+Ä+Å+É+æ+Æ+ô+ö+ò+û+ù+ÿ+Ö+Ü+¢+£+¥+P+ƒ+á+í+ó+ú+ñ+Ñ+ª
+º+¿+¬+¬+½+¼+¡+«+»+¦+¦+¦+¦+¦+¦+¦+++++¦+¦++++++++++-Ç-ü-é-â-ä-à-å-ç-ê-ë-è-ï-î-ì-Ä
-Å-É-æ-Æ-ô-ö-ò-û-ù-ÿ-Ö-Ü-¢-£-¥-P-ƒ-á-í-ó-ú-ñ-Ñ-ª-º-¿-¬-¬-½-¼




------------------------------

Date: Tue, 14 Apr 2009 07:14:22 +0200
From: "Mark" <liarafan@xs4all.nl>
Subject: Re: XML::LibXML UTF-8 toString() -vs- nodeValue()
Message-Id: <B5qdnYMvLOwzhnnUnZ2dnUVZ8sSdnZ2d@giganews.com>

----- Original Message ----- 
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Newsgroups: comp.lang.perl.misc
Sent: Saturday, April 11, 2009 11:59 AM
Subject: Re: XML::LibXML UTF-8 toString() -vs- nodeValue()

> On the other hand, I think you don't know what a stream is:
> 
> my ($fh, '<', 'test.xml');
> 
> Now $fh refers a stream. Please show me how you can apply a regexp to
> this stream. Solutions which don't count:
> 
> * reading chunks from the stream into a scalar variable and then
>   applying the regexp to this variable (because then you apply it to a 
>   string (as I wrote), not a stream.
> * writing your own regexp engine (since Perl is a general purpose
>   programming language, you can of course write that but we were
>   talking about Perl' builtin regexp).

Regexes in 'split' can be done on a stream; for example:

open (SMTPD, "$out_name") or return undef;
undef $/;
my ($header, $body) = split (/\n{2,}/, <SMTPD>, 2);

- Mark


------------------------------

Date: Tue, 14 Apr 2009 01:04:13 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: XML::LibXML UTF-8 toString() -vs- nodeValue()
Message-Id: <slrngu89qt.sbg.tadmc@tadmc30.sbcglobal.net>

Mark <liarafan@xs4all.nl> wrote:


> open (SMTPD, "$out_name") or return undef;


    perldoc -q vars


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

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 2336
***************************************


home help back first fref pref prev next nref lref last post