[9891] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3484 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 19 15:07:32 1998

Date: Wed, 19 Aug 98 12:00:28 -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, 19 Aug 1998     Volume: 8 Number: 3484

Today's topics:
        "+<" vs "+>>" (was Re: Opening a file as "+>>file") <upsetter@ziplink.net>
    Re: Accessing UDB from perl? ()
    Re: ActivePerl and POSIX <nguyend7@msu.edu>
    Re: Beaver condensed <horsfall@mailcity.com>
    Re: Beaver condensed <gbell@mailcity.com>
    Re: Beaver condensed <klooney@mailcity.com>
    Re: Beaver condensed <aaa.kapoor@mailcity.com>
    Re: Beaver condensed <zzz.kapoor@mailcity.com>
    Re: Bourne shell to Perl translator (Abigail)
    Re: comp.lang.perl.announce redux (David Cantrell)
    Re: comp.lang.perl.newbie <bas@elfin.x-file.org>
    Re: Easy one for you. (Kelly Hirano)
        example for sending mail with perl under win32 <posern@informatik.uni-marburg.de>
        Get HWND from Perl-Tk Window?? a_boxer@my-dejanews.com
        Get HWND from Perl-TK Window?? a_boxer@my-dejanews.com
        HardCoding Images (was: Returning an image from a call  <gt2214a@prism.gatech.edu>
        how to handle a plsql table returned by a stored proced <pjunuthula@hq.caci.com>
        if evaluation fails <sverbrugge@rtl.org>
    Re: Javascript becoming quite similar to perl <sidi@angband.org>
        Last_modified (help with configureing date output) <jeffinfl@ix.netcom.com>
        Mighty Malcolm Beattie! How's the compiler doing? (Michael Schilli)
    Re: Moving in a array? <egwong@netcom.com>
    Re: Moving in a array? (Craig Berry)
    Re: Moving in a array? (Grinch)
    Re: Perl Style <jdporter@min.net>
    Re: Please help with HTTP::Response (Kevin Reid)
    Re: printf question - newbie <egwong@netcom.com>
    Re: problems with  system() command (Ilya Zakharevich)
        retrieving html source from url <rasan@horizonlive.com>
    Re: retrieving html source from url <nguyend7@msu.edu>
    Re: retrieving html source from url <egwong@netcom.com>
    Re: Strange behavior with 'use' (Tye McQueen)
    Re: Tab/Formatting in Perl (Bernie Cosell)
        Very newbie question <molotov@gmx.net>
    Re: Why dont people read the FAQs (Craig Berry)
    Re: wtf is the obsession with "foo" and "bar" (Grinch)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 19 Aug 1998 18:07:24 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: "+<" vs "+>>" (was Re: Opening a file as "+>>file")
Message-Id: <6rf48s$e2u@fridge.shore.net>

Jonathan Feinberg <jdf@pobox.com> wrote:
: phil@ackltd.demon.co.uk (Phil Taylor) writes:

:> 1) Open    (a file containing variable length records)
:> 2) Lock
:> 3) Get Entire Content
:> 4) Massage Content
:> 5) Write Entire Content back to file
:> 6) Close file (releasing lock)

:> What file  mode should I use to Open the file that will allow me to do
:> the above? 

: Have you seen perlfaq5, which contains several examples that are
: directly pertinent to your question?  If so, and you're still having
: troubles, do post an example of what ails you.

Interestingly, I've been spending some time today looking at this same
situation, and perlfaq5 and perlfunc specifically. What's confusing -- and
what may have been confusing the original poster -- is that there are
numerous examples using "+<" (the "good" way to open a file for read/write
access) but no examples using "+>>" (as Randal used in his original,
much-imitated column).

I've just spent a while grepping and reading the docs, but I still can't
discover: 

	Just what is the [practical] difference between opening a file
with a mode of "+<" and "+>>" ??  (and where, if not in the perl docs, is
is it documented?)

--Art

--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: 19 Aug 1998 17:35:19 GMT
From: mhm@loopback.austin.ibm.com ()
Subject: Re: Accessing UDB from perl?
Message-Id: <6rf2cn$1ff0$1@ausnews.austin.ibm.com>

Nathan Eaton (eatonn@msn.com) wrote:

: Hemant Shah wrote in message <6nqs5r$kd$1@flood.xnet.com>...
: >
: >Folks,
: >
: >   Is there a perl library/module I can use to access DB2 UDB on AIX?


: I've been looking into this, and as best I can tell there is not.  I've come
: to the conclusion that the only way I'll be able to get something that works
: is to either use DBD::ODBC with CLI, or talk the guy at IBM in Austin who
: wrote DBD::DB2 (for DB2 common server version 2.x) into coming out with
: something for UDB.  I don't have his address here at the house, but I'll
: look for it at work tomorrow.

CPAN/authors/Mike_Moran/DBD-DB2-0.682.tar.gz  supports both DB2 2.x and UDB

--
#include <Standard_Disclaimer> -----IBM office: 512-823-7883 or tl 793
Michael H. Moran                  | Pager:  800-SKY-ibm1  PIN: 8825437
mhm@austin.ibm.com                | Email2Pager:   8825437@skymail.com
IBM Corporation, Austin, Texas    | Home Off: 512-259-9386 or tl 450-9743


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

Date: 19 Aug 1998 16:51:01 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: ActivePerl and POSIX
Message-Id: <6revpl$2ua$2@msunews.cl.msu.edu>

In comp.lang.perl.misc Tom Adriaenssen <tom@imagic.be> wrote:
: I have a problem with ActivePerl 502 (on Win98) and POSIX.
Your problem is Win98.  All M$ OS's are not IEEE Std 1003.1 (POSIX)
compatible. You shouldn't even try to use the POSIX module, because
it's not supported by your OS.  To be supported try going to this
link.  http://www.linux.org

: What am i doing wrong?
using Billware

-- 
           Dan Nguyen            | There is only one happiness in
        nguyend7@msu.edu         |   life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 |                   -George Sand



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

Date: 19 Aug 1998 18:45:28 GMT
From: "000.kapoor@mailcity.com 1" <horsfall@mailcity.com>
Subject: Re: Beaver condensed
Message-Id: <35D51328.6EF7@xyz.com>

>You're right.  He only needs one if he wants to establish the FACT that he
>is innocent of murder. What he has now is the legal PRESUMPTION that he is
>innocent of murder  -- not remotely the same thing.

kasa mia kopla

Not at all. The jury found OJ "not guilty" in the criminal case. It did not
find him "innocent." While "not guilty" may reflect the defendant's actual
innocence, more often it simply means that the prosecution did not prove the
defendant guilty beyond a reasonable doubt (similar to the Scottish verdict
of "not proven").



Criminal juries do *not* determine guilt or innocence. They determine guilt
or "not proven guilty".

--
Brett

*****************************************************************
* Personal Injury/Malpractice                        Bankruptcy *
*                                                               *
*                                                               *
* Small Business                      Estates & Estate Planning *
*****************************************************************

The Small Print: This response is for discussion purposes only. It isn't
meant to be legal advice and you shouldn't treat it as such. If you want
legal advice, speak with a local lawyer familiar with your state's laws who
can review *all* of the facts and the law applicable to your situation.
*****************************************************************

Sneetch wrote in message ...


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

Date: 19 Aug 1998 18:46:22 GMT
From: "gbell@mailcity.com 3" <gbell@mailcity.com>
Subject: Re: Beaver condensed
Message-Id: <35D51328.6EF8@xyz.com>

>You're right.  He only needs one if he wants to establish the FACT that he
>is innocent of murder. What he has now is the legal PRESUMPTION that he is
>innocent of murder  -- not remotely the same thing.

kasa mia kopla

Not at all. The jury found OJ "not guilty" in the criminal case. It did not
find him "innocent." While "not guilty" may reflect the defendant's actual
innocence, more often it simply means that the prosecution did not prove the
defendant guilty beyond a reasonable doubt (similar to the Scottish verdict
of "not proven").



Criminal juries do *not* determine guilt or innocence. They determine guilt
or "not proven guilty".

--
Brett

*****************************************************************
* Personal Injury/Malpractice                        Bankruptcy *
*                                                               *
*                                                               *
* Small Business                      Estates & Estate Planning *
*****************************************************************

The Small Print: This response is for discussion purposes only. It isn't
meant to be legal advice and you shouldn't treat it as such. If you want
legal advice, speak with a local lawyer familiar with your state's laws who
can review *all* of the facts and the law applicable to your situation.
*****************************************************************

Sneetch wrote in message ...


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

Date: 19 Aug 1998 18:47:13 GMT
From: "klooney@mailcity.com 4" <klooney@mailcity.com>
Subject: Re: Beaver condensed
Message-Id: <35D51328.6E10@xyz.com>

>You're right.  He only needs one if he wants to establish the FACT that he
>is innocent of murder. What he has now is the legal PRESUMPTION that he is
>innocent of murder  -- not remotely the same thing.

kasa mia kopla

Not at all. The jury found OJ "not guilty" in the criminal case. It did not
find him "innocent." While "not guilty" may reflect the defendant's actual
innocence, more often it simply means that the prosecution did not prove the
defendant guilty beyond a reasonable doubt (similar to the Scottish verdict
of "not proven").



Criminal juries do *not* determine guilt or innocence. They determine guilt
or "not proven guilty".

--
Brett

*****************************************************************
* Personal Injury/Malpractice                        Bankruptcy *
*                                                               *
*                                                               *
* Small Business                      Estates & Estate Planning *
*****************************************************************

The Small Print: This response is for discussion purposes only. It isn't
meant to be legal advice and you shouldn't treat it as such. If you want
legal advice, speak with a local lawyer familiar with your state's laws who
can review *all* of the facts and the law applicable to your situation.
*****************************************************************

Sneetch wrote in message ...


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

Date: 19 Aug 1998 18:47:37 GMT
From: "aaa.kapoor@mailcity.com 6" <aaa.kapoor@mailcity.com>
Subject: Re: Beaver condensed
Message-Id: <35D51328.6E11@xyz.com>

>You're right.  He only needs one if he wants to establish the FACT that he
>is innocent of murder. What he has now is the legal PRESUMPTION that he is
>innocent of murder  -- not remotely the same thing.

kasa mia kopla

Not at all. The jury found OJ "not guilty" in the criminal case. It did not
find him "innocent." While "not guilty" may reflect the defendant's actual
innocence, more often it simply means that the prosecution did not prove the
defendant guilty beyond a reasonable doubt (similar to the Scottish verdict
of "not proven").



Criminal juries do *not* determine guilt or innocence. They determine guilt
or "not proven guilty".

--
Brett

*****************************************************************
* Personal Injury/Malpractice                        Bankruptcy *
*                                                               *
*                                                               *
* Small Business                      Estates & Estate Planning *
*****************************************************************

The Small Print: This response is for discussion purposes only. It isn't
meant to be legal advice and you shouldn't treat it as such. If you want
legal advice, speak with a local lawyer familiar with your state's laws who
can review *all* of the facts and the law applicable to your situation.
*****************************************************************

Sneetch wrote in message ...


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

Date: 19 Aug 1998 18:47:57 GMT
From: "zzz.kapoor@mailcity.com 7" <zzz.kapoor@mailcity.com>
Subject: Re: Beaver condensed
Message-Id: <35D51328.6E12@xyz.com>

>You're right.  He only needs one if he wants to establish the FACT that he
>is innocent of murder. What he has now is the legal PRESUMPTION that he is
>innocent of murder  -- not remotely the same thing.

kasa mia kopla

Not at all. The jury found OJ "not guilty" in the criminal case. It did not
find him "innocent." While "not guilty" may reflect the defendant's actual
innocence, more often it simply means that the prosecution did not prove the
defendant guilty beyond a reasonable doubt (similar to the Scottish verdict
of "not proven").



Criminal juries do *not* determine guilt or innocence. They determine guilt
or "not proven guilty".

--
Brett

*****************************************************************
* Personal Injury/Malpractice                        Bankruptcy *
*                                                               *
*                                                               *
* Small Business                      Estates & Estate Planning *
*****************************************************************

The Small Print: This response is for discussion purposes only. It isn't
meant to be legal advice and you shouldn't treat it as such. If you want
legal advice, speak with a local lawyer familiar with your state's laws who
can review *all* of the facts and the law applicable to your situation.
*****************************************************************

Sneetch wrote in message ...


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

Date: 19 Aug 1998 17:50:42 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Bourne shell to Perl translator
Message-Id: <6rf39i$4nc$2@client3.news.psi.net>

Adel Elcheikh (ehselch@ehf.ericsson.se) wrote on MDCCCXIV September
MCMXCIII in <URL: news:35DADE50.370E35DC@ehf.ericsson.se>:
++ Hi everybody ,
++ 
++ Novice Perl question :
++ 
++ Is there any soft that converts Bourne shell scripts to Perl scripts?


system ().



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: Wed, 19 Aug 1998 17:13:14 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: comp.lang.perl.announce redux
Message-Id: <35e001cb.24618349@thunder>

On Wed, 19 Aug 1998 11:47:55 -0400,
  phenix@interpath.com (John Moreno) enlightened us thusly:

>Daniel Adams <dan@fearsome.net> wrote:
>
>> Actually, Paddy was entirely correct in what he said. The language known as
>> English is documented in dictionaries such as the Oxford English Dictionary.
>> American English, whilst stemming from the same origins as British English,
>> is sufficiently different to be classified as a different language. That is
>> why many products ship with electronic dictionaries in which American
>> English and British ENglish are two options.
>
>This is of course ridiculous - please, a hundred words that are British
>English and not American English (no slang or food please).

Just to get started then, words which are common in British English
and which either have different meanings or aren't used in American
English ;-)

boot (merkan* 'trunk')
pavement (merkan 'sidewalk')
railway (merkan 'railroad')
almost (merkan 'most', as in merkan 'most all' and british 'amost
        all')
couldn't (merkan 'could' as in merkan 'could care less' which is just
          WRONG because they really mean 'don't care at all', as in
          'could NOT care less')
pissed (not to be confused with british 'pissed off' which is
        something else entirely)
cider (as opposed to british 'apple juice')
hash (merkan 'pound', meaning the '#' sign)
gallon (which is a different amount of liquid in merkan and british)
faggot (a bundle of sticks (or a meal), of course)
nappy (merkan 'diaper')

Listing a hundred words with their definitions and usage examples
would be rather boring so I'll leave it at that.  Actually, some of
the above _are_ slang, but that doesn't matter.  Slang terms are just
as much a part of the language as respectable words are.

Currently, use pretty nearly identical vocabularies, but they are
diverging as the meaning of words changes is different ways.  However,
our vocabularies are diverging, and we put our sentences together in
subtlely different ways.  We are currently mutually intelligible, at
least when writing.

* - merkan is easier to type than 'american' and corresponds better to
my pronunciation to boot.  It is not meant to be derogatory in case
there are highly sensitive souls out there in merka reading this.
Please don't confuse it with 'merkin' ;-)

--
David Cantrell, part-time NT/java/SQL techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: Wed, 19 Aug 1998 14:22:09 +0000
From: bas <bas@elfin.x-file.org>
Subject: Re: comp.lang.perl.newbie
Message-Id: <d2be187848%bas@cybernexus.demon.co.uk>



Kiji ga <1ddzb6p.gpz5h719qeg8wN@bay1-205.quincy.ziplink.net>
          rjk@coos.dartmouth.edu (Ronald J Kimball) ga hakumashita:

> > Especially with a language like Perl ... that gives you enough rope
> > to bury yourself.
> 
> Okay, I have to ask...  How much rope does it take to bury yourself?

That's an easy one -- twice half the length of the rope, of course.

b.

-- 
  "You can see and you can hear, but from inside the tomb of your mind,
   no breath will escape your lips, no tears your eyes; to the world you
   are dead, and soon even your precious father will forget you were ever
   alive.  But you, my dear, you will have all eternity to remember."


Version: 2.6.3ia
Charset: noconv

iQCVAwUBNdrf00THjBg7TqfBAQHS3AP/Z6+3x/bcLRZDuItd1AxLrdrOLVOkFSmG
Kljyz4LffapxoULHGF1fSIrLHiWgRjC+gsIik9euPdb81LrxkbVuDby3bqjuXJBN
cP7Yga1K8qgKoI8UX13yPvlqGOgt+CZf/zHmRzLocIs/xNtPMc2GqYuwjLOZFh9p
+CR314ya0vo=
=QD9X
-----END PGP SIGNATURE-----



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

Date: 19 Aug 1998 10:50:23 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: Easy one for you.
Message-Id: <6rf38v$acv@Xenon.Stanford.EDU>

In article <slrn6tkgt5.3oq.gabor@guava.vmunix.com>,
Gabor <gabor@vmunix.com> wrote:
>In comp.lang.perl.misc, Kelly Hirano <hirano@Xenon.Stanford.EDU> wrote :
># In article <Pine.GSO.3.96.980817200902.291D-100000@expert.cc.purdue.edu>,
># Jonathan M. Hartman <cajun@cyberspace.org> wrote:
># >OK. I'll admit it. I'm a newbie at this. I am trying to parse out a string
># >that has pipes seperating the values. I'd like to just load them into an
># >array, but I can't figure out the proper syntax for the split function...
># >The string I am trying to parse looks like the following:
># >
># >2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd
># >
># >How can I do this? I have several of these that I am reading from a file,
># >and want to use a foreach loop to deal with each of them in turn.
># >
># 
># geez, there was just another thread about how to split a comma-delimited
># string...
># 
># man perl
># perldoc -f split
># 
># my $line = qq!2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd!;
># my @array = split(/|/, $line);
>
>Too bad that a | is a special character in a regex. ;)  Maybe you should
>take your own advice and 'man perl'.

okay, i can see that everyone is jumping on my mistake. it was a mental fart.
i was wrong. i should have checked my code before posting, etc, etc.

<rant>
now, to all of you following up this error with comments about how it is
wrong, please learn how to traverse the thread tree. not only have i followed
up my error (okay, followed up abigail's post telling me that i was wrong),
but several others have followed up as well. as a matter of fact, i've even
gotten two emails telling me i'm wrong. thank you to all for pointing out my
mistake. but really, i don't need to hear about it that many times. do
everyone a favor and check the thread tree of responses before following up a
post -- it is likely that someone has followed it up already with the same
comments that you were going to make. my followup post's id is:
 
6rapir$39p@Xenon.Stanford.EDU
</rant>

then again, i guess everyone else's news servers aren't as fast as mine. russ
rules!

thanks for listening and sorry for posting meta crap.
-- 
Kelly William Hirano	                    Stanford Athletics:
hirano@cs.stanford.edu	                 http://www.gostanford.com/
hirano@alumni.stanford.org      (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20


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

Date: 19 Aug 1998 18:21:30 GMT
From: "K.Posern" <posern@informatik.uni-marburg.de>
Subject: example for sending mail with perl under win32
Message-Id: <35DB1712.3182BE68@informatik.uni-marburg.de>

Hi.

I am hardly interested in an example, how to send a short email with
perl under a win32-System by direct connecting to the mailhost and using
the SMTP-Protokoll-commands.

It would be very GREAT if someone has such code, or knows where to get
it!

Thanks a LOT - already right here.

Bye.

Knuth.



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

Date: Wed, 19 Aug 1998 17:29:32 GMT
From: a_boxer@my-dejanews.com
Subject: Get HWND from Perl-Tk Window??
Message-Id: <6rf21s$uif$1@nnrp1.dejanews.com>

I am writing a GUI with Perl-Tk, and want to pass the HWND to
a custom graphics routine. The routine will be wrapped with SWIG.
Does anyone know how I can get this information?

Thanks,

Aaron Boxer

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


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

Date: Wed, 19 Aug 1998 17:36:48 GMT
From: a_boxer@my-dejanews.com
Subject: Get HWND from Perl-TK Window??
Message-Id: <6rf2fg$vb4$1@nnrp1.dejanews.com>

I am writing a GUI in Perl using Tk, and I have
a custom graphics routine wrapped with SWIG. I want
to grab the HWND of the Tk main window, and pass it
in to do the bit blitting. Does anyone know how to do this?

thanks,

Aaron Boxer

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


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

Date: Wed, 19 Aug 1998 13:50:16 -0400
From: Alejandro Lay <gt2214a@prism.gatech.edu>
To: Hiram Chirino <chirino@eng.usf.edu>
Subject: HardCoding Images (was: Returning an image from a call to a script)
Message-Id: <35DB1058.C56BED15@prism.gatech.edu>

Call me stupid, but is there any way to encode the image's properties
and send them back as the output of the script since that is what the
browser is requesting??? (Even if I need to hard code that info)
The problem still remains that my service provider will probably
not install any modules or "extra" programs required to do this.

> Yeah the script gets executed because the the brower requests the script's
> output and then tries to load the script's output as an image (at least
> the way you have it coded. )  To do what you want to do, you need
> something like ePerl, the "Embedded Perl" language
> http://www.ch.engelschall.com/sw/eperl/


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

Date: Wed, 19 Aug 1998 14:21:10 -0400
From: "Padma Junuthula" <pjunuthula@hq.caci.com>
Subject: how to handle a plsql table returned by a stored procedure
Message-Id: <TDEC1.430$nY4.178061359@newsreader.digex.net>

I wrote a stored procedure which returns a pl/sql table.  My question is how
to access pl/sql table in perl using dbi.  thanks for any responses




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

Date: Wed, 19 Aug 1998 13:16:19 -0400
From: sverbrugge <sverbrugge@rtl.org>
Subject: if evaluation fails
Message-Id: <35DB0863.77A7556D@rtl.org>

Hi,

I am really new to perl.  I am trying to construct an expression in a
subroutine.  Then, I use the returned expression as the condition of
"if".  It doesn't work.  why???

Please help.  Thank you very much.

Sherrill (Pei-chih) Verbrugge
sverbrugge@rtl.org

The following is my code:

# findext3.pl is a test file for evaluating extensions
# in the command line you can type in
# perl findext3.pl c:\temp\test.txt prg (this should be no match)
# perl findext3.pl c:\temp\test.txt txt (this should match)
# Author: Sherrill (Pei-chih) Verbrugge

@test = @ARGV;
$NameToProcess = uc($ARGV[0]);

$myReturn = &ext(@test);


if ($myReturn) {
 print "$NameToProcess : the ext matches\n";
 }else {
 print "$NameToProcess: no match\n";
 }


sub ext{
@myInputs = @_;
my $mystring;

for($i=1; $i<= $#myInputs; $i++){
 if ($i == $#myInputs) {
  $mystring .= '($NameToProcess =~ /' . uc($myInputs[$i]). '$/)';
  } else {
   $mystring .= '($NameToProcess =~ /' . uc($myInputs[$i]) . '$/) ||';
   }

}
return $mystring;
}

print "\n";




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

Date: 19 Aug 1998 18:21:38 GMT
From: Chris Sidi <sidi@angband.org>
Subject: Re: Javascript becoming quite similar to perl
Message-Id: <6rf53i$frd$2@news-int.gatech.edu>

Yong Huang <yong@shell.com> wrote:
> So what?

Well I wonder if anyone is going to point out that perl and javascript
both borrow from Language X, or comment on how netscape is borrowing so
heavily from perl.  Or maybe these methods and names are fairly standard
and I haven't programmed in enough other languages to know. 

I want to see what other people think...

-Sidi



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

Date: Wed, 19 Aug 1998 14:55:59 -0400
From: Jeff Litwiller <jeffinfl@ix.netcom.com>
Subject: Last_modified (help with configureing date output)
Message-Id: <35DB1FBF.DD8FEDD9@ix.netcom.com>

I have been struggling with this but have not found the answer. I want
to configure how the date is displayed when I ask for LAST_MODIFIED. I
am able to configure the date when I put it in as a SSI :
<!--#config timefmt="%A, %B %e %Y %I:%M %p"-->
<!--#echo var="LAST_MODIFIED"-->
The first part configures my date output.
Now I want to do that in a cgi with a page count and call it through SSI
like :
<!--#exec cgi="/cgi-bin/count_lstmod.cgi"-->
The best answer so far was :
#!/usr/bin/perl

require "ctime.pl";

$last_updated = &ctime (time);
print "Last updated $last_updated\n";

It prints out a easier to read date and time.

Please post and email me with an answer.

Thanks

Jeff Litwiller
jeff@derdutchmanfl.com



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

Date: 19 Aug 1998 18:04:10 GMT
From: schilli@tep.e-technik.tu-muenchen.de. (Michael Schilli)
Subject: Mighty Malcolm Beattie! How's the compiler doing?
Message-Id: <6rf42q$b8p$1@sparcserver.lrz-muenchen.de>

Hi all,

just wondering about the Perl Compiler Kit announcement for 5.005, but
as it looks, it's still the same alpha-something stuff that has been
around for some time.

I tried to compile a "howdy world" program, there were dozens of warnings,
but it finally worked.

On the other hand, I tried to compile a CGI script using "use CGI;" which
failed miserably (frontend locks up).

Are there any plans on additional compiler development?

Thanks,

--
Michael 


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

Date: Wed, 19 Aug 1998 18:28:23 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: Moving in a array?
Message-Id: <egwongExy8nB.2u@netcom.com>

Ravi Malghan <rmalghan@site.gmu.edu> wrote:
[ cut ]

: while( certain condition)
: {
: I would like to move through each fo the lines in the array @trapd_file
: whicle this condition is true. How do I increment array. @trapd_file[i++]
: or $trapd_file[i++] is not working.
: }

As someone else said, the "i++" ought to be "$i++".  Also,
you could use a foreach loop instead of while:
  foreach ( @trapd_file ) {
    last if ( condition );
    ...
  }

Depending on what you want to do, you might put the last
before or after the rest of the block.

[cc'd]


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

Date: 19 Aug 1998 18:28:26 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Moving in a array?
Message-Id: <6rf5ga$3po$1@marina.cinenet.net>

Ravi Malghan (rmalghan@site.gmu.edu) wrote:
: I am a perl beginner and need some help.
: 
: I have the following lines:
: $file = trapd.log;

You're missing quotes on the right-hand side of this assignment.  Are you
not using -w?  You really, really, *really* should -- it'd warn you about
stuff like this.

: open (f_handle, $file);

By convention, filehandle names are usually ALL_UPPERCASE.  Following this
convention makes it easier for others to scan your code, and easier for
you to scan others' code.

Also, and more importantly, you should *always* check whether open()
succeeded.  The common form is:

  open F_HANDLE, $file or die "Cannot open $file: $!\n";

The $! in there will contain the specific error message explaining why the
file could not be opened.

: @trapd_file = <f_handle>;
: close(f_handle);
: 
: $pattern = 10;
: 
: while( certain condition)
: {
:
: I would like to move through each fo the lines in the array @trapd_file
: whicle this condition is true. How do I increment array. @trapd_file[i++]
: or $trapd_file[i++] is not working.
: }

Note that i should be $i in both cases, and that your first form is an
array slice, almost certainly not what you want.

The preferred form of walking through an array until some condition is not
met would be:

  foreach my $line (@trapd_file) {
    last unless -condition-;   # Insert your still-ok test here.
    -process $line-
  }

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Wed, 19 Aug 1998 18:53:21 GMT
From: spam@whoville.com (Grinch)
Subject: Re: Moving in a array?
Message-Id: <35e31c5d.145805598@news.shore.net>

On 19 Aug 1998 16:02:15 GMT, rmalghan@site.gmu.edu (Ravi Malghan)
wrote:

>Hello:
>I am a perl beginner and need some help.
>
>I have the following lines:
>$file = trapd.log;
>open (f_handle, $file);
>@trapd_file = <f_handle>;
>close(f_handle);
>
>$pattern = 10;
>
>while( certain condition)
>{
>I would like to move through each fo the lines in the array @trapd_file
>whicle this condition is true. How do I increment array. @trapd_file[i++]
>or $trapd_file[i++] is not working.
>}

There's more than one way to do it, but it seems a bit wasteful to
read in the whole file if you're only interested in part of it.

Here's how I'd do it:

$file = 'trapd.log';

# Note the error handling here!
open(f_handle, $file) or die "Could not open log file";

# Loop through the file, no counter needed
while ( $this_line = <f_handle> ) {

    # Bail out of the loop if $foo evaluates to true
    last if ($foo);

}

close(f_handle);

HTH!

-grinch



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

Date: Wed, 19 Aug 1998 13:37:44 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl Style
Message-Id: <35DB0D68.1566@min.net>

Zenin wrote:
> 
> John Porter <jdporter@min.net> wrote:
> : By that token (:-) it can be considered a "bug" to argue that
> : one should use "or" for readability.
> 
> Yes, this is my point.
> 
> : I use "or" for exactly
> : one reason: it's a low-precedence alternation conjunction.
> 
> Yes, for exactly the "right" reason. :-)
> 
> : So what if it's written "or".  As has been pointed out, it could
> : have been any cryptic sequence of chars... \/ or whatever.
> 
> Again, this is my point, more or less.

Well, I'm glad you and I agree.
But I really couldn't tell what your point was, before, since you
never actually stated your point.  I, otoh, tend to be quite blunt.

-- 
John Porter


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

Date: Wed, 19 Aug 1998 14:43:47 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Please help with HTTP::Response
Message-Id: <1ddzb4h.5wsd99c04mrkN@slip166-72-108-134.ny.us.ibm.net>

Jon C. Hodgson <jon@resonate.com> wrote:

> Help!
> 
> I've been programming PERL for a long time, but I a real newbie to OOP
> stuff.
> 
> I need to substitute patterns in the $response->content() object before
> I print it.
> 
> I can print:
>       $response=$ua->request($request);
>       print $response->content();
> 
> 
> But I need to be able to subtitute globally one pattern for another:
> 
>         s/pattern1/pattern2/g
> 
> before I print the content.
> 
> 
> Is there a way to convert the $response->content() object to text that I
> can step thru & process?

$response = $ua->request($request);
$text = $response->content;
$text =~ s/a?bc?/bcbab/g;
print $text;

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Wed, 19 Aug 1998 18:47:06 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: printf question - newbie
Message-Id: <egwongExy9IJ.1LM@netcom.com>

horseyride@hotmail.com wrote:
: Whats the proper way to replace the leading spaces from the %10s with leading
: zeroes?

: printf log2 "%10s","$count";

: I read the FAQ. I read the FM. Maybe I'm just dumb.

Maybe.  If you're on a unix-y system, read the printf(3)
manpage.  Basically, to add zero padding, just put a '0'
after the '%'.  That is:
  printf log2 "%010s", $count;

By the way, if $count is always a number (which seems
likely to me), you might use the "d" conversion character
instead of "s" for clarity.  Also, personally, I think
the liberal use of parens makes code easier to read
and maintain.
  printf log2 ("%010d", $count);

 .Eric

[cc'd]


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

Date: 19 Aug 1998 18:41:07 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: problems with  system() command
Message-Id: <6rf683$t8k$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Dermot McKay
<MCKAYD@aplbt1.agw.bt.co.uk>],
who wrote in article <6repjp$ng6$1@pheidippides.axion.bt.co.uk>:
> >If i execute directly on the command line it works without any problem,
> >but if i include it in a PERL script in the following way :
> > 
> >system ("u/up/mack/bin/plaire/pgm/lfac pb <
> >u/up/mack/bin/plaire/temp/lfac18.drv"),that doesn't work and i got these
> >messages :

> You could try
> system ("u/up/mack/bin/plaire/pgm/lfac", "pb", 
> "<", "u/up/mack/bin/plaire/temp/lfac18.drv");

Better not.  But I wonder what *exactly* should we recommend to a
person who errs that far...

Ilya


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

Date: Wed, 19 Aug 1998 14:12:54 -0400
From: Rasan Rasch <rasan@horizonlive.com>
Subject: retrieving html source from url
Message-Id: <35DB15A5.4E60D274@horizonlive.com>

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

Hi,

Is there a way to connect to a URL and read the contents of an .html
file as if I were just reading something on my own file system, e.g. $in
= new IO::File(somefile)?

--------------830C314A360823B8386DC4E5
Content-Type: text/x-vcard; charset=us-ascii;
 name="rasan.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Rasan Rasch
Content-Disposition: attachment;
 filename="rasan.vcf"

begin:vcard
n:Rasch;Rasan
tel;work:212-533-1775
x-mozilla-html:FALSE
org:Horizon Live Distance Learning
adr:;;841 Broadway Suite 502;New York;NY;10003
version:2.1
email;internet:rasan@horizonlive.com
title:Developer
fn:Rasan Rasch
end:vcard


--------------830C314A360823B8386DC4E5--



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

Date: 19 Aug 1998 18:31:07 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: retrieving html source from url
Message-Id: <6rf5lb$kfs$1@msunews.cl.msu.edu>

Rasan Rasch <rasan@horizonlive.com> wrote:
: Hi,

: Is there a way to connect to a URL and read the contents of an .html
: file as if I were just reading something on my own file system, e.g. $in
: = new IO::File(somefile)?

Try the LWP modules.  LWP::Simple is simple.

: --------------830C314A360823B8386DC4E5
: Content-Type: text/x-vcard; charset=us-ascii;
[snip]
I HATE (strongly dislike) VCARDs.

-dan




-- 
           Dan Nguyen            | There is only one happiness in
        nguyend7@msu.edu         |   life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 |                   -George Sand



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

Date: Wed, 19 Aug 1998 18:36:50 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: retrieving html source from url
Message-Id: <egwongExy91F.rJ@netcom.com>

Rasan Rasch <rasan@horizonlive.com> wrote:

: Hi,

: Is there a way to connect to a URL and read the contents of an .html
: file as if I were just reading something on my own file system, e.g. $in
: = new IO::File(somefile)?

This is in perlfaq9 ("How do I fetch an HTML file?")

[ cc'd ]


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

Date: 19 Aug 1998 13:19:44 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: Strange behavior with 'use'
Message-Id: <6rf500$p8c@fumnix.metronet.com>

John Porter <jdporter@min.net> writes:
) 
) My understanding is that only applies to the require, not to the
) import.  And evem when I tried adding an explicit call to import,
) it made no difference: package b still didn't get the exports 
) from package a.  I know the import was getting called; it just 
) didn't seem to do its job right.
) OTOH, if I put the import call *inside* sub testb, then it
) worked.

Has to do with import beging called before @ISA is set.

Consult http://www.dejanews.com/ for more info.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Wed, 19 Aug 1998 17:41:50 GMT
From: bernie@fantasyfarm.com (Bernie Cosell)
Subject: Re: Tab/Formatting in Perl
Message-Id: <35dc0870.54134706@news.swva.net>

} I was wondering whether there is a way in perl other than the "format"
} syntax to print at certain column values.
} 
} eg.
} 
} This       is a       test
} 
} I want to print "This" at column 0
} "is" at column 9,
} "a" at column 11,
} "test" at column 23 etc etc.

I've used 'format' but I almost always find it pretty cumbersome, and so I
usually achieve this effect with printf.  For this case, for example,
almost without thinking I'd do:

    printf ("%9s%2s%12s....", "This", "is", "a", "test", ...);

 /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: 19 Aug 1998 18:34:52 GMT
From: "Mr. Molotov" <molotov@gmx.net>
Subject: Very newbie question
Message-Id: <6rf5sc$mgb@news.euro.net>

Hi,

I'm really new to Perl, just installed ActivePerl 5.02, but with the online
documentation, all the examples fail (don't show anything that shows that
Perl works)... I'm using Win98 (so the browser is IE4.0). Please? Can
someone help me out? Thanks!

M




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

Date: 19 Aug 1998 17:50:21 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Why dont people read the FAQs
Message-Id: <6rf38t$1al$1@marina.cinenet.net>

Russ Allbery (rra@stanford.edu) wrote:
: If you *are* worried about trailing newlines and hence don't want to use
: the /^\d{16}$/ solution, you could write that as:
: 
:         unless (length ($CCNumber) == 16 && $CCNumber !~ /\D/)
: 
: A minor point, but I see a lot of regexes that aren't really minimal; it
: usually turns out that there's a simpler way of writing the regex than one
: would think on first try.

This is a great example of my favorite regex hint:  If specifying what you
*do* want is getting too complicated, give specifying what you *don't*
want a try, and vice versa; it's often the case that one is a lot easier
than the other. 

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Wed, 19 Aug 1998 18:15:41 GMT
From: spam@whoville.com (Grinch)
Subject: Re: wtf is the obsession with "foo" and "bar"
Message-Id: <35e0153d.143980538@news.shore.net>

On Wed, 19 Aug 1998 11:07:57 -0500, Yong Huang <yong@shell.com> wrote:

>I remember reading an answer to this question probably at comp.lang.c. It's said
>"foo" and "bar" originate from the military. As for the details, I didn't care to
>remember.

WWII fighter pilots reported seeing a number of unknown flying
objects, and referred to these objects as "Foo Fighters."

This could be taken as evidence that the use of the term "foo" to
refer to an unknown actually predates its use in the computer
industry.

-grinch



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

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

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