[9925] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3518 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 23 17:01:24 1998

Date: Sun, 23 Aug 98 14:00:20 -0700
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, 23 Aug 1998     Volume: 8 Number: 3518

Today's topics:
    Re: COBOL and Perl <charles@hankel.mersinet.co.uk>
    Re: COBOL and Perl (Gary L. Burnore)
    Re: Employment Opps <gnat@frii.com>
        Help with pattern matching... kevin@zippy.tnet.com
    Re: Help with pattern matching... (Craig Berry)
    Re: In which directory 'CGI.pm' file should be copied? (Steve Linberg)
        Outputting to MS Excel file format <jwhite@accesshub.net>
    Re: Perl documentation (Ronald J Kimball)
    Re: Perl documentation (David Hawker)
    Re: Perl documentation (David Hawker)
    Re: Perl documentation (David Hawker)
    Re: Perl documentation (Craig Berry)
    Re: Perl documentation (Gary L. Burnore)
    Re: Perl documentation (David Hawker)
    Re: Perl documentation (Gary L. Burnore)
    Re: perl in Win95 (David Hawker)
    Re: Perlscript: where is documentation (David Hawker)
    Re: Prime numbers [was Re: here's an implementation of  <mgregory@asc.sps.mot.com>
    Re: Prime numbers [was Re: here's an implementation of  <mgregory@asc.sps.mot.com>
    Re: Prime numbers [was Re: here's an implementation of  (Michael J Gebis)
    Re: Size of a JPG file (David Hawker)
    Re: Why dont people read the FAQs (Jeffrey Drumm)
    Re: Why dont people read the FAQs (Gary L. Burnore)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 23 Aug 1998 21:12:36 +0100
From: Charles F Hankel <charles@hankel.mersinet.co.uk>
Subject: Re: COBOL and Perl
Message-Id: <35E077B4.139F5BC1@hankel.mersinet.co.uk>

Thomas Jespersen wrote:
> 
> Charles F Hankel <charles@hankel.mersinet.co.uk> writes:
> 
> > So the myth lives on, does it?
> >
> > The largest number of systems affected by the y2k scenario are
> > relatively modern systems.  The problem is being more assiduously
> 
> Please check if you newsreader got an option to send the same message
> 4 times, and turn it off.

Only sent once, only received once here and once on my other news
server.

-- 
Charles F Hankel   Wirral   UK
 ------------------------------
Ready, Willing and (avail)Able


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

Date: Sun, 23 Aug 1998 20:22:34 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: COBOL and Perl
Message-Id: <35e1795d.324288886@nntpd.databasix.com>

On Sun, 23 Aug 1998 21:12:36 +0100, in article
<35E077B4.139F5BC1@hankel.mersinet.co.uk>, Charles F Hankel
<charles@hankel.mersinet.co.uk> wrote:

>Thomas Jespersen wrote:
>> 
>> Charles F Hankel <charles@hankel.mersinet.co.uk> writes:
>> 
>> > So the myth lives on, does it?
>> >
>> > The largest number of systems affected by the y2k scenario are
>> > relatively modern systems.  The problem is being more assiduously
>> 
>> Please check if you newsreader got an option to send the same message
>> 4 times, and turn it off.
>
>Only sent once, only received once here and once on my other news
>server.

The "culprit" apologized in a group for no. and they do seemed to have
stopped. 

slrn6tvsbv.to9.vengen@middagspynten.vegard.priv is the article but you'll have
to be able to read Norwegian.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: 23 Aug 1998 14:41:44 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Re: Employment Opps
Message-Id: <5q90kfbfcn.fsf@prometheus.frii.com>

billman1121@my-dejanews.com writes:
> eToys is hiring.

Just a reminder that The Perl Journal has a jobs board on its website.
	http://www.tpj.com/tpj/jobs

If you're looking for a job, or want to hire someone, you could do
worse than to post it there.

Cheers;

Nat


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

Date: Sun, 23 Aug 1998 18:31:52 GMT
From: kevin@zippy.tnet.com
Subject: Help with pattern matching...
Message-Id: <6rpn6o$g7i$1@nnrp1.dejanews.com>

Looking for a bit of help...

I've got strings coming at me like:

/usr/archives/muttusr/1998-08/000024: @436{54} changing...
xxxxxxxxxxxxxx^^^^^^^x^^^^^^^x^^^^^^xxx^^^x^^xxx...

The above ^^^ areas are significant to me.  However the beginning of
the line could change where it might look like:

/archives/fruits/red/apples/muttusr/1998-08/000024: @436{54} changing...

Where the path is longer but the significant parts are still there.  The
following format for the significant stuff will always be there:

	list/archive/article: @position{length}

Just the beginning path may increase or decrease depending on where it
is placed.

I've got the following working...

$string = "/usr/archives/muttusr/1998-08/000024: \@436{54} changing the value
of save-hook. From within mutt, I ";

$string =~ /@(.*){/;  $position = $1;

	$position ends up with "436"  which is what I want.

$string =~ /\/(.{6}):/; $article = $1;

	$article ends up with "000024"  which is what I want.

$string =~ /\/(.{4}-.{2})\//; $archive = $1;

	$archive ends up with "1998-08" which is what I want.

$string =~ /\/(.+)\/.{4}-.{2}\//; $list = $1;

	$list ends up with "/usr/archives/muttusr" which is not what
	I want.  I'm looking for   "muttusr"  only.

I've tried all kinds of contortions but I can't figure out how I can
get the name I'm looking for without saying the other parts in front of
it are the same.

I'm sure that this could all be done with one pattern match where the
results would end up in $1 $2 $3 $4 but I'm not up to that point yet...

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 23 Aug 1998 19:07:39 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Help with pattern matching...
Message-Id: <6rpp9r$rse$2@marina.cinenet.net>

kevin@zippy.tnet.com wrote:
: I've got strings coming at me like:
: 
: /usr/archives/muttusr/1998-08/000024: @436{54} changing...
: xxxxxxxxxxxxxx^^^^^^^x^^^^^^^x^^^^^^xxx^^^x^^xxx...
: 
: The above ^^^ areas are significant to me.  However the beginning of
: the line could change where it might look like:
: 
: /archives/fruits/red/apples/muttusr/1998-08/000024: @436{54} changing...
: 
: Where the path is longer but the significant parts are still there.  The
: following format for the significant stuff will always be there:
: 
: 	list/archive/article: @position{length}

Is it guaranteed that the part from article onward won't have / characters
in it?  If so, here's one way (assuming string to match against is in $_):

  my ($list, $archive, $article, $position, $length) =
       m!/([^/]*)/(\d{4}-\d{2})/(\d+): \@(\d+){(\d+)}[^/]*$!;

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Sun, 23 Aug 1998 16:58:39 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: In which directory 'CGI.pm' file should be copied?
Message-Id: <linberg-2308981658390001@projdirc.literacy.upenn.edu>

In article <35DE19D7.FB2@nmtec.com>, sucheta@nmtec.com wrote:

> My question is, in which directory CGI.pm file should be copied? I have
> Perl 5.005 version. So there are 'lib' & 'bin' directories under
> C:\Perl\5.005 directory.

lib.
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: Sun, 23 Aug 1998 14:17:07 -0400
From: jonathan white <jwhite@accesshub.net>
Subject: Outputting to MS Excel file format
Message-Id: <35E05CA2.3529D7D@accesshub.net>

I'm looking to converting some of my reporting to Perl on UNIX. Many of
my reports need to go out in Excel format. Are there any Perl libraries
to write to MS Excel file format? Has anybody had good luck with them?

TIA
jonathan


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

Date: Sun, 23 Aug 1998 13:12:34 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl documentation
Message-Id: <1de7tq5.gf386f10erjpqN@bay1-277.quincy.ziplink.net>

David Hawker <dhawker@removethis.bigfoot.com> wrote:

> On Sat, 22 Aug 1998 13:17:11 -0400, rjk@coos.dartmouth.edu (Ronald J
> Kimball) felt the need to post:
> 
> >David Hawker <dhawker@removethis.bigfoot.com> wrote:
> >
> >> 1. Why is for/foreach/etc never included in the perl docs?
> >
> >Remember, for/foreach/etc aren't functions, so if you're looking in
> >perlfunc, you won't find them.  Try perlsyn (for syntax) instead.
> 
> Ah, thanks. Thanks a lot!
> 
> But is there no special variable that is used to store the iteration
> number?

Okay, now I'm beginning to suspect that you're being purposefully
obtuse.  :-)
Not only do you now have the documentation on foreach at your hands, but
we have answered that exact question in this nesgroup at least twice in
the past month.
Short answer:  No, there is not.
Long answer: Refer to www.dejanews.com.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sun, 23 Aug 1998 17:52:04 GMT
From: dhawker@bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35e654eb.3198464@news.cableol.net>

On Sun, 23 Aug 1998 18:32:29 +0200, "Alan J. Flavell"
<flavell@mail.cern.ch> felt the need to post:

>On Sun, 23 Aug 1998, David Hawker wrote:
>
>> >  perldoc -f system
>> 
>> What's that supposed to do? Tell you how to invoke system calls? But it has
>> no information on what those system calls do.
>
>You'd expect your car handbook to include the radio programme schedules?

Exactly - what I'm looking for IS those programme schedules, ie a big
2-week magazine instead of snippets of individual programmes here and there
:)

--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Sun, 23 Aug 1998 17:52:06 GMT
From: dhawker@bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35e75571.3332187@news.cableol.net>

On 23 Aug 1998 16:23:55 GMT, Tom Christiansen <tchrist@mox.perl.com> felt
the need to post:

> [courtesy cc of this posting sent to cited author via email]
>
>:Well if you can say you've had no spam from doing this, I will take your
>:advice.
>
>I don't believe I receive more than three or four pieces of spam that
>make it through the filters in a week, and sometimes not that many.
>The new sendmail spam inhibition mechanisms take care of something like
>90% or more of it, and the rest is zapped through simple filtering rules.

Or instead you can use a fakebouncer - make the spammers think your address
is invalid. I have made the only one I know exists.


--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Sun, 23 Aug 1998 17:52:08 GMT
From: dhawker@bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35e8563b.3534741@news.cableol.net>

On Sun, 23 Aug 1998 16:50:35 GMT, gburnore@databasix.com (Gary L. Burnore)
felt the need to post:

>On 23 Aug 1998 16:23:55 GMT, in article <6rpfmr$nsj$1@csnews.cs.colorado.edu>,
>Tom Christiansen <tchrist@mox.perl.com> wrote:
>
>> [courtesy cc of this posting sent to cited author via email]
>>
>>:Well if you can say you've had no spam from doing this, I will take your
>>:advice.
>>
>>I don't believe I receive more than three or four pieces of spam that
>>make it through the filters in a week, and sometimes not that many.
>>The new sendmail spam inhibition mechanisms take care of something like
>>90% or more of it, and the rest is zapped through simple filtering rules.
>
>Which means that 100% of what you filter STILL hits your server to be
>processed.  While those that munge get NONE.   (Note I don't munge but I don't
>disallow databasix.com users from doing so>

What the hell is "munging"? :-)

I'm glad you're using proper sig markers! It's amazing, the majority of
people I email don't have them.

--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: 23 Aug 1998 18:28:42 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl documentation
Message-Id: <6rpn0q$rse$1@marina.cinenet.net>

David Hawker (dhawker@removethis.bigfoot.com) wrote:
: >David Hawker (dhawker@removethis.bigfoot.com) wrote:
: >: 1. Why is for/foreach/etc never included in the perl docs?
: >
: >/usr2/people/cberry > perldoc perlsyn | grep foreach            
: >         LABEL foreach VAR (LIST) BLOCK                         
[snipped: Many more matching lines]
: >     subroutine or a foreach loop.  It also can't be used to go 
: >
: >And that's just perlsyn; it may well pop up elsewhere.
: 
: There was no big sign saying 'you can find out about foreach in perlsyn' -

I'm sorry, and I've tried to find a better way to phrase this, but this
isn't nursery school.  Perl is a complex, powerful, potentially dangerous
*tool*, and it well within the bounds of reasonable expectation that those
desiring to use this tool will first familiarize themselves with the
documentations on how to use it.  I knew to look in perlsyn because I read
(or at least skimmed) the entire perl online doc shortly after becoming
interested in the language, and thereby built up a mental map of what's
where, a map which I have been reinforcing and extending through nearly
daily use of the perl doc ever since.  There's no magic road to
familiarity with perl and its doc; you need to study it and use it.

: the obvious place that struck me was perlfunc, as these (for/foreach) are
: words and can be misinterpreted as functions by people who aren't as expert
: on perl as those who make it or write the manuals.

I'm sorry, but that's silly.  CGI is a 'word' (at least as much as foreach
is), yet I wouldn't expect you'd look for that in perlfunc.  And let me
assure you that I have had nothing to do with either making or documenting
perl.  I've simply studied and used it. 

: I regard syntax as the way perl is written - not the function of the words
: "for/foreach"

So you don't know the difference between statements and functions?  I lay
this problem in your lap, not that of the Perl documenters.  For that
matter, if both functions and statements are covered by perlfunc, what's
left to be handled in perlsyn?  What is there to say about 'the way perl
is written' beyond talking about statements (including declarations, of
course)?

: >: 2. I'm after a complete documentation in one package. One thing that annoys
: >: me is when the perl docs just say 'does the same thing as the system call'
: >: and i have no idea what the system call does.
: >
: >  perldoc -f system
: 
: What's that supposed to do? Tell you how to invoke system calls? But it has
: no information on what those system calls do.

As I already posted in a followup, my bad.  I misunderstood the level of
doc you were after, here.

: The MS-DOS modifier "|more" doesn't seem to work on my system and so most
: of the output scrolled up too fast to read. :-)

That's not a modifier; that's a pipe to a separate program, 'more'.  And
if it doesn't work, you have *serious* problems with your system.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Sun, 23 Aug 1998 18:50:51 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Perl documentation
Message-Id: <35e5643c.318879364@nntpd.databasix.com>

On Sun, 23 Aug 1998 17:52:06 GMT, in article
<35e75571.3332187@news.cableol.net>, dhawker@bigfoot.com (David Hawker) wrote:

>On 23 Aug 1998 16:23:55 GMT, Tom Christiansen <tchrist@mox.perl.com> felt
>the need to post:
>
>> [courtesy cc of this posting sent to cited author via email]
>>
>>:Well if you can say you've had no spam from doing this, I will take your
>>:advice.
>>
>>I don't believe I receive more than three or four pieces of spam that
>>make it through the filters in a week, and sometimes not that many.
>>The new sendmail spam inhibition mechanisms take care of something like
>>90% or more of it, and the rest is zapped through simple filtering rules.
>
>Or instead you can use a fakebouncer - make the spammers think your address
>is invalid. I have made the only one I know exists.

Yawn.  Old stuff. Works sometimes, others not. Easy to do in sendmail.

Still, the article needs to get to your server for the process to work. By
putting an invalid address in the from line, the email never GETS to your
system.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Sun, 23 Aug 1998 19:57:28 GMT
From: dhawker@bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35e772b2.5249911@news.cableol.net>

On Sun, 23 Aug 1998 18:50:51 GMT, gburnore@databasix.com (Gary L. Burnore)
felt the need to post:

>On Sun, 23 Aug 1998 17:52:06 GMT, in article
><35e75571.3332187@news.cableol.net>, dhawker@bigfoot.com (David Hawker) wrote:
>
>>On 23 Aug 1998 16:23:55 GMT, Tom Christiansen <tchrist@mox.perl.com> felt
>>the need to post:
>>
>>> [courtesy cc of this posting sent to cited author via email]
>>>
>>>:Well if you can say you've had no spam from doing this, I will take your
>>>:advice.
>>>
>>>I don't believe I receive more than three or four pieces of spam that
>>>make it through the filters in a week, and sometimes not that many.
>>>The new sendmail spam inhibition mechanisms take care of something like
>>>90% or more of it, and the rest is zapped through simple filtering rules.
>>
>>Or instead you can use a fakebouncer - make the spammers think your address
>>is invalid. I have made the only one I know exists.
>
>Yawn.  Old stuff. Works sometimes, others not. Easy to do in sendmail.

It really relies on having a working return address in the spam - anyone
ever had one of those???

>Still, the article needs to get to your server for the process to work. By
>putting an invalid address in the from line, the email never GETS to your
>system.

But these days spamming programs can be clever and scan for stuff like
"removethis" or "NOSPAM"


--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Sun, 23 Aug 1998 20:17:02 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Perl documentation
Message-Id: <35e07826.323978359@nntpd.databasix.com>

On Sun, 23 Aug 1998 19:57:28 GMT, in article
<35e772b2.5249911@news.cableol.net>, dhawker@bigfoot.com (David Hawker) wrote:

>On Sun, 23 Aug 1998 18:50:51 GMT, gburnore@databasix.com (Gary L. Burnore)
>felt the need to post:
>
>>On Sun, 23 Aug 1998 17:52:06 GMT, in article
>><35e75571.3332187@news.cableol.net>, dhawker@bigfoot.com (David Hawker) wrote:
>>
>>>On 23 Aug 1998 16:23:55 GMT, Tom Christiansen <tchrist@mox.perl.com> felt
>>>the need to post:
>>>
>>>> [courtesy cc of this posting sent to cited author via email]
>>>>
>>>>:Well if you can say you've had no spam from doing this, I will take your
>>>>:advice.
>>>>
>>>>I don't believe I receive more than three or four pieces of spam that
>>>>make it through the filters in a week, and sometimes not that many.
>>>>The new sendmail spam inhibition mechanisms take care of something like
>>>>90% or more of it, and the rest is zapped through simple filtering rules.
>>>
>>>Or instead you can use a fakebouncer - make the spammers think your address
>>>is invalid. I have made the only one I know exists.
>>
>>Yawn.  Old stuff. Works sometimes, others not. Easy to do in sendmail.
>
>It really relies on having a working return address in the spam - anyone
>ever had one of those???

No, sorry, but it doesn't.  It relies on your server's ability to determine
where IT received the mail from.  It's easy to set up a score filter to
determine the likelyhood that it's SPAM and drop it either in /dev/null or in
a file for later action or automatically forward a canned complaint to the
site that allowed it to be sent to you.



>>Still, the article needs to get to your server for the process to work. By
>>putting an invalid address in the from line, the email never GETS to your
>>system.
>
>But these days spamming programs can be clever and scan for stuff like
>"removethis" or "NOSPAM"

But not smart enough for other sayings or misspelled words or
_NON_EXISTANT_DOMAINS_.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Sun, 23 Aug 1998 17:52:02 GMT
From: dhawker@bigfoot.com (David Hawker)
Subject: Re: perl in Win95
Message-Id: <35e25097.2090454@news.cableol.net>

On Mon, 24 Aug 1998 00:58:09 +0800, "James" <jameshsi@email.gcn.net.tw>
felt the need to post:

>Hi!
>I wonder if I can execute perl script in my Win95 PC for testing perpouse,
>then upload it to UNIX server when I tested.
>I want to call the script from my local PC with IE 4.0 , How can I do that ?

Get a MS-DOS perl port. Then get OmniHTTPD from www.omnicron.ab.ca IIRC.
OmniHTTPD is a little webserver for windows. You should use 'localhost' or
127.0.0.1 to access your own computer.

Sockets also work using just the perl port - get perl5.004_02 at least. But
obviously things like forking and file locking can't be tested on your
computer.

--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Sun, 23 Aug 1998 19:12:49 GMT
From: dhawker@bigfoot.com (David Hawker)
Subject: Re: Perlscript: where is documentation
Message-Id: <35e5698d.2908771@news.cableol.net>

Try
http://language.perl.com/info/documentation.html

On Sun, 23 Aug 1998 12:24:41 +0200, "Mosl Roland" <founder@pege.org> felt
the need to post:

>I just develop a program in Perlscript.
>
>Biggest problem: I do not find a good documentation
>about Perlscript.
>
>So most is experimenting a trail and error
>to find out how the syntax works.
>
>Any resources hidden from search engines
>from search engine disabled web page makers ?
>
>Mosl Roland
>http://pege.org/ clear targets for a confused civilization
>http://salzburgs.com/ (did not find a slogan :-)
>


--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: 23 Aug 1998 14:40:17 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: Prime numbers [was Re: here's an implementation of diff in perl]
Message-Id: <r8yasguvuu.fsf@asc.sps.mot.com>

Daniel Grisinger <dgris@rand.dimensional.com> writes:

> [posted to comp.lang.perl.misc and mailed to the cited author]
> 
> In article <r8zpcyvrju.fsf_-_@asc.sps.mot.com>
> Martin Gregory <mgregory@asc.sps.mot.com> wrote:
> >
> >abigail@fnx.com (Abigail) writes:
> >> -- 
> >> perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
> >
> >Is this some well known trick for detecing prime numbers?
> 
> Yup, division, the best known trick for detecting prime
> numbers.

Que?

1) I don't see any division going on there.
2) Division seems to be a poor trick for detecting prime numbers: you
   have to divide the number in question by evey number less than it.
   Slow. This code does not do that: it has a one-shot hit to tell you
   whether the number is prime.

> >How does it work?
> 
> The first time through it matches the regex against
> `1', fails, and prints.  Second time it matches
> against `11', fails, and prints.  Same thing for
> the third time except that now it matches against `111'.
> The fourth time the regex succeeds so it doesn't print.

Que?

Martin.


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

Date: 23 Aug 1998 14:42:23 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: Prime numbers [was Re: here's an implementation of diff in perl]
Message-Id: <r8ww80uvrc.fsf@asc.sps.mot.com>

hex@voicenet.com (Matt Knecht) writes:
> Sean McAfee <mcafee@pacman.rs.itd.umich.edu> wrote:
> >It has nothing to do with the number base used.
> >
> >Let $x and $y be strings such that $x = $c x $n and $y = $c x $m, for any
> >one-character string $c ('1' in our case) and some integers $n and $m.
> >Then
> >
> >$x =~ /^($y)\1+$/
> >
> >will be a true expression iff $x consists of an integral number >= 2 of
> >repetitions of $y (that is, if $n is evenly divisible by $m, $n/$m being at
> >least 2).  Clear?
[...]
> And length $1 returns the value of what it was divisible by.  For
> example: 
> 
> $nine = '111111111';
> $nine =~ /^(11+)\1+$/;
> print length $nine, ' is divisible by ', length $1, "\n" if $1;
> 
> Nifty!
> 
> >Neat, isn't it?  I think this has to be one of the niftiest pieces of Perl
> >code I've ever seen.
> 
> I'll have to agree here.  And add a much less obfuscated translation.
> 
> #!/usr/local/bin/perl -w
> 
> OUTER: for $number (1 .. 10) {
>     INNER: for ($divisor = $number - 1; $divisor > 1; $divisor--) {
>         next OUTER unless $number % $divisor;
>     }
>     print "prime: $number\n";
> }
> 
> Hard to beleive that accomplishes the same thing!

I don't think that you can say that it does, at least at one level.

Specifically, it has to do (worst case) nearly N operations to
determine whether N is prime, while the original only does one!

Martin.


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

Date: 23 Aug 1998 20:30:02 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Prime numbers [was Re: here's an implementation of diff in perl]
Message-Id: <6rpu4a$41v@mozo.cc.purdue.edu>

Martin Gregory <mgregory@asc.sps.mot.com> writes:
}Daniel Grisinger <dgris@rand.dimensional.com> writes:
}> In article <r8zpcyvrju.fsf_-_@asc.sps.mot.com>
}> Martin Gregory <mgregory@asc.sps.mot.com> wrote:
}> >abigail@fnx.com (Abigail) writes:
}> >> perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
}> >Is this some well known trick for detecing prime numbers?
}> Yup, division, the best known trick for detecting prime
}> numbers.

}1) I don't see any division going on there.

That doesn't mean it's not happening.  

}2) Division seems to be a poor trick for detecting prime numbers: you
}   have to divide the number in question by evey number less than it.
}   Slow. This code does not do that: it has a one-shot hit to tell you
}   whether the number is prime.

This code actually DOES do that.  It's just very clever about how it
phrases it.  It's not efficient.  On the other hand, it's dammed cool.



-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Sun, 23 Aug 1998 18:47:20 GMT
From: dhawker@bigfoot.com (David Hawker)
Subject: Re: Size of a JPG file
Message-Id: <35e2636d.1340938@news.cableol.net>

Is it a case of getting info on the jpg file format?

On Sun, 23 Aug 1998 18:26:36 +0200, "Mosl Roland" <founder@pege.org> felt
the need to post:

>I would need for use in a Perlscript something like
>
>
>sub get_jpg_size
>(
>  my ( $filename ) = @_;
>
>
>
>  return ( $width, $height )
>}
>
>I have this already for gif, but can not find
>out how to get the file of a jpg.
>
>Mosl Roland
>http://pege.org/ clear targets for a confused civilization
>http://salzburgs.com/ (did not find a slogan :-)
>


--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Sun, 23 Aug 1998 17:17:58 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Why dont people read the FAQs
Message-Id: <35e14c7b.95017710@news.mmc.org>

On Sun, 23 Aug 1998 05:41:15 GMT, gburnore@databasix.com (Gary L. Burnore)
wrote:

>On 23 Aug 1998 02:05:32 GMT, in article <6rntdc$8of$1@srv38s4u.cas.org>,
>lvirden@cas.org wrote:
>
>>
>>I sure wish folk WOULD wait a few weeks instead of sending 7, 8 or more
>>copies of the same posting to this newsgroup.
>
>Can you not see that the posts are being duplicated?  Do you know how to read
>headers?  If not, you should learn. If so, stfu.

Enlighten us. In what way does the tone this response improve upon those of
Abigail's that you complained about so bitterly? Or are you somehow exempt
from the standards you attempt to impose on others?

If you can't be bothered to practice what you preach, how can you possibly
expect anyone to take you seriously?

-- 
                           Jeffrey R. Drumm, Systems Integration Specialist
                                  Maine Medical Center Information Services
                                     420 Cumberland Ave, Portland, ME 04101
                                                        drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me


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

Date: Sun, 23 Aug 1998 17:51:57 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Why dont people read the FAQs
Message-Id: <35e05603.315238010@nntpd.databasix.com>

On Sun, 23 Aug 1998 17:17:58 GMT, in article <35e14c7b.95017710@news.mmc.org>,
drummj@mail.mmc.org (Jeffrey Drumm) wrote:

>On Sun, 23 Aug 1998 05:41:15 GMT, gburnore@databasix.com (Gary L. Burnore)
>wrote:
>
>>On 23 Aug 1998 02:05:32 GMT, in article <6rntdc$8of$1@srv38s4u.cas.org>,
>>lvirden@cas.org wrote:
>>
>>>
>>>I sure wish folk WOULD wait a few weeks instead of sending 7, 8 or more
>>>copies of the same posting to this newsgroup.
>>
>>Can you not see that the posts are being duplicated?  Do you know how to read
>>headers?  If not, you should learn. If so, stfu.
>
>Enlighten us. In what way does the tone this response improve upon those of
>Abigail's that you complained about so bitterly? Or are you somehow exempt
>from the standards you attempt to impose on others?
>


The poster to which Abigail responded to so rudely only asked a question.
Lvirden on the otherhand followed up to my posts with a smartassed tone
suggesting that I was at fault for posting 7 or 8 times.   I responded in
kind. If someone abigail had been the victim of the post above I'd have not
only EXPECTED her to reply in kind, I'd have supported it.

>If you can't be bothered to practice what you preach, how can you possibly
>expect anyone to take you seriously?

If you can't be bothered to at least try to understand what you read, why
should I care.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3518
**************************************

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