[8843] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2460 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 30 00:05:32 1998

Date: Wed, 29 Apr 98 21:00:29 -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           Wed, 29 Apr 1998     Volume: 8 Number: 2460

Today's topics:
    Re: 1701 days hath September (was: Re: rename funciton) <ljz@asfast.com>
    Re: 1701 days hath September (was: Re: rename funciton) (Abigail)
    Re: 1701 days hath September (was: Re: rename funciton) <sowmaster@juicepigs.com>
    Re: 1701 days hath September (was: Re: rename funciton) <lloyd@zusman.net>
        4 digit year and localtime <kevscott@juno.com>
        4 digit year and localtime <kevscott@juno.com>
    Re: 4 digit year and localtime <dont@want.spam>
    Re: 4 digit year and localtime (John Stanley)
    Re: 4 digit year and localtime <sowmaster@juicepigs.com>
    Re: 4 digit year and localtime <sowmaster@juicepigs.com>
        Bible References converted into Text <nospam@aol.com>>really Gibbs at Cheerful.com>
    Re: Bible References converted into Text <nospam@aol.com>>really Gibbs at Cheerful.com>
    Re: Bible References converted into Text <nospam@aol.com>>really Gibbs at Cheerful.com>
    Re: Bible References converted into Text <nospam@aol.com>>really Gibbs at Cheerful.com>
        Complete list of all elements of EventData <dont@want.spam>
    Re: Detecting Uncaught Exceptions at Compile Time <tchrist@mox.perl.com>
    Re: formatting output <bornes@uqam.ca>
        GetOpts::Std and use strict <mikemort@cadence.com>
    Re: How to find the number of matches in a string (Abigail)
    Re: instruction if-elsif-elsif insert on a for loop <jstern@world.northgrum.com>
    Re: Just a thought... <grinch@whoville.com>
    Re: Named Pipes (FIFOs) ... (Jonathan Stowe)
    Re: Perl and OLE/COM on UNIX (Brian Wheeler)
    Re: perl and Year 2000 <rootbeer@teleport.com>
    Re: perl and Year 2000 <sabigail@newbridge.com>
    Re: perl and Year 2000 <tchrist@mox.perl.com>
    Re: perl and Year 2000 (Andre L.)
    Re: perl and Year 2000 (I R A Aggie)
    Re: Perl Editor?? <grinch@whoville.com>
    Re: print($b=1,$b=2) (Abigail)
        Simple Question regarding dates <mivl@inquo.net>
        Toggling reverse on and off on in a for loop <lach@lach.net>
    Re: Toggling reverse on and off on in a for loop <brianm@kodak.com>
    Re: You people want Perl to be popular? smitty7777@hotmail.com
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 29 Apr 1998 21:59:17 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: 1701 days hath September (was: Re: rename funciton)
Message-Id: <ltd8e0ax3e.fsf@asfast.com>

abigail@fnx.com (Abigail) writes:

> Bob Trieger (sowmaster@juicepigs.com) wrote on MDCCII September MCMXCIII
> in <URL: news:354740A4.573B@juicepigs.com>:
> ++ Calle Dybedahl wrote:
> ++ > 
> ++ > Lloyd Zusman <ljz@asfast.com> writes:
> ++ > 
> ++ > [ ... etc. etc. etc. ... ]
> 
> Blah. 
> 
> What a bunch of whining lusers in this group.

Complaining about "newbies" isn't whining?

It'll be better in c.l.p.moderated.

> Goodbye.

Could it be that you can dish it out, but you can't take it?

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: 30 Apr 1998 01:11:10 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: 1701 days hath September (was: Re: rename funciton)
Message-Id: <6i8j3e$af4$3@client2.news.psi.net>

Bob Trieger (sowmaster@juicepigs.com) wrote on MDCCII September MCMXCIII
in <URL: news:354740A4.573B@juicepigs.com>:
++ Calle Dybedahl wrote:
++ > 
++ > Lloyd Zusman <ljz@asfast.com> writes:
++ > 
++ > > But now that we've been enlightened, I'm disappointed to find that
++ > > it's just more gratuitous anti-"newbie" snobbery.
++ > 
++ > "Gratuitous"? If you'd been there you'd know the difference, boy.
++ > Abigail is absolutely right.
++ 
++ 
++ I have been on the net and contributing to USENET for over 10 years and
++ yes it has changed but who's to say whether it is for the better or the
++ worse?  The September date really makes no sense when talking about AOL.
++ Anyone that has been around long enough knows that newbies are at their
++ worst right after Christmas when a lot of clueless people get a computer
++ as a present.
++ 
++ Change happens and all you can do is enjoy it. If it weren't for change,
++ Abigail would be raising 18 children and cleaning the outhouse while her
++ husband was out hunting for dinner. And Australia would still be a
++ British penal colony.


Blah. 

What a bunch of whining lusers in this group.

Goodbye.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


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

Date: Wed, 29 Apr 1998 23:19:50 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: 1701 days hath September (was: Re: rename funciton)
Message-Id: <3547EDD6.2BBE@juicepigs.com>

John Stanley wrote:
> 
> In article <6i7k6s$fbo$1@csnews.cs.colorado.edu>,
> Tom Christiansen  <tchrist@mox.perl.com> wrote:
> > [courtesy cc of this posting sent to cited author via email]
> >
> >In comp.lang.perl.misc,
> >    Bob Trieger <sowmaster@juicepigs.com> writes:
> >:Change happens and all you can do is enjoy it.
> >
> >Tell that to the person getting raped.
> 
> Let's see. Bob was talking about newsgroup changes. Tom is talking
> about rape. Hmmm..... No, I don't think even the wildest stretch of
> imagination can justify that comparison.

The comparison is a simple one and I'm surprised you missed it.
Everything Tom mentioned are crimes committed daily by AOL users.
 
> Will the same people who are contributing to this topic be the same
> ones who vote yes for a moderated group, if it is ever brought to a
> vote, because they don't like the noise in the current group?

Moderation = censorship in my eye and all censorship is evil. c.l.p.m is
a community and we don't need some type of large government telling us
what is ok to post and what is not. We can all do that ourselves. For
instance, where would this thread be on a moderated group?

-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: 29 Apr 1998 18:15:42 -0400
From: Lloyd Zusman <lloyd@zusman.net>
Subject: Re: 1701 days hath September (was: Re: rename funciton)
Message-Id: <ltemyguve9.fsf@zusman.net>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     Bob Trieger <sowmaster@juicepigs.com> writes:
> :Change happens and all you can do is enjoy it. 
> 
> Tell that to the person getting raped.
> 
> Tell that to the official being led out to the guillotine,
> or having his hands cut off.
> 
> Tell that to the man suffering in agony due to his company's 
> horrid business practices with hazardous materials.
> 
> Tell that to the mother whose kids can buy bombs and hardcore
> at the five and dime.
> 
> Some change is stupid and destructive.  Cultural relativism
> is fallacious.

Hmmm ... are you only making a global comment about general change in
society, or are you also referring this back to the more specific
point which was made earlier about the recent influx of inexperienced
users into usenet?  If you're referring to the latter, I wonder if you
are in any way asserting that the increase of new Perl users coming to
c.l.p.misc over the past few years and asking FAQ's is as horrible and
heinous as a person getting raped, or someone suffering from the
effects of hazardous materials, or kids buying bombs and hardcore?  If
this belief is shared by others here on c.l.p.misc, that goes a long
way towards explaining the attitude that many of the regulars seem to
have towards "newbies".

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: Wed, 29 Apr 1998 21:30:05 -0500
From: kevin scott <kevscott@juno.com>
Subject: 4 digit year and localtime
Message-Id: <3547E22D.FC74CD61@juno.com>

Is there a way to get perl to return a 4 digit year from the operating
system?

The only solution I know of is to parse the output of an external
programe.


Thank You,
    Kevin Scott

---=-=-=-=-=-=-=-=-=-=-=-=-=---
WEB: www.cyberramp.net/~kevscott
E mail: kevin.scott@eds.com
           kevscott@juno.com
---=-=-=-=-=-=-=-=-=-=-=-=-=---




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

Date: Wed, 29 Apr 1998 21:31:54 -0500
From: kevin scott <kevscott@juno.com>
Subject: 4 digit year and localtime
Message-Id: <3547E29A.B5DB80C4@jeds.com>

Is there a way to get perl to return a 4 digit year from the operating
system?

The only solution I know of is to parse the output of an external
program such as the UNIX program date..


Thank You,
    Kevin Scott

---=-=-=-=-=-=-=-=-=-=-=-=-=---
WEB: www.cyberramp.net/~kevscott
E mail: kevin.scott@eds.com
           kevscott@juno.com
---=-=-=-=-=-=-=-=-=-=-=-=-=---




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

Date: Wed, 29 Apr 1998 21:36:49 -0500
From: "Charles Kerekes" <dont@want.spam>
Subject: Re: 4 digit year and localtime
Message-Id: <6i8oe6$8dc$1@usenet11.supernews.com>

The two lines of code will do that for you. In Perl the year given by local
time is NOT the last two digits but the number of years since year 1900. A
simple addition makes it a four digit year.

   # Get current date and convert year to 4 digits
   ($sec,$min,$hour,$mday,$mon,$year,$sday,$yday,$isdst) = localtime(time);
   $year += 1900;

--
| Please also copy my e-mail account.
|
| Charles Kerekes
| ======================================
| SPAM PROOF - Don't Reply To This Posting Directly.
| Please send replies to CharlesKerekes@iName.com
| ======================================

kevin scott wrote in message <3547E22D.FC74CD61@juno.com>...
>Is there a way to get perl to return a 4 digit year from the operating
>system?
>
>The only solution I know of is to parse the output of an external
>programe.
>
>
>Thank You,
>    Kevin Scott
>
>---=-=-=-=-=-=-=-=-=-=-=-=-=---
>WEB: www.cyberramp.net/~kevscott
>E mail: kevin.scott@eds.com
>           kevscott@juno.com
>---=-=-=-=-=-=-=-=-=-=-=-=-=---
>
>




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

Date: 30 Apr 1998 03:12:58 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: 4 digit year and localtime
Message-Id: <6i8q7q$9of$1@news.NERO.NET>

In article <3547E29A.B5DB80C4@jeds.com>,
kevin scott  <kevscott@juno.com> wrote:
>Is there a way to get perl to return a 4 digit year from the operating
>system?

SInce you asked twice, I'll answer you. 

Set your system clock to the year 2900. Or set it to the year 3898 and
localtime will return the right answer directly.



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

Date: Wed, 29 Apr 1998 23:27:10 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: kevscott@juno.com
Subject: Re: 4 digit year and localtime
Message-Id: <3547EF8D.64F9@juicepigs.com>

[posted & mailed]

kevin scott wrote:
> 
> Is there a way to get perl to return a 4 digit year from the operating
> system?
> 
> The only solution I know of is to parse the output of an external
> programe.

This is how I've been doing it.

$foo = localtime();
$year = (split /\s+/,$foo)[4];

-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: Wed, 29 Apr 1998 23:41:24 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: 4 digit year and localtime
Message-Id: <3547F2E4.1BF4@juicepigs.com>

I wrote:

> This is how I've been doing it.
> 
> $foo = localtime();
> $year = (split /\s+/,$foo)[4];

or even shorter:

$year = (split /\s+/,localtime())[4];

-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: Wed, 29 Apr 1998 17:03:28 -0400
From: "Arthur Gibbs" <nospam@aol.com>>really Gibbs at Cheerful.com>
Subject: Bible References converted into Text
Message-Id: <35479759.0@news1.ibm.net>

Anyone know of a perl program that easily translates Bible references into
texts from a flat file text database?

1 John 3:16-20,22 into the Bible text itself?
or 1 John 3:16-17;4:1-2
or 1 John 3:16,19,20

Thanks!!!

E-mail:

Gibbsa
[--@--]
andrews.edu




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

Date: Wed, 29 Apr 1998 23:31:41 -0400
From: "Arthur Gibbs" <nospam@aol.com>>really Gibbs at Cheerful.com>
Subject: Re: Bible References converted into Text
Message-Id: <3547f202.0@news1.ibm.net>

I think the search program I already have is a little more exact than what
you gave.  But thanks!  I have the problem of converting the references.  1
John 3:16-18,20 means 16 through 18 and then 20 by itself.  1 John
3:16-17;4:1-2 means 16 through 17 and then change to chapter 4 and get
verses 1 through 2.  And so on.

I'm using the program to insert texts in graded Bible studies as it parses
the html and sends it back.  I already have a search program that can do
simply 1 John 3:16-18 but nothing else.  I just wanted to make sure I was
the first to tackle this problem before I did.

Thanks

Arthur :)

Current Flat File Database format:
---------------------------------

1:1 That which was from the beginning, which we have heard, which we have
seen with our eyes, which we have looked upon, and our hands have handled,
of the Word of life;
1:2 (For the life was manifested, and we have seen it, and bear witness, and
shew unto you that eternal life, which was with the Father, and was
manifested unto us;)
1:3 That which we have seen and heard declare we unto you, that ye also may
have fellowship with us: and truly our fellowship is with the Father, and
with his Son Jesus Christ.

Current Search Program:
---------------------------------
#!/usr/bin/perl

require "cgi-lib.pl";

$DATA_DIRECTORY = ".";

MAIN:
{
  print "Content-type: text/html\n\n";

# Read in all the variables set by the form

 if (&ReadParse(*input))
 {
  $book = $input{'book'};
  $chapter = $input{'chapter'};
  $start_verse = $input{'startverse'};
  $end_verse = $input{'endverse'};

  open (FILE, $DATA_DIRECTORY."/".$book);
  @text = <FILE>;
  close(FILE);

  print "<H2 align=center>$text[0]</H1>\n";
  print "<H3 align=center>$chapter:$start_verse-$end_verse</H3>";

  $found_start = 0;
  $finished = 0;

  $verse = $start_verse;
  foreach (@text)
  {
   if ($verse > $end_verse)
   {
    last;
   }

   if ($_ =~ /(\A$chapter:$verse | $chapter:$verse )/i)
   {
    print "$_<P>\n";

    while ($verse < $end_verse && ($_ =~ /$chapter:$verse /i))
    {
     $verse++;
    }
   }
  }
	}
}
Sharon Hopkins wrote in message ...
>[posted & mailed]
>
>In article <35479759.0@news1.ibm.net>, Arthur Gibbs <nospam@aol.com> wrote:
>>Anyone know of a perl program that easily translates Bible references into
>>texts from a flat file text database?
>>
>>1 John 3:16-20,22 into the Bible text itself?
>>or 1 John 3:16-17;4:1-2
>>or 1 John 3:16,19,20
>>
>>Thanks!!!
>>
>>E-mail:
>>
>>Gibbsa
>>[--@--]
>>andrews.edu
>
>I have a copy of a very simple little bible-lookup program Larry wrote
>quite a while back called "concord", which does lookups on a flat-text
>KJV translation.  The bible setup is that it's divided into books,
>with filenames like 01.genesis, 02.exodus, etc.  Each verse is on its
>own line, e.g.:
>
>ranma:sharon <117> head 01.genesis
>GEN 1:1  In the beginning God created the heaven and the earth.
>
>GEN 1:2  And the earth was without form, and void; and darkness was upon
the face of the deep. And the Spirit of God moved upon the face of the
waters.
>
>etc.
>
>You call concord with the name of the book as an arg (or other indicators,
>like "johanine" or "gospel", or "pent", or "nt" or "ot"), and give
>it a pattern, which could either be a word you're looking for in
>the text or a reference number.
>
>E.g. 'concord -john 3:16' returns:
>
>JOH 3:16  For God so loved the world, that he gave his only begotten Son,
>    that whosoever believeth in him should not perish, but have everlasting
>    life.
>JOH 13:16  Verily, verily, I say unto you, The servant is not greater than
>    his lord; neither he that is sent greater than he that sent him.
>JO1 3:16  Hereby perceive we the love of God, because he laid down his life
>    for us: and we ought to lay down our lives for the brethren.
>
>Which at least includes what you want. :-)
>
>I can tar the bible bundle up for you if you like and email or ftp
>it to you (I'm told it's PD); the script is included below.
>
>On the other hand, if what you really want is just a quick way to look
>up verses, check out The WWW Bible Gateway:
>
>http://bible.gospelcom.net/bible?
>
>which is quite nice and has half-a-dozen translations available.
>
>--Sharon Hopkins
>  sharon@kithrup.com
>
>-------------------------- cut here -------------------------
>#!/usr/bin/perl
>
># #!/usr/local/bin/perl5.001
>
>chdir "/usr/pub/bible" || die "No bible on this machine\n";
>
>while ($ARGV[0] =~ s/^-//) {
>    $name = shift;
>    $bookpat .= "\\b$name|";
>}
>
>$pat = "@ARGV";
>
>if ($bookpat ne '') {
>    chop($bookpat);
>}
>else {
>    $bookpat = '^\d';
>}
>
>@ARGV = ();
>while (<DATA>) {
>    next unless /$bookpat/;
>    ($name) = split(' ');
>    push(@ARGV, $name);
>}
>
>while (<>) {
>    write if /$pat/oi;
>}
>
>format STDOUT =
>^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<
>$_
>~~
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>$_
>.
>
>__END__
>01.genesis              ot      pentateuch
>02.exodus               ot      pentateuch
>03.leviticus            ot      pentateuch
>04.numbers              ot      pentateuch
>05.deuteronomy          ot      pentateuch
>06.joshua               ot      history israel
>07.judges               ot      history israel
>08.ruth                 ot      history israel
>09.1-samuel             ot      history israel
>10.2-samuel             ot      history israel
>11.1-kings              ot      history israel
>12.2-kings              ot      history israel
>13.1-chronicles         ot      history israel
>14.2-chronicles         ot      history israel
>15.ezra                 ot      history israel
>16.nehemiah             ot      history israel
>17.esther               ot      history israel
>18.job                  ot      wisdom poetry
>19.psalms               ot      wisdom poetry
>20.proverbs             ot      wisdom poetry
>21.ecclesiastes         ot      wisdom poetry
>22.song-of-solomon      ot      wisdom poetry
>23.isaiah               ot      prophetic major
>24.jeremiah             ot      prophetic major
>25.lamentations         ot      prophetic major
>26.ezekiel              ot      prophetic major
>27.daniel               ot      prophetic major
>28.hosea                ot      prophetic minor
>29.joel                 ot      prophetic minor
>30.amos                 ot      prophetic minor
>31.obadiah              ot      prophetic minor
>32.jonah                ot      prophetic minor
>33.micah                ot      prophetic minor
>34.nahum                ot      prophetic minor
>35.habakkuk             ot      prophetic minor
>36.zephaniah            ot      prophetic minor
>37.haggai               ot      prophetic minor
>38.zechariah            ot      prophetic minor
>39.malachi              ot      prophetic minor
>40.matthew              nt      gospel synoptic
>41.mark                 nt      gospel synoptic
>42.luke                 nt      gospel synoptic
>43.john                 nt      gospel                  johanine
>44.acts                 nt      history church
>45.romans               nt      epistle general         pauline
>46.1-corinthians        nt      epistle general         pauline
>47.2-corinthians        nt      epistle general         pauline
>48.galatians            nt      epistle general         pauline
>49.ephesians            nt      epistle general         pauline
>50.philippians          nt      epistle general         pauline
>51.colossians           nt      epistle general         pauline
>52.1-thessalonians      nt      epistle general         pauline
>53.2-thessalonians      nt      epistle general         pauline
>54.1-timothy            nt      epistle pastoral        pauline
>55.2-timothy            nt      epistle pastoral        pauline
>56.titus                nt      epistle pastoral        pauline
>57.philemon             nt      epistle general         pauline
>58.hebrews              nt      epistle general
>59.james                nt      epistle general
>60.1-peter              nt      epistle general
>61.2-peter              nt      epistle general
>62.1-john               nt      epistle general         johanine
>63.2-john               nt      epistle general         johanine
>64.3-john               nt      epistle general         johanine
>65.jude                 nt      epistle general
>66.revelation           nt      prophetic               johanine
>-------------------------- cut here -------------------------




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

Date: Wed, 29 Apr 1998 23:30:11 -0400
From: "Arthur Gibbs" <nospam@aol.com>>really Gibbs at Cheerful.com>
Subject: Re: Bible References converted into Text
Message-Id: <3547f1e3.0@news1.ibm.net>

Yes the problem is converting the references.  1 John 3:16-18,20 means 16
through 18 and then 20 by itself.  1 John 3:16-17;4:1-2 means 16 through 17
and then change to chapter 4 and get verses 1 through 2.  And so on.

I'm using the program to insert texts in graded Bible studies as it parses
the html and sends it back.  I already have a search program that can do
simply 1 John 3:16-18 but nothing else.  I just wanted to make sure I was
the first to tackle this problem before I did.

Thanks

Arthur :)

Current Flat File Database format:
---------------------------------

1:1 That which was from the beginning, which we have heard, which we have
seen with our eyes, which we have looked upon, and our hands have handled,
of the Word of life;
1:2 (For the life was manifested, and we have seen it, and bear witness, and
shew unto you that eternal life, which was with the Father, and was
manifested unto us;)
1:3 That which we have seen and heard declare we unto you, that ye also may
have fellowship with us: and truly our fellowship is with the Father, and
with his Son Jesus Christ.

Current Search Program:
---------------------------------
#!/usr/bin/perl

require "cgi-lib.pl";

$DATA_DIRECTORY = ".";

MAIN:
{
  print "Content-type: text/html\n\n";

# Read in all the variables set by the form

 if (&ReadParse(*input))
 {
  $book = $input{'book'};
  $chapter = $input{'chapter'};
  $start_verse = $input{'startverse'};
  $end_verse = $input{'endverse'};

  open (FILE, $DATA_DIRECTORY."/".$book);
  @text = <FILE>;
  close(FILE);

  print "<H2 align=center>$text[0]</H1>\n";
  print "<H3 align=center>$chapter:$start_verse-$end_verse</H3>";

  $found_start = 0;
  $finished = 0;

  $verse = $start_verse;
  foreach (@text)
  {
   if ($verse > $end_verse)
   {
    last;
   }

   if ($_ =~ /(\A$chapter:$verse | $chapter:$verse )/i)
   {
    print "$_<P>\n";

    while ($verse < $end_verse && ($_ =~ /$chapter:$verse /i))
    {
     $verse++;
    }
   }
  }
	}
}




brian d foy wrote in message ...
>In article <35479759.0@news1.ibm.net>, "Arthur Gibbs"
<nospam@aol.com>>really Gibbs at Cheerful.com> posted:
>
>>Anyone know of a perl program that easily translates Bible references into
>>texts from a flat file text database?
>>
>>1 John 3:16-20,22 into the Bible text itself?
>>or 1 John 3:16-17;4:1-2
>>or 1 John 3:16,19,20
>
>how is the Bible stored in flat text?
>
>also, wouldn't it be infinitely easier to store this in some sort of
>hashing thingy for quick look-up?  the data is not going to change (well,
>if you're changing it, God help you), so you should be able to do all
>manner of look-up optimization.
>
>or perhaps your problem is converting the reference to the record that
>it needs to return?
>
>curious problem...
>
>good luck :)
>
>--
>brian d foy                                  <comdog@computerdog.com>
>CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
>Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
>Perl Mongers <URL:http://www.pm.org>




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

Date: Wed, 29 Apr 1998 23:33:35 -0400
From: "Arthur Gibbs" <nospam@aol.com>>really Gibbs at Cheerful.com>
Subject: Re: Bible References converted into Text
Message-Id: <3547f20f.0@news1.ibm.net>

I already link to the Bible Gateway.  I just wanted to insert texts into
graded Bible studies as it parses the html and sends it back.  I have a good
perl program that grades Bible studies and E-mails the results and graded
lesson.  As far as texts go I already have a search program that can do
simply 1 John 3:16-18 but nothing else.  I just wanted to make sure I was
the first to tackle this problem before I did.

I have the problem of converting the references.  1 John 3:16-18,20 means 16
through 18 and then 20 by itself.  1 John 3:16-17;4:1-2 means 16 through 17
and then change to chapter 4 and get verses 1 through 2.  And so on.


Thanks

Arthur :)


Bill Watson wrote in message <3547BB35.5744@mindspring.com>...
>Arthur Gibbs wrote:
>>
>> Anyone know of a perl program that easily translates Bible references
into
>> texts from a flat file text database?
>
>You can put a link from your page to goshen.net, where a reference to
>text
>script exists. You can even pick which bible version you which to
>reference.
>
>Regards,
>Bill
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>Bill Watson                                        Internet Consultant
>          Consultation Training Web Page Creation/Hosting
>http://www.gonc.com/                            bwatson@mindspring.com
>Durham,NC                                        Phone: 1-919-493-9880




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

Date: Wed, 29 Apr 1998 21:33:52 -0500
From: "Charles Kerekes" <dont@want.spam>
Subject: Complete list of all elements of EventData
Message-Id: <6i8o1n$oso$1@supernews.com>

Here is a sample code that I modified from a magazine posting for reading
the NT event log. The $EventData has several elements defined as shown
below. I was wondering if this is the complete list or if someone out there
can share the complete list with us. One element I would really like to have
is the Description field as shown in the Event Viewer. Please copy my e-mail
address with your response: CharlesKerekes@iName.com

Thanks.
Charlie

     $EventObj->Read(( EVENTLOG_SEEK_READ |
EVENTLOG_BACKWARDS_READ ),$currec, $EventData);

      $recordnumber  = $EventData->{'RecordNumber'};
      $source        = $EventData->{'Source'};
      $timewritten   = $EventData->{'Timewritten'};
      $id            = $EventData->{'EventID'} & 0xffff;
      $category      = $EventData->{'Category'};
      $type          = $EventData->{'EventType'};
      $strings       = $EventData->{'Strings'}; chomp($strings);
      $computer      = $EventData->{'Computer'};

--
| Charles Kerekes
| ======================================
| SPAM PROOF - Don't Reply To This Posting Directly.
| Please send replies to CharlesKerekes@iName.com
| ======================================




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

Date: 29 Apr 1998 22:19:14 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Detecting Uncaught Exceptions at Compile Time
Message-Id: <6i8912$c0n$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Steve Traugott <stevegt@TerraLuna.org> writes:
:Does anyone know of a way to detect uncaught exceptions at compile time,
:as in Java, rather than waiting until runtime?  None of the existing
:exception modules (Exception.pm, Error.pm,...) seem to be able to do
:this.

Certainly not.  You cannot know at compile time whether 
an exception shall be uncaught.  Perl is a dynamic
language, you know.  You're as likely to solve
the halting problem.  In fact, I'm not sure that they're 
different problems at all.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    "It is easier to port a shell than a shell script."
		--Larry Wall


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

Date: Wed, 29 Apr 1998 21:15:59 GMT
From: Bornes <bornes@uqam.ca>
Subject: Re: formatting output
Message-Id: <3547988C.C7B00726@uqam.ca>

Richard Tan wrote:

> To call the sub:
> print &FormatCurrency ("5830.568")."\n";                    This will print $5,830.75

And if you try:
print &FormatCurrency ("9.0589")."\n";
will print $9.6 wich is no good....





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

Date: Wed, 29 Apr 1998 21:51:40 -0500
From: Michael mortensen <mikemort@cadence.com>
Subject: GetOpts::Std and use strict
Message-Id: <3547E73C.7E8A@cadence.com>

If I do "use strict" with getopts, then the variables
associated with the flags (such as $opt_v) give compile
time errors since they are not declared, but if I declare
them using "my" then it hides the getopts values of
those variables.

Is there a way of using getopts while still being able
to have "use strict"?

Thanks in advance!
-- 
-------------------------------------
- Michael Mortensen                 -
- Consultant, Austin Design Center  -
- ph: 512 231 3307, email: mikemort -
-------------------------------------


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

Date: 30 Apr 1998 00:58:31 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How to find the number of matches in a string
Message-Id: <6i8ibn$af4$1@client2.news.psi.net>

Jarkko Hietaniemi (jhi@alpha.hut.fi) wrote on MDCCII September MCMXCIII
in <URL: news:oeed8e0o03p.fsf@alpha.hut.fi>:
++ 
++ > $count++ while $string =~ m/pattern/g;
++ > 
++ > $count = () = $string =~ m/pattern/g;
++ 
++ There is of course the point that the codes are not exactly
++ functionally equivalent.
++ 
++ [clickety click]
++ 
++ Now they are.
++ 
++   for ( $count = 0; $string =~ m/pattern/g; $count++ ) { }
++ 
++   $count = () = $string =~ m/pattern/g;


They aren't. In the second case, =~ is being evaluated in a list context,
while in the first case, repeatedly in scalar context.  I am not at
all suprised that post incrementing beats building a list and throwing
it away.



Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: Wed, 29 Apr 1998 20:54:40 GMT
From: "James M. Stern" <jstern@world.northgrum.com>
Subject: Re: instruction if-elsif-elsif insert on a for loop
Message-Id: <35479390.66F6BBE2@world.northgrum.com>

A number of people have already posted helpful replies.  Let me make
these more general remarks.  I intend them as advice, not criticism:

1. As someone else noted, you could have tried this for yourself.  It's
much faster than waiting for a c.l.p.m. response.

2. Perl comes with plentiful online documentation, viewable via
"perldoc".  "perldoc perlsyn" answers your question.

3. In real life, you would of course indent your if/elsif/...
block.  I hope.

Look for the answer yourself before posting.  It's not only faster, it's
the right thing to do.  Newsgroups are for questions you _can't_ answer
on your own.

Of course, if you've looked for the answer in the FAQ and elsewhere and
either can't find it or can't understand it, post away!  No one should
object to that.

Stiphanie gaye wrote:
> [...]
> 
> is it possible to insert an instruction if-elsif-elsif in a "for" loop?
> example :
> for( ; ; ){
> if ( ){ };
> elsif ( ) { };
> elsif ( ) { };
> }
> [...]




-- 
James M. Stern -- Views here are my own, not my employer's.  
(Hawthorne, CA)


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

Date: Wed, 29 Apr 1998 23:07:01 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Just a thought...
Message-Id: <6i8ott$2ql@fridge.shore.net>

John Chambers wrote in message <3545E962.EA2DB5A1@ral1.zko.dec.com>...

>I wonder if we could get a movement going to use Unix timestamps
>openly in messages as a "standard" way of specifying dates and
>times?  It'd be interesting to see the public reaction (if any).
>
>X-posted-at: 893774168   ;-)

If we're going to do this, my suggestion is:

X-posted-at: stardate 89377.4168  :-)

-grinch

--
-----
"It's not real coffee unless the sugar cubes float." - me

Sherm Pendley
grinch@whoville.com
http://www.whoville.com





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

Date: Tue, 28 Apr 1998 22:18:03 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Named Pipes (FIFOs) ...
Message-Id: <35464cd1.8458889@news.btinternet.com>

On Wed, 29 Apr 1998 10:43:44 -0400, Ala Qumsieh wrote :

<snip>

>Perfect, I like that ... but can't you know WHO is on the other end? for
>example, the pid, or the machine name .. etc ..
>

'Fraid not.  You either need to set the permissions on the named pipe
to prevent illicit use or you must program to tolerate misuse.

/J\
Jonathan Stowe
Some of your questions answered http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm


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

Date: 29 Apr 1998 20:34:23 GMT
From: bdwheele@indiana.edu (Brian Wheeler)
Subject: Re: Perl and OLE/COM on UNIX
Message-Id: <6i82sf$fn2$1@jetsam.uits.indiana.edu>

In article <6i81lr$qgd$1@nnrp1.dejanews.com>,
	nick@xyvision.com writes:
> Perl for Win32 has a Win32::OLE package that enables Automation support. I
> can call applications such as Excel from Perl and actuate the exposed
> functions.
> 
> COM has been ported to various UNIX platforms, in particular Solaris. Does
> perl support COM objects and COM calling conventions on UNIX platforms?
> 
> If not (as I suppose it doesn't), could someone knowledgeable about the
> Win32::Ole package outline what would be involved in porting the package to a
> UNIX platform?

	What are you going to be driving on the unix side with OLE?  
Excel doesn't exist here.

	Brian Wheeler
	bdwheele@indiana.edu


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

Date: Wed, 29 Apr 1998 20:37:55 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Shawn Abigail <sabigail@newbridge.com>
Subject: Re: perl and Year 2000
Message-Id: <Pine.GSO.3.96.980429131947.19984P-100000@user2.teleport.com>

On Wed, 29 Apr 1998, Shawn Abigail wrote:

> I am using perl 5.004 as a tool on my workstation. My boss wants to know
> if it is Year 2000 compliant.  What do I tell her? 

Tell her to find the answer in the Perl FAQ, of course. 

> I haven't seen anything on the web about this. 

Really? I'm curious about that. Where did you look? I entered "perl year
2000" into the first search engine I thought of (Yahoo) and got an answer
in an instant. 

    http://www.yahoo.com/

In fact, I was also able to find the answer with a couple of other search
engines. Then I looked in the perl docs for the word "2000" and found it
even faster. Maybe we need to put the answer in even more obvious places,
though - If your favorite search engine doesn't list it already, see if
you can get it to index a URL leading to the Perl FAQ. Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 29 Apr 1998 16:52:20 -0400
From: Shawn Abigail <sabigail@newbridge.com>
Subject: Re: perl and Year 2000
Message-Id: <35479304.B492DC6A@newbridge.com>

Shawn Abigail wrote:

> I am using perl 5.004 as a tool on my workstation. My boss wants to know
> if it is Year 2000 compliant.  What do I tell her?  I haven't seen
> anything on the web about this.  Assuming that my operating system is
> compliant, are there any Y2K issues with perl?  Thanks!
>

Thanks to those who pointed out that the answer is at www.perl.com (I had
bookmarked www.perl.org and language.perl.com). The perl community is
certainly quick to help, even when the answer is right under my nose!

Shawn





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

Date: 29 Apr 1998 20:59:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl and Year 2000
Message-Id: <6i84as$78t$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Shawn Abigail <sabigail@newbridge.com> writes:
:I am using perl 5.004 as a tool on my workstation. My boss wants to know
:if it is Year 2000 compliant.  What do I tell her?  

You ask her whether she's stopped beating her wife.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
They spell it "da Vinci" and pronounce it "da Vinchy".  Foreigners
always spell better than they pronounce.
                -- Mark Twain


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

Date: Wed, 29 Apr 1998 17:15:38 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: perl and Year 2000
Message-Id: <alecler-2904981715380001@dialup-659.hip.cam.org>

In article <35477C79.28C4F5CA@newbridge.com>, Shawn Abigail
<sabigail@newbridge.com> wrote:

> Hi,
> 
> I am using perl 5.004 as a tool on my workstation. My boss wants to know
> if it is Year 2000 compliant.  What do I tell her?  I haven't seen
> anything on the web about this.  Assuming that my operating system is
> compliant, are there any Y2K issues with perl?  Thanks!
> 
> Shawn Abigail
> sabigail@newbridge.com

=======================================

(From perlfaq4:)

<quote>
Does Perl have a year 2000 problem?

Not unless you use Perl to create one. The date and time functions
supplied with perl (gmtime and localtime) supply adequate information to
determine the year well beyond 2000 (2038 is when trouble strikes). The
year returned by these functions when used in an array context is the year
minus 1900. For years between 1910 and 1999 this happens to be a 2-digit
decimal number. To avoid the year 2000 problem simply do not treat the
year as a 2-digit number.  It isn't.

When gmtime() and localtime() are used in a scalar context they return a
timestamp string that contains a fully-expanded year.  For example,
$timestamp = gmtime(1005613200) sets $timestamp to "Tue Nov 13 01:00:00
2001".  There's no year 2000 problem here. 
<unquote>

A.L.


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

Date: Wed, 29 Apr 1998 18:13:40 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: perl and Year 2000
Message-Id: <fl_aggie-2904981813400001@aggie.coaps.fsu.edu>

In article <35477C79.28C4F5CA@newbridge.com>, Shawn Abigail
<sabigail@newbridge.com> wrote:

+ I am using perl 5.004 as a tool on my workstation. My boss wants to know
+ if it is Year 2000 compliant.  What do I tell her?  I haven't seen
+ anything on the web about this.  Assuming that my operating system is
+ compliant, are there any Y2K issues with perl?  Thanks!

Must...control...fist...of...death...

<url:http://www.dejanews.com/>

Search this newsgroup for 'y2k' and the various variations on that
string...

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: Wed, 29 Apr 1998 23:09:34 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Perl Editor??
Message-Id: <6i8p2m$2r6@fridge.shore.net>

Earl Hood wrote in message <6i88ei$hn3@news.service.uci.edu>...

>BTW, vim is a superset of vi.  If you have access to vim, it is worth
>a look.  One can even get/build vim for Windog systems.

If you're using Win32, Lemmy is a good vi clone, too. One neat feature is
that all of the running instances of Lemmy share the same set of yank
buffers. You can use them to cut 'n paste between different documents.

-grinch


--
-----
"It's not real coffee unless the sugar cubes float." - me

Sherm Pendley
grinch@whoville.com
http://www.whoville.com





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

Date: 30 Apr 1998 01:05:53 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: print($b=1,$b=2)
Message-Id: <6i8iph$af4$2@client2.news.psi.net>

Peter A Fein (p-fein@uchicago.edu) wrote on MDCCII September MCMXCIII in
<URL: news:87d8e0pt2u.fsf@bj2-64.rh.uchicago.edu>:
++ Horst Fickenscher <horst.fickenscher@it.erlm.siemens.de> writes:
++ 
++ > Perl 5.003 on Linux:
++ > 
++ > The following code makes a little more sense
++ > than that in the subject line:
++ > 
++ > my $b;
++ > print($b = "basename", $b = "directory/$b");
++ > # do some other stuff with $b
++ > 
++ > I thought it should print: basenamedirectory/basename
++ > but it prints:             directory/basenamedirectory/basename
++ > 
++ 
++ I believe that the parens mean do the evaluation first.  This then
++ returns the list of evaluated $b's to print.  What I think you're
++ looking for is 
++ 
++ print ($b = "basename"), ($b = "directory/$b");
++ 
++ I'm not sure the parens here are needed, but I doubt they'll hurt.
++ Why are you writing code like this anyway?


Why are you proposing code without trying? Had you tried, you would
have noticed that it doesn't work.

If one really insists on doing the assignment together with the print:

       print $b = "directory/basename";



Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


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

Date: 30 Apr 1998 03:54:48 GMT
From: "Kris Davey" <mivl@inquo.net>
Subject: Simple Question regarding dates
Message-Id: <01bd73eb$b715a600$2d06b3cf@krisdavey>

I am farly new to PERL and was wondering if someone could show me an
example of 1. how to display the current date (i.e. 29 April 1998) 2. Store
it in a scalar variable 3. create a file using the variable so the the file
is Named 29 April 1998. Any help would be greatly appreciated. I don't know
if it makes any difference but this script would be run on an NT box. Any
help would be appreciated. Thanks in advance.



Kris Davey
MIVL@Inquo.net


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

Date: Wed, 29 Apr 1998 16:50:49 -0500
From: Lachlan Dunlop <lach@lach.net>
Subject: Toggling reverse on and off on in a for loop
Message-Id: <3547A0B9.8F2BFDFB@lach.net>

Hi group,

I have a quick question. take the code below,

#!/usr/bin/perl -w

    my $i;

    for $i (@bank) {
        print $i ;
    }


I have the need to occationally list the array in reverse at the users
request.

    my $i;

    for $i (reverse @bank) {
        print $i;
    }

Now my question is this is there a way to put the word reverse into a variable
name say $direction = "reverse" and then the code look like

    my $i;

    for $i ($direction @bank) {
        print $i;
    }

So when I want it reversed $direction ="reverse" else $direction = ""

Thanks

lach




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

Date: Wed, 29 Apr 1998 16:56:00 -0400
From: Brian Mathis <brianm@kodak.com>
To: Lachlan Dunlop <lach@lach.net>
Subject: Re: Toggling reverse on and off on in a for loop
Message-Id: <354793E0.71BEB0C4@kodak.com>

Lachlan Dunlop wrote:
> 
> Hi group,
> 
> I have a quick question. take the code below,
> 
[...]
> 
> Now my question is this is there a way to put the word reverse into a variable
> name say $direction = "reverse" and then the code look like
> 
>     my $i;
> 
>     for $i ($direction @bank) {
>         print $i;
>     }
> 
> So when I want it reversed $direction ="reverse" else $direction = ""
> 
> Thanks
> 
> lach


How about doing something like this:

if( $direction eq 'reverse' ) { @bank = reverse @bank; }

of course, it's not very obfuscated, but it solves your problem.

Brian Mathis


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

Date: 29 Apr 1998 14:14:06 -0700
From: smitty7777@hotmail.com
Subject: Re: You people want Perl to be popular?
Message-Id: <6i856u$6hq@co-op.newsguy.com>

In article <x77m49cloe.fsf@sysarch.com>, Uri says...
>
>>>>>> "CL" == Chris Lambrou <archive@cglis.com> writes:
>
>  CL> Well?
>
>it is. but you aren't :-)

Very mature response, Uri.  Perhaps you should get that diaper rash looked at.

Dave

>
>Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
>Perl Hacker for Hire  ----  8 Years of Perl Experience, Available Immediately
>uri@sysarch.com  ---------  Resume and Perl Example at http://www.sysarch.com
>Use the Best Search Engine on the Net  --------  http://www.northernlight.com


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 2460
**************************************

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