[22045] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4267 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 15 21:06:19 2002

Date: Sun, 15 Dec 2002 18:05:05 -0800 (PST)
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, 15 Dec 2002     Volume: 10 Number: 4267

Today's topics:
        [Fwd: unknown import: lib Calc at C:/Perl/lib/Math/BigI <goldbb2@earthlink.net>
        AI4U (Arthur T. Murray)
        Getting the week day from a previous date. rob.buxton@wcc.spam.govt.nz
    Re: matching words starting and ending with defined let (liglin)
    Re: Odd pack() behavior <rick.delaney@rogers.com>
    Re: Odd pack() behavior <brian@gonzo.home>
    Re: Problem in Spacing entries in a File. <krahnj@acm.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 15 Dec 2002 20:12:59 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: [Fwd: unknown import: lib Calc at C:/Perl/lib/Math/BigInt.pm]
Message-Id: <3DFD289B.5A0DA6D8@earthlink.net>

This is a multi-part message in MIME format.
--------------2921227C4400D2C22EA10C30
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


--------------2921227C4400D2C22EA10C30
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Return-Path: <perl_dummy@bloodgate.com>
Received: from relay.pair.com ([209.68.1.20])
	by sparrow.mail.pas.earthlink.net (EarthLink SMTP Server) with SMTP id 18nxSV6KS3NZFjV0
	for <goldbb2@earthlink.net>; Sun, 15 Dec 2002 04:28:41 -0800 (PST)
Received: (qmail 65259 invoked from network); 15 Dec 2002 12:28:40 -0000
Received: from pd900bbab.dip.t-dialin.net (HELO null) (217.0.187.171)
  by relay1.pair.com with SMTP; 15 Dec 2002 12:28:40 -0000
X-pair-Authenticated: 217.0.187.171
X-Mailer: XFMail 1.4.0 on Linux
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Date: Sun, 15 Dec 2002 13:27:12 +0100 (CET)
Organization: none
From: Tels <perl_dummy@bloodgate.com>
To: goldbb2@earthlink.net
Subject: Re: unknown import: lib Calc at C:/Perl/lib/Math/BigInt.pm
Message-Id: <200212150428.18nxSV6KS3NZFjV0@sparrow.mail.pas.earthlink.net>

-----BEGIN xxx SIGNED MESSAGE-----

Moin Benjamin,

you wrote:
 
>For a compromise, you can install Math::BigInt::BitVec, which will allow
>you to use Math::BigInt, and have it use Bit::Vector as a backend.
>
>This will have the ease of use of M::BI, combined with (most of) the
>speed of B::V.  It's a compromise in that there is a tiny loss of speed
>due to using M::BI in front of B::V.

Could you please post a follow-up (I don't have newsaccess) detailing that
using 

* Math::BigInt::Bitvect needs also Bit::Vector
* using Math::BigInt::GMP (in conjunction with Math::GMP) or
  Math::BigInt::Pari would be better, since these libs are faster
  than BitVect
* using it with "use Math::BigInt lib => 'GMP,Pari,BitVect';" is
  recommended, and will work even when none of the libs is installed

?

BitVect needds a perl layer to make the fixed-width Bit::Vector numbers
without a fixed-length, this makes it slower.

Thanx in advance,

Te"And please don't post my email, I get enough spam"ls


- --
 "Why do you go so slowly? Do you think this is some kind of game?"
 PGP key available on http://bloodgate.com/tels.asc or via email.
 perl -MDev::Bollocks -le'print Dev::Bollocks->rand()'
 collaboratively unleash web-enabled environments


-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBPfx1G3cLPEOTuEwVAQGH4wf+NqoieT8R57Wj5NcvqDuDw9XsL/byARCZ
Zy+aztvllN09V623tsjKY6nuGORGfhE7SQy1WSpIZQz8XQGmV5lyMDW078vRm/oo
XqcNOlvECsnr8YzD1ikZ9o72dFpT2/LtgDNLr2CiXi1VeGTJZEiLWeR0MNPLZgKe
OcMMFX6sw0uB4Y8yBHw8DVOdRfpgRIoMzpD9hm/AuU5/K2sf3r4xZTr9u1laeiBQ
rhxqt1AJRhvlwkIVrSlDM5mybTV+UNoaQCoyojGM8L2dUppSVinHmXuU498zwT6F
ZRDjE0w4AJsq1U/GUI+XqTlqX90l2U2G6xcM3EUYsP1o6a95/cOqhQ==
=BwYg
-----END PGP SIGNATURE-----

--------------2921227C4400D2C22EA10C30--



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

Date: 15 Dec 2002 13:16:08 -0800
From: uj797@victoria.tc.ca (Arthur T. Murray)
Subject: AI4U
Message-Id: <3dfcf118@news.victoria.tc.ca>

A Comprehensive Perl Archive Network (CPAN) AI "mind.txt" file
has been published as page two within a pay-per-publish book at
http://books.iuniverse.com/viewbooks.asp?isbn=0595259227&page=2 .

Arthur T. Murray
-- 
http://mind.sourceforge.net/perl.html -- Perl for Robotic AI Minds;
http://www.cpan.org/authors/id/M/ME/MENTIFEX/mind.txt -- namespace;
http://www.iuniverse.com/bookstore/book_detail.asp?isbn=0595259227 
http://www.bookcrossing.com/mybookshelf/Mentifex/ "Spreading AI4U"


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

Date: Mon, 16 Dec 2002 01:55:47 GMT
From: rob.buxton@wcc.spam.govt.nz
Subject: Getting the week day from a previous date.
Message-Id: <3dfd2bc8.3776650@news>

Hi All,

I'm trying to determine what the weekday is from a given date.

I'd like to be able to subtract 3, 6 or 9 months from the current date
which is easy enough. What I then want to do is determine if this is a
saturday or sunday.

I thought I should be able to load the variables into the
localtime(EXPR) function and use that to retrieve the details for an
earlier date.

Alas, all attempts give me a date of Jan 1, 1970.
Is there a way to achieve this?

Using perl 5.6.1 under W2K.

TIA,

Rob.


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

Date: 15 Dec 2002 17:59:55 -0800
From: liglinlillibli@hotmail.com (liglin)
Subject: Re: matching words starting and ending with defined letters
Message-Id: <db9bdb31.0212151759.d39f709@posting.google.com>

Thanks Ingo and Bernard for your helpful code. I had been trying
before - it was the * that was missing: if (/^[KC].*a$/) { print
"Match ! $_\n" }.

The alternative using the 'and' operator is also instructive. 

Liglin


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

Date: Sun, 15 Dec 2002 19:54:54 GMT
From: Rick Delaney <rick.delaney@rogers.com>
Subject: Re: Odd pack() behavior
Message-Id: <m365tv6os2.fsf@cs839290-a.mtth.phub.net.cable.rogers.com>

"Brian C. Lane" <brian@gonzo.home> writes:

> I must not be the only one who has run into this, as I would expect anyone
> who has been using perl for doing binary data manipulation would have run
> into this.

Anyone using v5.8.
 
> Personally this seems like very dumb behavior on the part of Perl. Code
> should be backwards compatible unless explicitly told to take on some new
> feature.

I believe binmode'ing your filehandle will clear it up but I haven't 
bothered installing 5.8 yet so I haven't tried it.

-- 
Rick Delaney
rick.delaney@rogers.com


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

Date: Sun, 15 Dec 2002 20:08:38 -0000
From: "Brian C. Lane" <brian@gonzo.home>
Subject: Re: Odd pack() behavior
Message-Id: <slrnavpo61.d4v.brian@gonzo.home>

In article <m365tv6os2.fsf@cs839290-a.mtth.phub.net.cable.rogers.com>,
   Rick Delaney wrote:
> "Brian C. Lane" <brian@gonzo.home> writes:
> 
>> I must not be the only one who has run into this, as I would expect anyone
>> who has been using perl for doing binary data manipulation would have run
>> into this.
> 
> Anyone using v5.8.
>  

  5.6.1 (and probably 5.6 as well from the docs on UTF I found) do it as
well.

>> Personally this seems like very dumb behavior on the part of Perl. Code
>> should be backwards compatible unless explicitly told to take on some new
>> feature.
> 
> I believe binmode'ing your filehandle will clear it up but I haven't 
> bothered installing 5.8 yet so I haven't tried it.
> 

  I found a better solution, I rewrote the app in Python <G>

  Brian

-- 
 --[Inside 70.5F]--[Outside 48.8F]--[fozzy 68.9F]--[Drink 64.1F]--
Generated with DigiTemp http://www.digitemp.com


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

Date: Mon, 16 Dec 2002 01:17:36 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Problem in Spacing entries in a File.
Message-Id: <3DFD2973.75E0B94B@acm.org>

Kasp wrote:
> 
> consider this entry in a file:
> "                        10800       ; refresh"
>                          ^^^^^^^^^
> The entry can be someother number like 1 or 10000000 too....but it will be
> spaced as shown above"
> "                        1           ; refresh"
> 
> Now I am supposed to replace this number with another given number....say
> 600.
> I am able to "susbtitute" it, but I dont know how to cope with this spacing
> requirement.
> 
> How can I maintian the spaceing?

john@perl:~ > perl -le'
$string = "                        10800       ; refresh";
print $string;
$string =~ s{(\d+\s+)}{ sprintf "%-*d", length $1, 15 }e;
print $string;
'
                        10800       ; refresh
                        15          ; refresh



John
-- 
use Perl;
program
fulfillment


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

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.  

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


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