[24614] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6790 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 11 06:05:36 2004

Date: Sun, 11 Jul 2004 03:05: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           Sun, 11 Jul 2004     Volume: 10 Number: 6790

Today's topics:
    Re: hash as argument <ahamm@mail.com>
    Re: Installing seperate version of Perl. <Joe.Smith@inwap.com>
    Re: Perl Regex Question: how to translate only the lead <invalid-email@rochester.rr.com>
    Re: Perl Regex Question: how to translate only the lead <segraves_f13@mindspring.com>
    Re: Regexp substitution problem - suggestions? <Joe.Smith@inwap.com>
    Re: why utf8::upgrade is needed? <pajas@ufal.ms.mff.cuni.cz>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 11 Jul 2004 12:49:39 +1000
From: "Andrew Hamm" <ahamm@mail.com>
Subject: Re: hash as argument
Message-Id: <2lbo6gFb534tU1@uni-berlin.de>

John J. Trammell wrote:
> On Sat, 10 Jul 2004 12:36:51 +1000, Andrew Hamm <ahamm@mail.com> wrote:
>> AOL?
>
> http://catb.org/~esr/jargon/html/A/AOL-.html

hehehheh - I like dat!




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

Date: Sun, 11 Jul 2004 06:25:29 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Installing seperate version of Perl.
Message-Id: <t35Ic.66956$Oq2.17946@attbi_s52>

TLOlczyk wrote:

>>That's described in the standard installation docs. The key word to look for
>>there is "prefix".
>>
>>Let's say you used a prefix of /usr/local/oldperl. The Perl binary would
>>then be in /usr/local/oldperl/bin, so add that to your user's PATH. Or,
>>begin scripts that use the old perl with #!/usr/local/oldperl/bin/perl.
>>
> 
> Sorry your answer shows me that I asked the wrong question.
> The right question should have been:
> "How do I get two different versions of perl to coexist on the same
> machine."

The answer was stated above.
Put one version of perl in /usr/local/bin/perl and the other one
in /usr/local/oldperl/bin/perl.
Both versions (and their libraries) can coexist on the same machine.

Notice that you did not ask "how can I make '/usr/bin/perl' be different
versions to different users".  If you had asked that question, I would
have referred you to the chroot() system call and/or executable program.
But you didn't, so Sherm's answer stands.
	-Joe


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

Date: Sun, 11 Jul 2004 03:31:26 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Perl Regex Question: how to translate only the leading letters of a line
Message-Id: <40F0B48C.6050704@rochester.rr.com>

Gunnar Hjalmarsson wrote:

> Jay Tilton wrote:
> 
>>
>>     $_ ^= 'p';
> 
> 
> Hmm ...  I know what $_ is. Would you mind explaining ^= and 'p'? Are 
> they explained in the Perl docs, or are they C things that happen to 
> work in Perl as well?
> 

Well, $_ ^= 'p'; does $_ xor 'p' (xor being "bitwise exclusive or" of 
two character strings), and puts the result back in $_.  It appears that 
the binary representation of 'p' (on ASCII machines, anyway) is the 
correct value to convert via xor the binary representation of '1' 
through '9' to that of 'A' through 'I'.  That probably won't fly on a 
platform which uses a non-ASCII character set.

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl



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

Date: Sun, 11 Jul 2004 07:24:19 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: Perl Regex Question: how to translate only the leading letters of a line
Message-Id: <DW5Ic.11817$sD4.11614@newsread3.news.atl.earthlink.net>

"Jay Tilton" <tiltonj@erols.com> wrote in message
news:40f081b2.71861251@news.erols.com...
> enstrophy_2000@yahoo.com (Yu) wrote:
>
> :   I wonder if there is an elegant way of converting
> : number 1-9 into letter A-I for the LEADING letter
> : of a line. For example:
> :
> : Input:
> : 1 xxxx1234....
> :
> : Ou[t]put:
> : A xxxx1234....
>
>     $_ ^= 'p';
>

Very clever, IMO!

While this is a correct solution to the problem posed by the OP, it fails
under the interpretation of the problem by A. Sinan Unur, e.g., '0' is
translated into '@'.

Assuming further that we shall do no harm to lines that don't begin with 1-9
and that don't have a space character as the second character, I'd propose

    $_ ^= 'p' if (/^[1-9] /); # tested

as an alternative to Jay Tilton's solution.

--
Bill Segraves






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

Date: Sun, 11 Jul 2004 06:08:15 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Regexp substitution problem - suggestions?
Message-Id: <jP4Ic.54726$a24.12142@attbi_s03>

Joe Halbrook wrote:

> The file I was using to test contained the following:
> 
> E-mail me at:  mailto:inquiries at domain.com
> E-mail me at:  mailto:inquiries at domain.com.
> E-mail me at:  mailto:inquiries at domain again.
> Try this:      mailto:addr at domain.com?Subject=Testing-blues

Why are you carrying a grudge against the owner of domain.com?

When using sample URLs or domain names in anything you publish, the
proper thing to do is use "www.example.com" or "webmaster@example.com",
as the "example.com" is set up expicitly for that purpose.

Looking at http://www.domain.com/ shows that "domain.com" is not a
fictitious address.  I'm sure that the owner of <inquiries at domain.com>
does not appreciate you usurping a real domain name.
	-Joe


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

Date: Sun, 11 Jul 2004 11:44:01 +0200
From: Petr Pajas <pajas@ufal.ms.mff.cuni.cz>
Subject: Re: why utf8::upgrade is needed?
Message-Id: <ccr208$7h3$1@news.vol.cz>

Anno Siegel wrote:

> Petr Pajas  <pajas@ufal.ms.mff.cuni.cz> wrote in comp.lang.perl.misc:
> 
> [...]
> 
>> Without going into boring details, my situation is as follows: in my
>> program, the user provides arbitrary Perl expression which I parse using
>> Text::Balanced. The expression is expected to result in a ascii or UTF8
>> string (or maybe some other perl object). Due to a reported (and already
>> fixed) bugs in substr of Perl<=5.8.3, this module fails to handle utf8
>> code correctly, so the users are forced to use ASCII code. To insert
>> literal utf8 data into ascii code, the user has to use \x{...}. After I
>> evaluate the expression, I'm passing it to a XS module, which is utf8
>> aware, but treats non-utf8-flagged non-ascii strings in a specific way.
>> On the other hand, having a blood-signed treaty with the user on my
>> desk:-), I know that when he says "\x{e1}", he means characters, not
>> bytes. But, since "\x{e1}" evaluates as to a non-ascii non-UTF8-flagged
>> string, the modules behaves incorrectly. So, in order to resolve it, I
>> have to manually force upgrade at all entry points to the library
>> (hundreds). Other solution would be to remove the "special treatment" of
>> non-utf8 non-ascii data from the XS module (being one of the developers I
>> could try to establish that), but unfortunately, lots of users rely on
>> that behavior.
> 
> Let me just throw in a reminder that the behavior of literals can be
> overloaded.  If the problem can be solved by changing the way string
> literals are interpreted, this may help:
> 
>     use overload;
>     overload::constant( q => \ &make_utf8);
>     sub make_utf8 {
>         my ( $orig, $perl, $mode) = @_;
>         utf8::encode( $perl) if grep ord() >= 128, split //, $perl;
>         $perl;
>     }
> 
> That would enforce utf8 interpretation of any string containing a
> character
> in the 128 - 255 range.  If the code is put in a library, the call to
> overload::constant() should should go in the import() routine.
> 
> Then again, I may be entirely on the wrong track...

This looks promissing. Thanks a lot,

-- Petr



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6790
***************************************


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