[29361] in Perl-Users-Digest
Perl-Users Digest, Issue: 605 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 30 18:09:53 2007
Date: Sat, 30 Jun 2007 15:09:04 -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 Sat, 30 Jun 2007 Volume: 11 Number: 605
Today's topics:
Alter - Perl extension for Alter Ego Objects anno4000@radom.zrz.tu-berlin.de
Re: Assigning another filehandle to STDOUT, using binmo <hjp-usenet2@hjp.at>
Re: Assigning another filehandle to STDOUT, using binmo <rvtol+news@isolution.nl>
Re: Assigning another filehandle to STDOUT, using binmo <a24061@ducksburg.com>
Re: Can't find par loader at C:/Perl/site/lib/PAR/Packe smueller@cpan.org
Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!! <shmh@bigpond.net.au>
Re: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!! <sisyphus1@nomail.afraid.org>
Re: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!! <tadmc@seesig.invalid>
Re: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!! <shmh@bigpond.net.au>
Re: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!! <shmh@bigpond.net.au>
Re: hex to ebcdic <rvtol+news@isolution.nl>
install of perl 5.8.8 rogv24@yahoo.com
Re: Problem with PERL function <tadmc@seesig.invalid>
Re: Simple fork examples <m@rtij.nl.invlalid>
Re: Simple fork examples <rvtol+news@isolution.nl>
Re: Simple fork examples <bik.mido@tiscalinet.it>
Re: Simple fork examples <bik.mido@tiscalinet.it>
Re: The $a have any special meanning ? <wyzelli@yahoo.com>
Re: The $a have any special meanning ? <tricks-are-for-kids@temporaryforwarding.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Jun 2007 16:13:49 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Alter - Perl extension for Alter Ego Objects
Message-Id: <5endptF372ctpU1@mid.dfncis.de>
In a thread from a month ago (Beyond Inside-Out) I showed the sketch
of a method to do black-box inheritance in Perl without some of the
drawbacks of the inside-out technique. I have now worked out that
sketch to a module that I intend to put up on CPAN. If anyone is
sufficiently interested to take a look, it can be downloaded from
http://www2.tu-berlin.de//zrz/mitarbeiter/anno4000/alter/Alter-0.02.tar.gz
The pod can be viewed (without downloading) at
http://www2.tu-berlin.de//zrz/mitarbeiter/anno4000/alter/Alter_pod.html
Anno
------------------------------
Date: Sat, 30 Jun 2007 12:44:14 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Assigning another filehandle to STDOUT, using binmode.
Message-Id: <slrnf8ccvu.l0a.hjp-usenet2@zeno.hjp.at>
On 2007-06-30 00:08, Dr.Ruud <rvtol+news@isolution.nl> wrote:
> Peter J. Holzer schreef:
>> Dr.Ruud:
>>> Adam Funk:
>
>>>> I think I get it. String literals and variables just contain
>>>> strings of bytes, and encoding is a consideration only for input
>>>> and output --- or is that only for output?
>>>
>>> A Perl text string contains characters. See perlunitut:
>>> http://search.cpan.org/perldoc?perlunitut
>>
>> True, but not the answer to Adam's question. Not every perl string is
>> a perl text string. Strings can be used to store non-textual
>> information.
>
> You should read more carefully, I wrote "A Perl *text* string".
I did read this. That's why I wrote "Not every perl string is a perl
*text* string" (emphasis added). Adam asked about "String literals and
variables". While some point can be made that string literals are
supposed to always contain text strings, that certainly isn't true about
variables.
> The concept is further defined in perlunitut.
Perlunitut is good reading. If you had just recommended that Adam should
read this, I wouldn't have objected. But your first sentence was IMHO
missing the point and possibly misleading.
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: Sat, 30 Jun 2007 14:09:13 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Assigning another filehandle to STDOUT, using binmode.
Message-Id: <f65oml.a8.1@news.isolution.nl>
Peter J. Holzer schreef:
> Dr.Ruud:
>> Peter J. Holzer:
>>> Dr.Ruud:
>>>> A Perl text string contains characters. See perlunitut:
>>>> http://search.cpan.org/perldoc?perlunitut
>>>
>>> True, but not the answer to Adam's question. Not every perl string
>>> is a perl text string. Strings can be used to store non-textual
>>> information.
>>
>> You should read more carefully, I wrote "A Perl *text* string".
>
> I did read this. That's why I wrote "Not every perl string is a perl
> *text* string" (emphasis added).
This is getting ridiculous. I wrote "Perl text string", and you reacted
on something you call "every perl string", which I didn't write. (Adam
is dealing with Perl text strings, or he should be.)
I was not talking about "every perl string", I was specifically
isolating the "Perl text string"-type-of-Perl-string, by explicitely
referring to it as "Perl text string", in an introduction to (so related
to) perlunitut. There was, contrary to what you read into it, nothing
incomplete about it.
Yes it assumes that you actually read perlunitut, which is easy to read
and understand, but why would I have ordered "See perlunitut" otherwise?
Should I maybe have written "Read and follow perlunitut" in stead of
"See perlunitut" for you to get the picture?
See also `perldoc Encode`, it defines all strings in Perl as sequences
of characters (and binary strings as just a subset of Perl strings),
which is different from how perlunitut projects it.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 30 Jun 2007 21:22:15 +0100
From: Adam Funk <a24061@ducksburg.com>
Subject: Re: Assigning another filehandle to STDOUT, using binmode.
Message-Id: <nkqil4-66r.ln1@news.ducksburg.com>
On 2007-06-30, Dr.Ruud wrote:
> Peter J. Holzer schreef:
>> Dr.Ruud:
>>> Peter J. Holzer:
>>>> True, but not the answer to Adam's question. Not every perl string
>>>> is a perl text string. Strings can be used to store non-textual
>>>> information.
>>>
>>> You should read more carefully, I wrote "A Perl *text* string".
>>
>> I did read this. That's why I wrote "Not every perl string is a perl
>> *text* string" (emphasis added).
>
> This is getting ridiculous. I wrote "Perl text string", and you reacted
> on something you call "every perl string", which I didn't write. (Adam
> is dealing with Perl text strings, or he should be.)
I hope you don't mind if I butt in here ;-) to say that you've *both*
given me very helpful and informative replies!
To be fair, perlunitut does deal with both kinds of strings but it
clarifies that there are two different kinds, and I figured out that I
was interested in text strings.
> See also `perldoc Encode`, it defines all strings in Perl as sequences
> of characters (and binary strings as just a subset of Perl strings),
> which is different from how perlunitut projects it.
That sounds interesting; I'll take a look at that too.
Thanks (to both of you),
Adam
------------------------------
Date: Sat, 30 Jun 2007 07:32:39 -0700
From: smueller@cpan.org
Subject: Re: Can't find par loader at C:/Perl/site/lib/PAR/Packer.pm line 101
Message-Id: <1183213959.509927.85080@u2g2000hsc.googlegroups.com>
On Jun 20, 7:23 pm, Oliver Soeder <osoe...@gmx.de> wrote:
> Hello, I want to compile Perl scripts to .exe on Windows.
>
> I followed the instruction on this site:
>
> http://www.expertsrt.com/tutorials/Matt/perlPAR.html#download
>
> but if I execute pp, I receive that error message:
>
> Can't find par loader at C:/Perl/site/lib/PAR/Packer.pm line 101
That tutorial links to *extremely* old versions of PAR and its
dependencies. Please try to install the current versions of PAR,
PAR::Packer and their dependencies from CPAN using the CPAN.pm shell
(perl -MCPAN -eshell) or PPM.
The newest PAR and its dependencies probably aren't available from the
default ActiveState PPM repository due to some build problems on
win32+MSVC. You can find recent binary packages of PAR and friends on
www.bribes.org and http://theoryx5.uwinnipeg.ca/ppms/.
Best regards,
Steffen
------------------------------
Date: Sat, 30 Jun 2007 09:22:27 GMT
From: "Simon" <shmh@bigpond.net.au>
Subject: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <nhphi.1238$4A1.783@news-server.bigpond.net.au>
Hi guys!
I have this script which is driving me nuts...
=================================
use Win32;
use Win32::TieRegistry;
use Win32API::Registry;
use Win32::Registry;
$p = 'SOFTWARE\CML';
Win32::RegOpenKeyEx(&HKEY_LOCAL_MACHINE,$p,&NULL,&
KEY_QUERY_VALUE|&KEY_SET_VALUE,$hkey);
Win32::RegQueryValueEx($hkey,"Servertype",&NULL,$type,$ServerType);
Win32::RegQueryValueEx($hkey,"SystemType",&NULL,$type,$SystemType);
print "$ServerType\n";
print "$SystemType\n";
====================================
When I run this, I get:
C:\>ex.pl
Can't locate auto/Win32/RegOpenKeyE.al in @INC (@INC contains:
C:/Perl/site/lib
C:/Perl/lib .) at C:\ex.pl line 6
It seems like its having issues with the RegOpenKeyX, RegOpenQuery parts.
I have the following version of ActiveState Perl...
C:\>perl -v
This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 50 registered patches, see perl -V for more detail)
Copyright 1987-2006, Larry Wall
I have the Win32, Win32::TieRegistry, Win32API, Win32::Registry modules on
my system.
I have reinstalled perl, and still getting the above, and getting the same
thing on multiple systems.
I must be doing something wrong.
Any help greatly appreciated.
Simon
------------------------------
Date: Sat, 30 Jun 2007 22:08:18 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <4686478f$0$27254$afc38c87@news.optusnet.com.au>
"Simon" <shmh@bigpond.net.au> wrote in message
news:nhphi.1238$4A1.783@news-server.bigpond.net.au...
> Hi guys!
>
> I have this script which is driving me nuts...
.
.
> Win32::RegOpenKeyEx(&HKEY_LOCAL_MACHINE,$p,&NULL,&
I think that should be:
Win32API::Registry::RegOpenKeyEx(&HKEY_LOCAL_MACHINE ..
RegOpenKeyEx() is a Win32API::Registry function, not a Win32 function.
Admittedly the error message is not as clear as it should be.
Cheers,
Rob
------------------------------
Date: Sat, 30 Jun 2007 06:52:02 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <slrnf8cgv2.tq3.tadmc@tadmc30.sbcglobal.net>
Simon <shmh@bigpond.net.au> wrote:
> Subject: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!!
> Any help greatly appreciated.
Your choice of Subject has ensured that very few people will
bother reading your article.
Please put the subject of your article in the Subject of your article.
(you cannot process bananas using Perl.)
Spammers fill their subjects with useless punctuation too. If your
article looks like a spam article, many readers will simply skip
it and go read a non-spam article instead.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 30 Jun 2007 14:28:55 GMT
From: "Simon" <shmh@bigpond.net.au>
Subject: Re: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <HMthi.1317$4A1.725@news-server.bigpond.net.au>
Hi Tad!
As soon as I posted it I thought exactly what you said.
Will know next time. Thank you.
"Tad McClellan" <tadmc@seesig.invalid> wrote in message
news:slrnf8cgv2.tq3.tadmc@tadmc30.sbcglobal.net...
> Simon <shmh@bigpond.net.au> wrote:
>
>> Subject: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
>> Any help greatly appreciated.
>
>
> Your choice of Subject has ensured that very few people will
> bother reading your article.
>
> Please put the subject of your article in the Subject of your article.
>
> (you cannot process bananas using Perl.)
>
> Spammers fill their subjects with useless punctuation too. If your
> article looks like a spam article, many readers will simply skip
> it and go read a non-spam article instead.
>
>
> --
> Tad McClellan
> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 30 Jun 2007 14:28:26 GMT
From: "Simon" <shmh@bigpond.net.au>
Subject: Re: Going Bananas!!!!!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <eMthi.1316$4A1.72@news-server.bigpond.net.au>
Thanks Rob...fixed my problem... thank you.
"Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
news:4686478f$0$27254$afc38c87@news.optusnet.com.au...
>
> "Simon" <shmh@bigpond.net.au> wrote in message
> news:nhphi.1238$4A1.783@news-server.bigpond.net.au...
>> Hi guys!
>>
>> I have this script which is driving me nuts...
> .
> .
>> Win32::RegOpenKeyEx(&HKEY_LOCAL_MACHINE,$p,&NULL,&
>
> I think that should be:
> Win32API::Registry::RegOpenKeyEx(&HKEY_LOCAL_MACHINE ..
>
> RegOpenKeyEx() is a Win32API::Registry function, not a Win32 function.
>
> Admittedly the error message is not as clear as it should be.
>
> Cheers,
> Rob
------------------------------
Date: Sat, 30 Jun 2007 14:02:37 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: hex to ebcdic
Message-Id: <f65nq9.2dc.1@news.isolution.nl>
Gunnar Hjalmarsson schreef:
> use Encode 'decode';
> $hex = 'f1f2d7d9f0';
> ( $ebcdic = $hex ) =~ s/(..)/chr(hex $1)/eg;
> $ascii = decode 'posix-bc', $ebcdic;
Ah, "posic-bc", brings back memories. I would've thought that "EBCDIC"
or "EBCDIC-US" (see `iconv -l`) would work too, but they don't, see
`perldoc Encode::Supported`.
Variant using pack()
$ perl -Mstrict -MEncode=decode -wle'
my $ebcdic = pack q/H*/, $ARGV[0];
my $ascii = decode q/posix-bc/, $ebcdic;
print $ascii;
' f1f2d7d9f0
12PR0
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 30 Jun 2007 14:25:10 -0700
From: rogv24@yahoo.com
Subject: install of perl 5.8.8
Message-Id: <1183238710.641034.129760@c77g2000hse.googlegroups.com>
I have never installed Perl. I downloaded 5.8.8 into solaris 10
server.
Is there an eaaasy instruction for installation. There is
already v.5.8.4 installed.
thanks
------------------------------
Date: Fri, 29 Jun 2007 21:37:42 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Problem with PERL function
Message-Id: <slrnf8bgfm.ci0.tadmc@tadmc30.sbcglobal.net>
michaelzhao <mzhao1@gmail.com> wrote:
> Oh, and next time I'll post a short script.
But few will see it.
So long!
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 30 Jun 2007 12:18:49 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Simple fork examples
Message-Id: <pan.2007.06.30.10.18.58@rtij.nl.invlalid>
On Fri, 29 Jun 2007 14:43:17 +0000, QoS wrote:
> In addition, if you want the script to work on more platforms, afaik it
> is better to use threads.
No, threads on Perl are different from threads in all other languages.
Unless you know the severe restrictions on threads (for starters, no
signals) you may think about using them. I decided against threads in all
programs I wrote when the question came up. Even started a thread about
it a while ago, which has lots of answers you never wanted to know, but
must know if you contemplate using threads.
M4
------------------------------
Date: Sat, 30 Jun 2007 13:26:01 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Simple fork examples
Message-Id: <f65log.a0.1@news.isolution.nl>
Martijn Lievaart schreef:
> I decided against threads in
> all programs I wrote when the question came up.
http://www.perlmonks.org/?node_id=580004
Randal: "If the answer is "threads", you asked the wrong question.".
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 30 Jun 2007 14:12:08 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Simple fork examples
Message-Id: <hvhc83h1ufe9eekn45bnkt0t9u4talvsd6@4ax.com>
On Sat, 30 Jun 2007 12:18:49 +0200, Martijn Lievaart
<m@rtij.nl.invlalid> wrote:
>No, threads on Perl are different from threads in all other languages.
^^^
^^^
Hindi and Armenian included? :-)
>Unless you know the severe restrictions on threads (for starters, no
>signals) you may think about using them. I decided against threads in all
>programs I wrote when the question came up. Even started a thread about
Pun intended? :-)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 30 Jun 2007 14:19:06 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Simple fork examples
Message-Id: <6fic83hk2n6r25lk9vgqglmm97982g46se@4ax.com>
On Sat, 30 Jun 2007 13:26:01 +0200, "Dr.Ruud"
<rvtol+news@isolution.nl> wrote:
>http://www.perlmonks.org/?node_id=580004
>Randal: "If the answer is "threads", you asked the wrong question.".
: --
: A computer is a state machine.
: Threads are for people who can't program state machines.
: - Alan Cox
: --
: Threads are for people who have better things to do
: than program state machines.
: - renodino's amendment of Alan Cox's claim about threads...
: --
: Threads are for people who have better things to do than program state
: machines but instead prefer to waste time debugging concurrency and
: verification issues.
: - tirwhans's gloss of renodino's amendment.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 30 Jun 2007 07:34:11 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: The $a have any special meanning ?
Message-Id: <THnhi.1212$4A1.66@news-server.bigpond.net.au>
"sonet" <sonet.all@msa.hinet.net> wrote in message
news:f64n0b$d1h$1@netnews.hinet.net...
> 1.pl
> ----------------------
> use strict;
> $a=1;
>
> the perl does not return error (Global symbol "$a" requires explicit
> package name...)
>
> but
>
> 2.pl
> ----------------------
> use strict;
> $c=1;
>
> the perl return error (Global symbol "$c" requires explicit package
> name...)
$a and $b are special reserved variables used in sorting. perldoc -f sort
You can use them, but it is not good practice.
In fact single letter variable names are rarely good practice, particularly
when you need to re-edit that code in a years time...
P
------------------------------
Date: Sat, 30 Jun 2007 07:43:24 GMT
From: Thomas Wasell <tricks-are-for-kids@temporaryforwarding.com>
Subject: Re: The $a have any special meanning ?
Message-Id: <MPG.20f027fe5dd5e232989695@news1.comhem.se>
In article <f64n0b$d1h$1@netnews.hinet.net>, sonet.all@msa.hinet.net
wrote:
>1.pl
>----------------------
>use strict;
>$a=1;
>
>the perl does not return error (Global symbol "$a" requires explicit package
>name...)
>
>but
>
>2.pl
>----------------------
>use strict;
>$c=1;
>
>the perl return error (Global symbol "$c" requires explicit package name...)
Yes, $a and $b are special. See
perldoc -f sort
and
perldoc perlvar
for more information.
------------------------------
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 605
**************************************