[25764] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8003 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 21 18:05:26 2005

Date: Thu, 21 Apr 2005 15:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 21 Apr 2005     Volume: 10 Number: 8003

Today's topics:
        =?iso-8859-1?q?Good_morning_or_good_evening_depending_u RonGrossi382756@yahoo.com
    Re: capture output from print command to variable in pe <nobull@mail.com>
    Re: Cgi.pm and CSS <pilkowsk@informatik.uni-marburg.de>
        Gathering Source files <izombe@yahoo.com>
    Re: Gathering Source files xhoster@gmail.com
    Re: Good morning or good evening depending upon your lo <wmech@bellsouth.net>
    Re: Good morning or good evening depending upon your lo <nospam@nospam.com>
    Re: Good morning or good evening depending upon your lo <up@dawn.am>
    Re: Good morning or good evening depending upon your lo <perl@my-header.org>
    Re: How to test if a string is already in a array <pilkowsk@informatik.uni-marburg.de>
    Re: How to test if a string is already in a array <tadmc@augustmail.com>
    Re: How to test if a string is already in a array <pilkowsk@informatik.uni-marburg.de>
    Re: Matching mixed up words <pilkowsk@informatik.uni-marburg.de>
        OLE & Excel - Opening causes Excel.exe to hang around <DillerTim@JohnDeere.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 21 Apr 2005 12:25:49 -0700
From: RonGrossi382756@yahoo.com
Subject: =?iso-8859-1?q?Good_morning_or_good_evening_depending_upon_your_location._I_want_to_ask_you_the_most_important_question_of_your_life._Your_joy_or_sorrow_for_all_eternity_depends_upon_your_answer._The_question_is:_Are_you_saved=3F_It_is_not_a_question_of_how_good_you_are,_nor_if_you_are_a_church_member,_but_are_you_saved=3F_Are_you_sure_you_will_go_to_Heaven_when_you_die=3F_GOOGLE=B7NEWSGROUP=B7POST=B7146?=
Message-Id: <1114111549.655975.129160@f14g2000cwb.googlegroups.com>


The reason some people don't know for sure
if they are going to Heaven when they die
is because they just don't know.

The good news is that you can know for
sure that you are going to Heaven which is
described in the Holy Bible as a beautiful
place with no death, sorrow, sickness or
pain.

God tells us in the Holy Bible how simple
it is to be saved so that we can live
forever with Him in Heaven.

"For if you confess with your mouth Jesus
is Lord and believe in your heart that God
raised Him from the dead, you
WILL BE SAVED." (Romans 10:9)

Over 2000 years ago God came from Heaven
to earth in the person of Jesus Christ to
shed His blood and die on a cross to pay
our sin debt in full.

Jesus Christ was born in Israel
supernaturally to a virgin Jewish woman
named Mary and lived a sinless life for
thirty-three years.

At the age of thirty-three Jesus was
scourged and had a crown of thorns pressed
onto His head then Jesus was crucified.

Three days after Jesus died on a cross and
was placed in a grave Jesus rose from the
dead as Jesus said would happen before
Jesus died.

If someone tells you that they are going
to die and in three days come back to life
again and it happens then this person must
be the real deal.

Jesus Christ is the only person that ever
lived a perfect sinless life.

This is why Jesus is able to cover our
sins(misdeeds) with His own blood because
Jesus is sinless.

The Holy Bible says, "In Him(Jesus) we
have redemption through His blood, the
forgiveness of sins..." (Ephesians 1:7)

If you would like God to forgive you of
your past, present and future sins just
ask Jesus Christ to be your Lord and
Saviour.

It doesn't matter how old you are or how
many bad things that you have done in
your life including lying and stealing
all the way up to murder.

Just pray the prayer below with your
mouth and mean it from your heart and
God will hear you and save you.

Dear Jesus Christ, I want to be saved so
that I can have a home in Heaven with You
when I die. I agree with You that I am a
sinner. I believe that You love me and want
to save me. I believe that You bled and
died on the cross to pay the penalty for my
sins and that You rose from the dead.
Please forgive my sins and come into my
heart and be my Lord and Saviour. Thanks
Lord Jesus Christ for forgiving me and
saving me through Your merciful grace.
Amen.

Welcome to the family of God if you just
allowed God to save you. Now you are a real
Christian and you can know for sure that
you will live in Heaven forever when this
life comes to an end.

As a child of God we are to avoid
sin(wrongdoing), but if you do sin the
Holy Bible says, "My dear children, I
write this to you so that you will not sin.
But if anybody does sin, we have one who
speaks to the Father in our defense Jesus
Christ, the Righteous One."

Those of you that have not yet decided to
place your trust in the Lord Jesus Christ
may never get another chance to do so
because you do not know when you will die.

Jesus said, "I am the way, the truth and
the life: no one can come to the
Father(God)(in Heaven), but by me."
(John 14:6)

This means that if you die without
trusting in Jesus Christ as your Lord and
Saviour you will be forever separated from
the love of God in a place called Hell.

The Holy Bible descibes Hell as a place of
eternal torment, suffering, pain and agony
for all those who have rejected Jesus Christ.

The good news is that you can avoid Hell by
allowing Jesus Christ to save you today.
Only then will you have true peace in your
life knowing that no matter what happens you
are on your way to Heaven.


Praise the Lord!
Servant of the Lord Jesus Christ
Ronald L. Grossi

*Show this to your family and friends so
they can know that they have a choice
where they will spend eternity. Thanks!

____________________________________________________



Got Questions?
http://www.gotquestions.org/archive.html

Other Languages
http://www.godssimpleplan.org/gsps.html

Free Movie: To Hell and Back
http://www.tbn.org/index.php/8/1.html

Animation
http://www.gieson.com/Library/projects/animations/walk/index.html

The Passion Of The Christ
http://www.thepassionofthechrist.com

Beware Of Cults
http://www.carm.org/cults/cultlist.htm

About Hell
http://www.equip.org/free/DH198.htm

Is Jesus God?
http://www.powertochange.com/questions/qna2.html

Free Online Bible
http://www.biblegateway.com


____________________________________________________



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

Date: 21 Apr 2005 11:58:41 -0700
From: "nobull@mail.com" <nobull@mail.com>
Subject: Re: capture output from print command to variable in perl
Message-Id: <1114109921.775460.217320@g14g2000cwa.googlegroups.com>


Anno Siegel wrote:
> nobull@mail.com <nobull@mail.com> wrote in comp.lang.perl.misc:
> >
> > {
> >     require AtExit;
> >     open my $capture_handle, '>', \$capture or die $!;
> >     my $saved_handle = select $capture_handle;
> >     my $restore_output_handle = AtExit->new(sub{ select
$saved_handle
> > });
> >     subroutine_i_cannot_alter();
> > }
>
> AtExit appears to be an interesting module, thanks for mentioning it.

Actually the generic AtExit is not a standard module but the less
general purpose module, SelectSaver, is both more applicable here and
now standard.

> However, I don't see the advantage in using it here.  It only hides
> the re-selection of the original output handle.

It also ensures that the handle is restored even if
subroutine_i_cannot_alter() does not return but throws an exception.
It's a bit like using local().

{
     require SelectSaver;
     open my $capture_handle, '>', \$capture or die $!;
     my $restore_output_handle =  SelectSaver->new($capture_handle);
     subroutine_i_cannot_alter();
}



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

Date: Thu, 21 Apr 2005 21:20:39 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: Cgi.pm and CSS
Message-Id: <3cqclbF6n85knU1@individual.net>

* Nikos schrieb:
> 
> I try to convert it but i couldn manage it but since you are willing to 
> help convert it ic an paste it to you.
> Man iam scared enouph just by looking at it :)
> here is is btw as cgi.pm produced it:

[...]

> </td></tr></table><br /><table class="info"><tr><td>dell.lan</td></tr> 
> <tr><td>21 Apr, 13:38</td></tr> <tr><td>1327</td></tr></table><br /><a 
> href="games.pl"><img src="../data/images/games.gif" /></a><p 
> align="right"><a href="show.pl?onoma=showlog"><font color="Lime" 
> size="2"><b>Last Update: 18/4/2005</b></font></a></p>

Haven't I told you to use »CGI::Pretty« instead of »CGI«? Then, you'll
get a well-formatted HTML output from your script. Anyway, I've looked
through your HTML code (I have requested the current one from your own
website). But, I'm disappointed: There are only six TMPL_VARs (and one
TMPL_LOOP, to be correct). Since you have already seen an example with
three TMPL_VARs, I don't see why extending it to six vars could be a
real problem ...

Sorry about the long lines, but because it's nothing important in those
lines, I've not choosen to break them. Here is your template I would
using for a first test (but, I haven't tested it yet):

##########
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">

<head>
    <title>Ψυχωφελή Πνευματικά Κείμενα!</title>
    <link rel="stylesheet" type="text/css" href="../style.css" />
    <script language="JavaScript" tape="text/javascript">
        var textToShow = "<TMPL_VAR name=data>";
        <!-- here you have to insert the rest of your javascript code -->
    </script>
</head>

<body onload="init()">

    <form method="post" action="index.pl" enctype="application/x-www-form-urlencoded">
    <p align="center">
        <font color="Lime" size="5">Λόγος Ψυχωφελής και Θαυμάσιος => </font>
        <select name="select">
            <TMPL_LOOP name=options>
            <option value="<TMPL_VAR name=option>"><TMPL_VAR name=option></option>
            </TMPL_LOOP>
        </select>
        <input type="submit" name="ok" value="ok" />
    </p>
    <div></div> <!-- I don't think you need this empty div -->
    </form>

    <br />

    <center>
    <div id="DivText" align="Left" style="background-image: url(../data/images/kenzo.jpg);
        border: Ridge Orange 5px; width: 850px; height: 500px; color: LightSkyBlue;
        font-family: Times; font-size: 18px;"></div>

    <br /><br /><br />

    <form method="post" action="show.pl" enctype="application/x-www-form-urlencoded">
    <table class="user">
        <tr><td>Πώς σε λένε αδελφέ?</td> <td><input type="text" name="onoma" /></td></tr>
        <tr><td>Ποιά είναι η γνώμη σου για την ευχούλα *Κύριε Ιησού Χριστέ Ελέησον Με* ?</td> <td><textarea name="euxoula" rows="4" cols="25"></textarea></td></tr>
        <tr><td>Μοιράσου μαζί μας μία κατά τη γνώμη σου θαυμαστή προσωπική πνευματική εμπειρία από κάποιον γέροντα προς ώφελος των υπολοίπων αδελφών (αν φυσικά έχεις :-)</td> <td><textarea name="sxolio" rows="6" cols="25"></textarea></td></tr>
        <tr><td>Ποιό είναι το e-mail σου?</td> <td><input type="text" name="email" /></td></tr>
        <tr><td><input type="submit" name="Εμφάνιση όλων των απόψεων" value="Εμφάνιση όλων των απόψεων" /></td> <td><input type="submit" name="Αποστολή" value="Αποστολή" /></td></tr>
    </table>
    <div></div>
    </form>

    <br /><br />

    <!-- table: tip -->
    <table class="quote">
        <tr><td><TMPL_VAR name=tip></td></tr>
    </table>

    <br />

    <!-- table: host, date and counter -->
    <table class="info">
        <tr><td><TMPL_VAR name=host></td></tr>
        <tr><td><TMPL_VAR name=date></td></tr>
        <tr><td><TMPL_VAR name=counter></td></tr>
    </table>

    <br />

    <a href="games.pl"><img src="../data/images/games.gif" /></a>
    <p class="first"><a href="show.pl?onoma=showlog"><b>Last Update: 21/4/2005</b></a></p>

</body>

</html>
##########

Within this template I have used the following TMPL_* tags.

    data
    options (loop) => option
    tip
    host
    date
    counter

Now, it's your part to fill in their values. I've shown you already (as
many others here), how this works. Untested:

    my $data = '...'; # do something to determine $data
    $tmpl->param( data => $data );

    # To fill TMPL_LOOPs you have to pass a reference to an array with
    # references to hashes inside. And the inner hashes contain the data
    # for the TMPL_VARs inside the TMPL_LOOP. Well, it's a bit tricky.
    my @display_files = map /([^\/]+)\.txt/, glob '../data/text/*.txt';
    my @array_of_hashes = map { option => $_ }, @display_files;
    $tmpl->param( options => \@array_of_hashes );

    my $tip = $tips[ int rand @tips ];
    $tmpl->param( tip => $tip );
    # etc.

Last but not least, a few comment to the HTML template above. In the
first lines, "iso-8859-1" is defined as encoding. Additionally, the
predicted language of this HTML file is "en-US". Are these settings
typically for Greek sites resp sites containing Greek characters (I'm
not up to date in this)?

It's not very intelligent to put all the *information* of the page into
one javascript variable. Then, a user without javascript enabled will
see nothing -- is that what you want? When using such nice (?) effects,
try to change existing HTML code. Just an idea: Put the text into its
own tags, eg. like

    <div id="DivText">The text you want to present.</div>
        
Then cut out this text with javascript while loading the page and write
it back with your effect (as you're doing this moment).

regards,
fabian

postscript. It's not really pleasant to post 500+ lines into a newsgroup
read by hundreds of humans. The posting guidelines for this group you've
already read, I hope, suggest to post a "short (less than 30 lines) and
complete program". Yes, your code is exceeding this limit, isn't it?


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

Date: 21 Apr 2005 13:57:56 -0700
From: "Ray Muforosky" <izombe@yahoo.com>
Subject: Gathering Source files
Message-Id: <1114117076.682615.24530@l41g2000cwc.googlegroups.com>

Help.

If I have file1 that loads (require file2 and files), is it possible
save the content of file file after the load.

example:
file1
#!perl
$a =12;
require file2;
$b = $z;
require file3;
$c = $y;
print $a;


file2
$z = 200;
1;

file3
$y = "foo";
1;

So, is it possible to save file1 after loading file2 and file3
file1 becomes:
#!perl
$a =12;
$z = 200;
$b = $z;
$y = "foo";
$c = $y;
print $a;


Thanks
Ray



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

Date: 21 Apr 2005 21:27:28 GMT
From: xhoster@gmail.com
Subject: Re: Gathering Source files
Message-Id: <20050421172728.647$1I@newsreader.com>

"Ray Muforosky" <izombe@yahoo.com> wrote:
> Help.
>
> If I have file1 that loads (require file2 and files), is it possible
> save the content of file file after the load.
>
> example:
> file1
> #!perl
> $a =12;
> require file2;
> $b = $z;
> require file3;
> $c = $y;
> print $a;
>
> file2
> $z = 200;
> 1;
>
> file3
> $y = "foo";
> 1;
>
> So, is it possible to save file1 after loading file2 and file3
> file1 becomes:
> #!perl
> $a =12;
> $z = 200;
> $b = $z;
> $y = "foo";
> $c = $y;
> print $a;

Those are not (in general) the same thing, because of the file scoping
of lexical variables and such.  I know that in the example you give there
are no lexical variables, but then again in the example you give it is
trivially easy to do what you want by hand.  So I have to assume that the
real world extends beyond your example.

A not very generic (or good) solution would be something like this:

warn "Untested";
$program1 =~ s/\brequire ([^;]+);/"\n".get_file($1)."\n"/eg;

sub get_file {
  ## see perldoc -f require for how to find file when not in cwd.
  open my $fh, "<", "$_[0].pm" or die "$_[0]: $!";
  local $/;
  return <$fh>;
};

Among other things that would break this would be quoted things that have
the word "require" within them, so look at Filter::Simple and such modules
to fix that.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Thu, 21 Apr 2005 15:58:53 -0400
From: "wmech" <wmech@bellsouth.net>
Subject: Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you ar
Message-Id: <nxT9e.113201$vK6.106989@bignews3.bellsouth.net>

<RonGrossi382756@yahoo.com> wrote in message
news:1114111549.655975.129160@f14g2000cwb.googlegroups.com...
>
> The reason some people don't know for sure
> if they are going to Heaven when they die
> is because they just don't know.

Could it be because there is NO objective evidence that ANY heaven exists?
My dead parents and siblings have never told from heaven about their new
wonderous life. Because they are just dead and returned to earth; not you
imaginery
heaven!

> The good news is that you can know for
> sure that you are going to Heaven which is
> described in the Holy Bible as a beautiful
> place with no death, sorrow, sickness or
> pain.

There is NO objective evidence as to the credibility of the Bibles and lots'
of objective
evidence that it is books inconsistencies, myths and legends.

Living for eternity in that heaven you describe sounds like eternal boredom!

> God tells us in the Holy Bible how simple
> it is to be saved so that we can live
> forever with Him in Heaven.
>
> "For if you confess with your mouth Jesus
> is Lord and believe in your heart that God
> raised Him from the dead, you
> WILL BE SAVED." (Romans 10:9)
>
> Over 2000 years ago God came from Heaven
> to earth in the person of Jesus Christ to
> shed His blood and die on a cross to pay
> our sin debt in full.

Oure myth!

> Jesus Christ was born in Israel
> supernaturally to a virgin Jewish woman
> named Mary and lived a sinless life for
> thirty-three years.

And never wrote one word. He must have been illiterate.

> At the age of thirty-three Jesus was
> scourged and had a crown of thorns pressed
> onto His head then Jesus was crucified.
>
> Three days after Jesus died on a cross and
> was placed in a grave Jesus rose from the
> dead as Jesus said would happen before
> Jesus died.

Why would a God that create the whole Universe and everything in it
have to suffer this apin and humiliation to save mankind from the sins God
created?

Why not just use his infinite power and forgive man's sins?

This whole tail is sadistic.

> If someone tells you that they are going
> to die and in three days come back to life
> again and it happens then this person must
> be the real deal.

And where is ther ANY OBJECTIVE EVIDENCE to support this myth?

> Jesus Christ is the only person that ever
> lived a perfect sinless life.
>
> This is why Jesus is able to cover our
> sins(misdeeds) with His own blood because
> Jesus is sinless.
>
> The Holy Bible says, "In Him(Jesus) we
> have redemption through His blood, the
> forgiveness of sins..." (Ephesians 1:7)
>
> If you would like God to forgive you of
> your past, present and future sins just
> ask Jesus Christ to be your Lord and
> Saviour.
>
> It doesn't matter how old you are or how
> many bad things that you have done in
> your life including lying and stealing
> all the way up to murder.
>
> Just pray the prayer below with your
> mouth and mean it from your heart and
> God will hear you and save you.
>
> Dear Jesus Christ, I want to be saved so
> that I can have a home in Heaven with You
> when I die. I agree with You that I am a
> sinner. I believe that You love me and want
> to save me. I believe that You bled and
> died on the cross to pay the penalty for my
> sins and that You rose from the dead.
> Please forgive my sins and come into my
> heart and be my Lord and Saviour. Thanks
> Lord Jesus Christ for forgiving me and
> saving me through Your merciful grace.
> Amen.
>
> Welcome to the family of God if you just
> allowed God to save you. Now you are a real
> Christian and you can know for sure that
> you will live in Heaven forever when this
> life comes to an end.
>
> As a child of God we are to avoid
> sin(wrongdoing), but if you do sin the
> Holy Bible says, "My dear children, I
> write this to you so that you will not sin.
> But if anybody does sin, we have one who
> speaks to the Father in our defense Jesus
> Christ, the Righteous One."
>
> Those of you that have not yet decided to
> place your trust in the Lord Jesus Christ
> may never get another chance to do so
> because you do not know when you will die.
>
> Jesus said, "I am the way, the truth and
> the life: no one can come to the
> Father(God)(in Heaven), but by me."
> (John 14:6)
>
> This means that if you die without
> trusting in Jesus Christ as your Lord and
> Saviour you will be forever separated from
> the love of God in a place called Hell.
>
> The Holy Bible descibes Hell as a place of
> eternal torment, suffering, pain and agony
> for all those who have rejected Jesus Christ.
>
> The good news is that you can avoid Hell by
> allowing Jesus Christ to save you today.
> Only then will you have true peace in your
> life knowing that no matter what happens you
> are on your way to Heaven.
>
>
> Praise the Lord!
> Servant of the Lord Jesus Christ
> Ronald L. Grossi
>
> *Show this to your family and friends so
> they can know that they have a choice
> where they will spend eternity. Thanks!
>
> ____________________________________________________
>
>
>
> Got Questions?
> http://www.gotquestions.org/archive.html
>
> Other Languages
> http://www.godssimpleplan.org/gsps.html
>
> Free Movie: To Hell and Back
> http://www.tbn.org/index.php/8/1.html
>
> Animation
> http://www.gieson.com/Library/projects/animations/walk/index.html
>
> The Passion Of The Christ
> http://www.thepassionofthechrist.com
>
> Beware Of Cults
> http://www.carm.org/cults/cultlist.htm
>
> About Hell
> http://www.equip.org/free/DH198.htm
>
> Is Jesus God?
> http://www.powertochange.com/questions/qna2.html
>
> Free Online Bible
> http://www.biblegateway.com
>
>
> ____________________________________________________
>




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

Date: Thu, 21 Apr 2005 20:09:21 GMT
From: "Jamie NoSpam" <nospam@nospam.com>
Subject: Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you ar
Message-Id: <RLT9e.10182$5f.8767@tornado.tampabay.rr.com>

<RonGrossi382756@yahoo.com> wrote in message 
news:1114111549.655975.129160@f14g2000cwb.googlegroups.com...
>
> The reason some people don't know for sure
> if they are going to Heaven when they die
> is because they just don't know.
>
> The good news is that you can know for
> sure that you are going to Heaven which is
> described in the Holy Bible as a beautiful
> place with no death, sorrow, sickness or
> pain.

Application for killfile.... <<APPROVED>>

--

Jamie 




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

Date: Thu, 21 Apr 2005 17:58:40 -0400
From: Elias all the Time <up@dawn.am>
Subject: Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you ar
Message-Id: <Xns963FB6DBC4683upatdawnam@63.223.7.253>

"Jamie NoSpam" <nospam@nospam.com> wrote in news:RLT9e.10182$5f.8767
@tornado.tampabay.rr.com:

> <RonGrossi382756@yahoo.com> wrote in message 
> news:1114111549.655975.129160@f14g2000cwb.googlegroups.com...
>>
>> The reason some people don't know for sure
>> if they are going to Heaven when they die
>> is because they just don't know.

Is this supposed to be some sort of imponderable?
"Some people don't know because they just don't know".

What is the sound of one asshole farting, Grasshopper?


>>
>> The good news is that you can know for
>> sure that you are going to Heaven which is
>> described in the Holy Bible as a beautiful
>> place with no death, sorrow, sickness or
>> pain.

Sounds like a recruiting poster for the military.
"Travel. See exotic lands. Meet interesting people."
They usually leave out "and kill them".

Seems to me that even in a "heaven", somebody's going to have 
to shovel shit.

> 
> Application for killfile.... <<APPROVED>>
> 
> --
> 
> Jamie 
> 
> 
> 



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

Date: Thu, 21 Apr 2005 21:54:37 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? GOOGLENEWSGROUPPOST146
Message-Id: <uq0g61d20mnklu25e831otsqq97jd5hmks@4ax.com>

X-Ftn-To: RonGrossi382756@yahoo.com 

RonGrossi382756@yahoo.com wrote:
>
>The reason some people don't know for sure
>if they are going to Heaven when they die
>is because they just don't know.

How about another eternal truth,
please_leave_clpm() and die "somewhere else" while $self->offtopic;
?


-- 
Matija


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

Date: Thu, 21 Apr 2005 21:46:58 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: How to test if a string is already in a array
Message-Id: <3cqe8pF6ouaocU1@individual.net>

* Tad McClellan schrieb:
> marc.eggenberger@itc.alstom.com wrote:
> 
> > 	if(index($address,"domain.ch") > 0)
> 
> What would index() return if
> 
>    $address = 'domain.ch';
> 
> ??

Sure, index() returns the position where the string 'domain.ch' starts
and -1 otherwise. So when address is 'domain.ch' it will return 0. But
be aware that 'domain.ch' is no valid mail address. Therefore I see no
need to add that to a hash containing mail addresses. Hence, I suggest
to test whether index() returns *two or more*. It's the minimum a mail
address must have in front of the domain part: at least one character
for the local part, followed by @.

Sure, mail addresses like 'domain.ch@somewhere.org' will by-pass this
*filter*, but index() is not made for complicated things ;-)

regards,
fabian


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

Date: Thu, 21 Apr 2005 15:43:44 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to test if a string is already in a array
Message-Id: <slrnd6g440.a9q.tadmc@magna.augustmail.com>

Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de> wrote:
> * Tad McClellan schrieb:
>> marc.eggenberger@itc.alstom.com wrote:
>> 
>> > 	if(index($address,"domain.ch") > 0)
>> 
>> What would index() return if
>> 
>>    $address = 'domain.ch';
>> 
>> ??
> 

> So when address is 'domain.ch' it will return 0. 


So the test above should be >= rather than >


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 21 Apr 2005 23:14:41 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: How to test if a string is already in a array
Message-Id: <3cqjchF6atb79U1@individual.net>

* Tad McClellan schrieb:
> Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de> wrote:
>>> 
>>> > 	if(index($address,"domain.ch") > 0)
>>> 
>>> What would index() return if
>>> 
>>>    $address = 'domain.ch';
>>> 
>>> ??
> 
>> So when address is 'domain.ch' it will return 0. 
> 
> So the test above should be >= rather than >

Or

    if ( index($address,'domain.ch') >= 2 )
    
as I mentioned in my previous posting.

regards,
fabian


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

Date: Thu, 21 Apr 2005 22:53:26 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: Matching mixed up words
Message-Id: <3cqi4sF6n2237U1@individual.net>

* Michael T. Davis schrieb:

> 	I really appreciate all the work you folks have put into answering
> this for me.  I think I'm close to implementing something, but as you may
> have guessed, it's time for me to complicate things, again. (;-)
> 
> 	The whole system I'm developing works like this...  I have some string
> obtained from an environment variable.  I also have a list of potential
> pattern matches in a text file.  My code reads the file and attempts to match
> each pattern against the env. string until it hits the end-of-file or a match
> occurs.  Each line from the data file is the argument to a case-insensitive
> regex match (i.e. "m//i", or -- for the pattern "<pattern>" read from the
> file -- "m/(<pattern>)/i"), so the code looks something like this:
> 
> [...]
> # $string is value obtained from environment
>               while ( $pattern = <> ) {
>                   $pattern = '(' . $pattern . ')';
>                   last if ( $match ) = $string =~ /$pattern/i;
> [...]         }
> 
> Since $pattern is basically just what's being read in from the data file, I'm
> looking for a way to handle anagram matching within it.  Here's something
> along these lines (though it's not correct):
> 
>           \sg((?i)[a-z]+?)s?\W(?{anagram($+,'host','houl','remlin')})
> 
> (The Perl code might include "use re 'eval'" [I know...nasty], and will include
> "sub anagram {...}".)  I'm having trouble understanding how I might trigger a
> match for the whole regex iff (if and only if) the result returned by anagram()
> indicates a match. 

I think, Abigail has shown such a trick in this thread. Scout about:

    (?(?{grep {$_} values %h})(?!)|)
    
The inner (?{code}) is what you want to eval, surrounded by a construct
called

    (?(condition)yes-pattern|no-pattern)

in `perldoc perlre`. Furthermore, (?!) never matchs, while the empty
pattern matchs always.

> (If there's a way to avoid "use re 'eval'", that would be
> helpful, too.)

You're reading the patterns from a file, so you have them in vars. And
one has to use use re 'eval' if you have (?{code}) blocks and variable
interpolation in one regex. But, have you read `perldoc re` already?
Especially:

    For the purpose of this pragma, interpolation of precompiled regular
    expressions (i.e., the result of qr//) is not considered variable
    interpolation. Thus:

        /foo${pat}bar/

    is allowed if $pat is a precompiled regular expression, even if $pat
    contains (?{ ... }) assertions.

Perhaps this precompilation could help you.

regards,
fabian


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

Date: 21 Apr 2005 12:20:18 -0700
From: "TimmyD" <DillerTim@JohnDeere.com>
Subject: OLE & Excel - Opening causes Excel.exe to hang around
Message-Id: <1114111218.646177.173200@o13g2000cwo.googlegroups.com>

This is a very simple script (proof of concept) that simply either
opens an Excel workbook or creates a new one.  When I run this script
(with -w of course:) with the Add line uncommented, EXCEL.EXE starts
when the application object is created and closes when the script is
done.  However, when I run it with the Open line uncommented, EXCEL.EXE
stays running (in process list) once the script is done.  The only way
to get rid of it is to kill it in the Task Manager.  Has anyone out
there had this same problem and knows what I'm doing wrong?  BTW: I'm
using ActiveState perl v5.8.4

<START CODE>
use Win32::Ole qw(in with);
use strict;
use Cwd;

do_it();

sub do_it() {
	my $Excel = "";
	my $Book = "";
	my $key = "";
	my $Sheet = "";
	my $current_path = "";
	my $full_path_and_filename = "";
	my $filename = "";
	my @UserStatArray = ();

	print "Doing it...\n";
	$Excel = Win32::OLE->new( 'Excel.Application',sub { $_[0]->Quit; } )
	or die_nice("Couldn't start Excel to read DTC Spreadsheet!");
	$current_path = getcwd;
	$filename = "blah.xls";
	$full_path_and_filename = $current_path.'/'.$filename;

	#If the line below (Open) is used, EXCEL.EXE
        #stays running (in process list) after the script exits.
	#$Book = $Excel->Workbooks->Open($full_path_and_filename,0,1);
	#If the line below (Add) is used, EXCEL.EXE
        #terminates when the script exits.
	$Book = $Excel->Workbooks->Add;

	$Sheet = $Book->Worksheets(1);
	sleep(1);
	$Excel->ActiveWorkbook->Close(0);
	$Excel->Quit;
	undef $Sheet;
	undef $Book;
	undef $Excel;
}
<END CODE>



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

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


Administrivia:

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

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

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

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

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


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


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