[8963] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2580 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 13 12:40:31 1998

Date: Wed, 13 May 98 09:00:48 -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, 13 May 1998     Volume: 8 Number: 2580

Today's topics:
    Re: `back ticks` ? <br@ndon.com>
    Re: `back ticks` ? <jdf@pobox.com>
    Re: `back ticks` ? (*/chebs )
    Re: Another flock question... <jdf@pobox.com>
    Re: Another flock question... <rootbeer@teleport.com>
    Re: Apache and authentication <marcs@znep.com>
    Re: CGI: Page output during process <jdf@pobox.com>
    Re: Does Perl have a IDE?I don't like command line. <keithmur@mindspring.com>
    Re: Does Perl have a IDE?I don't like command line. (I R A Aggie)
    Re: Does Perl have a IDE?I don't like command line. (I R A Aggie)
    Re: Does Perl have a IDE?I don't like command line. (John Moreno)
    Re: Finding Open Client libs <rootbeer@teleport.com>
    Re: Get file date <andrewf@cp.pathfinder.com>
    Re: Get file date <angst@scrye.com>
    Re: How can you break out of a 'while... ' loop in a fu <jdf@pobox.com>
    Re: How can you break out of a 'while... ' loop in a fu (Stuart Wright)
    Re: How can you break out of a 'while... ' loop in a fu (Stuart Wright)
    Re: How can you break out of a 'while... ' loop in a fu (Abigail)
    Re: Installing PERL on NT <dfetter@shell4.ba.best.com>
    Re: Is if ($a="something") a bad style? (Shaun Sides)
    Re: Is if ($a="something") a bad style? <rootbeer@teleport.com>
    Re: Is if ($a="something") a bad style? <angst@scrye.com>
    Re: Is if ($a="something") a bad style? (John Moreno)
        Kill an NT process? <kliou@ichat.com>
    Re: Learning Perl vs Programming Perl (Books) <Gregory.Rebuck@digital.com>
        Matching period with regular expression <jmurray@mfg.sgi.com>
        Modules:  why doesn't this work? (Erik Y. Adams)
    Re: Modules:  why doesn't this work? (Mike Stok)
    Re: Nuclear bombing of NEW YORK! Small countries can ta <keithmur@mindspring.com>
        ODBC.pm: Is there a size limit to SQL statements? (Andy Lester)
    Re: Perl script on Internet Information Server <kliou@ichat.com>
    Re: PROFESSIONAL PERL TRAINING <beske@worldnet.att.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 13 May 1998 10:14:59 -0400
From: Brandon Golm <br@ndon.com>
Subject: Re: `back ticks` ?
Message-Id: <3559AAE3.32C0302F@ndon.com>

*/chebs wrote:
> 
> Hi all
> I'm trying to set a files permission from a perl script using
> 
> `chmod 0777 $file`;

man perlfunc

there's a chmod function built right into perl.

Good luck.

> 
> It works when script created the file [upload] or from the shell but
> not if I call the script via a browser
> 
> I have studied several 'works from the command line not as cgi' posts
> But haven't found an answer yet.
> 
> I have tried system() and qx/ but I didn't think 'chmod' returned anything.
> 
> Any help would be a great help.
> 
> Thanks!
> chebs


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

Date: 13 May 1998 10:32:16 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: chebs@elfin.org (*/chebs )
Subject: Re: `back ticks` ?
Message-Id: <pvhifapr.fsf@mailhost.panix.com>

chebs@elfin.org (*/chebs ) writes:

> I'm trying to set a files permission from a perl script using
>  
> `chmod 0777 $file`;

Why not use the chmod() builtin?  That will tell you why it's not
working.

  C:\> perldoc -f chmod

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Wed, 13 May 1998 14:56:13 GMT
From: chebs@elfin.org (*/chebs )
Subject: Re: `back ticks` ?
Message-Id: <355eb465.22546210@news.demon.co.uk>

Wed, 13 May 1998 09:46:34 -0400
^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~

>Second, you do realize that if the browser is initiating a CGI script,
>the script is probably running an user "nobody" rather than you..

Is there a way to make the script run the process as my "login"

Thanks for your help
chebs


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

Date: 13 May 1998 10:27:30 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: txapi@xures.ei.uvigo.es
Subject: Re: Another flock question...
Message-Id: <somefaxp.fsf@mailhost.panix.com>

Jose Manuel Lopez Franco <txapi@xures.ei.uvigo.es> writes:

> I'm newbe on PERL, and i know that flock is used in order to lock a
> file, but is there any way of write an alert when a script that attemps
> to do a flock is waiting so time?

You might examine the sample code that illustrates the alarm()
builtin.

   C:\> perldoc -f alarm

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Wed, 13 May 1998 15:50:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Jose Manuel Lopez Franco <txapi@xures.ei.uvigo.es>
Subject: Re: Another flock question...
Message-Id: <Pine.GSO.3.96.980513082255.21974h-100000@user2.teleport.com>

On Wed, 13 May 1998, Jose Manuel Lopez Franco wrote:

> is there any way of write an alert when a script that attemps
> to do a flock is waiting so time?

I'm not sure, but it sounds as if you're wanting to do a non-blocking
flock. That is, if the lock can't be granted at once, you want to avoid
blocking until it can be granted. This can be done with the LOCK_NB
constant. Be sure to check the return value from flock, to know whether
the lock was or was not granted. Hope this helps! 

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



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

Date: 13 May 1998 15:20:06 GMT
From: Marc Slemko <marcs@znep.com>
Subject: Re: Apache and authentication
Message-Id: <6jcdn6$4mt$1@scanner.worldgate.com>

In <35597D9A.656BAB4D@hp.com> Bjoern Nordmann <bjoern_nordmann@hp.com> writes:

>This is a multi-part message in MIME format.
>--------------52E36828DBC7692100E121CF
>Content-Type: multipart/alternative; boundary="------------AAFEEAF1B37D3B607E21C206"

Please don't post in HTML.  It is rude.


>Hi

>Before I have installed the Apache 1.3 Server I had a NCSA server.
>I've a .htaccess file :

><Limit GET POST>

Don't use a Limit directive unless you _really_ mean to only limit
the above methods.  Just leave it out.

>require group xyz
></Limit>

>Now I have written some Perl-Scripts and I want to test the
>$ENV{'REMOTE_GROUP'} variable. For NCSA this is no
>problem, for Apache this variable is empty.

The REMOTE_GROUP variable is not part of the CGI spec and Apache 
doesn't (for better or worse) support it at this time.


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

Date: 13 May 1998 10:01:43 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Boris 'pi' Piwinger <3.14@Math.MIT.edu>
Subject: Re: CGI: Page output during process
Message-Id: <yaw6fc4o.fsf@mailhost.panix.com>

Boris 'pi' Piwinger <3.14@Math.MIT.edu> writes:

> I want to use a Perl script to do some work which results in some part
> of the page once in a while. The CGI FAQ says:

Cool email address.

You need to generate NPH headers, and to consult the documentation for
your httpd (web server) to see how to make it treat your script as an
nph generator.  For apache, you simply name your script
nph-whatever.cgi, spit out the right headers, and go.  The CGI.pm
module makes this trivial.  Make sure you turn on autoflush, as well.

If you have any more questions about this, you ought to post to a
newsgroup that deals with CGI issues; this group concerns the Perl
language only.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Wed, 13 May 1998 10:28:06 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <3559BC05.7AE7182A@mindspring.com>

Birgitt Funk wrote:
[cut]
> There are big difference in how you learn to speak and how you learn
> to read and write. I asked in another thread if you learn programming
> (your first programming language) by writing code or by reading code.
> 
> Without the learning the underlying grammar, syntax and phonetics
> of a language you don't learn to read, spell and write any language,
> (but you can speak and understand it). 

Huh?  Can't agree with that at *all*.  Once I spoke English, the *only*
extra thing I needed to read and write it was to learn the letters: how
they looked, were written, and sounded.  Everything else, including
spelling, was detail, and no *extra* understanding of grammar or syntax
was needed.  Am I so unique?  I doubt it.  Actually, of course, even
small children are learning a lot of syntax and grammar when they learn
to speak.  It's just not *explicit*.

> The same thing, even more
> heavily so, is true for reading, writing and understanding a programming
> language.(which you will hopefully never 'speak').
> 
I would say the distinction of reading/writing vs. speaking is
irrelevant.  The syntax does need to be specified in a more explicit
manner, both because computer languages are written to be conveyed
formally; and because we learn them when we are adults, and our brains
no longer have a child's facility for intuitive language acquisition.

Of course, some computer languages can be learned more intuitively than
others.  But what would be really interesting would be to try to teach
computer languages to children, via practice and example as well as
formally.  Which ones would be picked up faster?  I would expect the
results to be different than among adults.  For example, Perl, to my way
of thinking, is more like a natural language than many other computer
languages.  It is not totally consistent, but the inconsistencies are
often shortcuts, and intuitive in some kind of weird human way.  Maybe
kids could pick it up fast; maybe not...


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

Date: Wed, 13 May 1998 11:35:14 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <fl_aggie-1305981135150001@aggie.coaps.fsu.edu>

In article <3558A8A7.D1D37D9@order.booktraders.com>, Birgitt Funk
<birgitt@order.booktraders.com> wrote:

+ > > fl_aggie@thepentagon.com (I R A Aggie) writes:
+ > >
+ > > And I've come around to the point of view that perl is a miserable
+ > > for people who've never programmed before.
 
+ Why ?

Because it requires self-discipline if you want maintainable code that
you can pick up in 6 weeks, 6 months, or 6 years later and be able to
understand it with a minimum of effort. It takes a while - and the 
occasional painful lesson - to learn that discipline. I still find
old code that I look at and say "what WAS I drinking?!"

Further, perl will quite cheerfully hand you more than enough rope to
hang yourself, your program, and possibly your system. 

+ > Well, sure it is. And so is C, sh, awk, sed, BASIC, FORTRAN, Lisp,
+ > etc.
 
+ O.K., so what language is then left to the new incoming generation 
+ of programming students ?

Pascal? It enforces the top-down, bottom-up programming strategy. Write 
enough programs that way, and it becomes second nature. Once you know that,
then learning any particular languge is just syntax, details and culture.

+ Why can't Perl be a first language ?

It could be, but its _not the optimal_ first language. There's lots of twists
and turns and gory details. The demands for self-discipline become much
greater, because the interpreter won't force you.
 
My advice: learn to program first, then picking perl up will be a snap.

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, 13 May 1998 11:47:05 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <fl_aggie-1305981147050001@aggie.coaps.fsu.edu>

In article <6j9vsn$f7@mozo.cc.purdue.edu>, gebis@albrecht.ecn.purdue.edu
(Michael J Gebis) wrote:

+ fl_aggie@thepentagon.com (I R A Aggie) writes:
+ }No, we aren't. We're _requiring_ people to get smart. 
 
+ It's been a smashing success so far.

So, your solution is to allow them to wallow in ignorance?

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, 13 May 1998 15:57:42 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <1d8yto0.hqvty81ty236fN@roxboro0-057.dyn.interpath.net>

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

>  [courtesy cc of this posting sent to cited author via email]
> 
>     kpreid@ibm.net (Kevin Reid) writes:
> :Yes, I use it - _when I am using a UNIX system_. When I use a Macintosh,
> :I use MacPerl. And I would like this functionality in MacPerl.
> 
> Why are you holding others responsible for your choice of a
> tool-challenged system?

As the original post was in direct reply to the author of the tool in
question (MacPerl) I don't think this is warranted - he was making a
suggestion as to how it could be made better.

-- 
John Moreno


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

Date: Wed, 13 May 1998 15:06:51 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: tpa@my-dejanews.com
Subject: Re: Finding Open Client libs
Message-Id: <Pine.GSO.3.96.980513080543.21974e-100000@user2.teleport.com>

On Wed, 13 May 1998 tpa@my-dejanews.com wrote:

> I was hoping to get a clarification on how a Perl module actually finds the
> library it is calling. 

It uses the paths in @INC. Once a module or library has been loaded, you
can inspect %INC to see which file it used. Is that what you needed? Hope
this helps!

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



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

Date: Wed, 13 May 1998 11:20:59 -0400
From: "Andrew F. Lee" <andrewf@cp.pathfinder.com>
Subject: Re: Get file date
Message-Id: <Pine.GSO.3.95.980513111937.42A-100000@cp.pathfinder.com>

On Wed, 13 May 1998, Chris Fu wrote:

> Hi everybody,
> 
> Anyone knows how to use script to fetch the file date?
> 
> 
> Best rgds

stat($filename);

look at perldoc perlfunc and search for stat ...

-------------------------------------------------------------
Andrew F. Lee                 |                              |
Software Engineer             |  parenttime.com              |
email: andrewf@pathfinder.com |  1271 Avenue of the Americas |
Phone: (212) 522-2769         |  New York, N.Y. 10020        |
-------------------------------------------------------------
        When I say, "Ignore the man behind the curtain."   
        That is because there is no man behind the curtain.




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

Date: 13 May 1998 15:29:45 GMT
From: angst <angst@scrye.com>
Subject: Re: Get file date
Message-Id: <6jce99$o35$1@jelerak.scrye.com>

Chris Fu <fuc@esquel.com> wrote:
: Anyone knows how to use script to fetch the file date?

Which one? There are at least three.
At any rate, try perldoc perlfunc.  You'll find your answer in
the documentation for the stat function.
HTH.

-- 
Erik Nielsen <eln@rmci.net>
mail to above (rather than header address) is answered significantly faster.
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support


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

Date: 13 May 1998 10:23:55 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: stu-w@usa.net
Subject: Re: How can you break out of a 'while... ' loop in a function?
Message-Id: <vhrafb3o.fsf@mailhost.panix.com>

stu-w@usa.net.remove.everything.after.net (Stuart Wright) writes:

> On Mon, 11 May 1998 17:32:47 +0200, Denis DORR <dorr@cetrel.lu> wrote:
> >Assuming you have the Perl documentation on your system (you *should*) :
> 
> Why *should* I have the Perl documentation on my system ?!  Does it
> come bundled with Windows 95 or something ?!

No, it *comes* *with* *perl*.  If it doesn't have the docs, then it's
not a real distribution of perl.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Wed, 13 May 1998 15:24:31 GMT
From: stu-w@usa.net.remove.everything.after.net (Stuart Wright)
Subject: Re: How can you break out of a 'while... ' loop in a function?
Message-Id: <3559baab.22533791@news.demon.co.uk>

On 13 May 1998 10:23:55 -0500, Jonathan Feinberg <jdf@pobox.com>
wrote:

>stu-w@usa.net.remove.everything.after.net (Stuart Wright) writes:
>
>> On Mon, 11 May 1998 17:32:47 +0200, Denis DORR <dorr@cetrel.lu> wrote:
>> >Assuming you have the Perl documentation on your system (you *should*) :
>> 
>> Why *should* I have the Perl documentation on my system ?!  Does it
>> come bundled with Windows 95 or something ?!
>
>No, it *comes* *with* *perl*.  If it doesn't have the docs, then it's
>not a real distribution of perl.
>
Ah well that explains it then - I've been programming in Perl for a
year and I've never *had* perl - just a (bad) book and Wordpad.
What exaclty is 'the perl distribution' then ?  It might be worth me
getting it for the documenation if nothing else.
thanks


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

Date: Wed, 13 May 1998 15:35:29 GMT
From: stu-w@usa.net.remove.everything.after.net (Stuart Wright)
Subject: Re: How can you break out of a 'while... ' loop in a function?
Message-Id: <3559bbe3.22846461@news.demon.co.uk>

The specific example is this...

# check membership number
$memberfile = "members.txt";
open(memberfileno, "$memberfile") || die "I can't open that because: $!\n";
while(<memberfileno>) {
	chop;		
	@all = split(/\n/);
	foreach $line (@all) {
      ($filemember, $a1, $a2, $a3, $a4, $a5, $pc, $dateob) = split(/%/, $line);
      if ($filemember eq $member) {
        $address1 = $a1;
        $address2 = $a2;
        $address3 = $a3;
        $address4 = $a4;
        $address5 = $a5;
        $postcode = $pc;
        $dob = $dateob;
      }
      next;
    }
}

I admittedly don't understand specifically what || or die or $! mean since I've never read any documentation.  I've
always just copied my code from somewhere and bodged it.  I need to get organised.
I was wanting to exit the 'foreach' loop if the member was found.
In a similar example I'm searching through a text file of over 12,000 records and doing the whole lot even if the record
I want is the first !

I guess I should do this 

      if ($filemember eq $member) {
        $address1 = $a1;
        $address2 = $a2;
        $address3 = $a3;
        $address4 = $a4;
        $address5 = $a5;
        $postcode = $pc;
        $dob = $dateob;
        last;
      }

I can definately say developing in a windows gui environment quickly lets your old linear text programming skills fade.
Thanks everyone for your help.




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

Date: 13 May 1998 15:46:25 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How can you break out of a 'while... ' loop in a function?
Message-Id: <6jcf8h$721$3@client3.news.psi.net>

Stuart Wright (stu-w@usa.net.remove.everything.after.net) wrote on
MDCCXVI September MCMXCIII in <URL: news:35596fcc.3367201@news.demon.co.uk>:
++ On 12 May 1998 20:18:32 GMT, Tom Christiansen <tchrist@mox.perl.com>
++ wrote:
++ 
++ > [courtesy cc of this posting sent to cited author via email]
++ >
++ >In comp.lang.perl.misc, stu-w@usa.net writes with a now despammed
++ >address available for all to see,
++ >
++ >:A simple question, but all the pearl FAQs are useless.
++ >
++ >What is Pearl?
++ >
++ 
++ Lets take a guess..
++ In this case is it
++ a) A small valuable sphere produced by oysters
++ b) A (not uncommon) typeo in the Perl newsgroup which some sad
++ individual can't resist picking up on.


Actually, Pearl is a programming language for real time environments.



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


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

Date: 13 May 1998 14:52:05 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: Installing PERL on NT
Message-Id: <6jcc2l$quf$1@nntp1.ba.best.com>

Hauk Langlo <hauk@forumnett.no> wrote:

> Hi there. After using PERL at work for some weeks I have finally got
> my own PC at home. I'm pretty new to the PC format and have not
> managed to successfully install/build perl on my PC.

The easiest way to get full-blown perl capability on an Intel machine
is to install one of the many fine freely redistributable Unix
variants on it.  Linux and FreeBSD are the most popular of these, with
Linux having a much larger following.

HTH,
David.
-- 
            David Fetter         888 O'Farrell Street Apt E1205
   shackle@ren.glaci.com          San Francisco, CA 94109-7089 USA
  http://www.best.com/~dfetter     +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)

Si hoc legere scis nimium eruditionis habes.


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

Date: 13 May 1998 14:20:13 GMT
From: arch@abts.net (Shaun Sides)
Subject: Re: Is if ($a="something") a bad style?
Message-Id: <slrn6lioob.dr5.arch@abts.net>

Original message by: Yong Huang <yong@shell.com>
Date: Tue, 12 May 1998 15:43:23 -0500
Subject: Is if ($a="something") a bad style?


> In C, we often say
> if (a="something")
> But in Perl, a warning is given. I want to shorten
> 
> $a="something";    #"something" could be &mysub which may return nothing
> 
> if ($a) {...
> 
> into one statement:
> 
> if ($a="something") {...

<expression> if ($a = "something")

Seems like that might do the trick, but I don't think you'd be able to
do in a program with 'use strict'.  The assignment will return the value
assigned to $a, which is a true result (unless $a ends up being undef for 
some reason).  So long as the right side is true, whatever's on the left
will execute, or be evaluated, or what have you.

Hell, you might even be able to do

<expression> && ($a = "something")

;-)

I don't know which, if either, of these would execute more efficiently.
Info on that appreciated.

> Is this a bad style? Thanks for advice.

Judging by the reading I've been doing, such shortcuts are very good
'perl hacker' style. ;-)

Anyway, I hope I'm right.  I'm real new.

-- 
Shaun L. Sides			arch@abts.net
Business web site		http://www.abts.net/~arch
Showershoe web site		http://www.abts.net/~arch/showershoe
Recreational web site		http://sara.mmlc.nwu.edu/~arch


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

Date: Wed, 13 May 1998 15:22:36 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Is if ($a="something") a bad style?
Message-Id: <Pine.GSO.3.96.980513082135.21974g-100000@user2.teleport.com>

On Tue, 12 May 1998, Larry Rosler wrote:

> if ($a = "something") { print $a }

You shouldn't be both assigning and testing a constant; thus the warning.
If you were actually doing something useful, Perl wouldn't warn you about
this. Hope this helps!

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



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

Date: 13 May 1998 15:36:22 GMT
From: angst <angst@scrye.com>
Subject: Re: Is if ($a="something") a bad style?
Message-Id: <6jcelm$o35$2@jelerak.scrye.com>

Shaun Sides <arch@abts.net> wrote:
: do in a program with 'use strict'.  The assignment will return the value
: assigned to $a, which is a true result (unless $a ends up being undef for 
: some reason).  So long as the right side is true, whatever's on the left

Or if $a is zero.  You should wrap defined() around the statement (you need
the parentheses due to precedence) if you ever want $a to legitimately hold
the value zero.

-- 
Erik Nielsen <eln@rmci.net>
mail to above (rather than header address) is answered significantly faster.
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support


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

Date: Wed, 13 May 1998 15:57:47 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Is if ($a="something") a bad style?
Message-Id: <1d8yu6g.tnav4y1vkjrksN@roxboro0-057.dyn.interpath.net>

Yong Huang <yong@shell.com> wrote:

> Since I receive a couple of kind messages that misunderstood what I meant
> (due to my fault!), I want to clarify my point.
> 
> I want to do assignment and in the same step (at least at the programmer's
> first sight), check to see if the string is null. The C style, that is,
> if (!(fd=open("mydata.txt",r+)) { printf "Can't open the file "...
> looks elegant and neat. That's why I want to know if this is thought of as
> neat in Perl too.

I understood what you meant - but that's NOT neat in C and it's not neat
in Perl.  It works (in both) and can occasionally be useful, but
generally it's just a opportunity for a mistake to happen.

So to answer the subject - yes it's a bod style.

-- 
John Moreno


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

Date: Wed, 13 May 1998 09:19:04 -0500
From: "kll" <kliou@ichat.com>
Subject: Kill an NT process?
Message-Id: <6jc592$g9g$1@nntp.smartdna.com>

I'd like to have a Perl program to check for an NT process, say xxx.exe.  If
it has been running for longer than one day, the kill it.  Can I do this in
Perl on NT?  Thank you.

Kan, new in Perl




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

Date: Wed, 13 May 1998 08:39:17 -0600
From: "Greg Rebuck" <Gregory.Rebuck@digital.com>
Subject: Re: Learning Perl vs Programming Perl (Books)
Message-Id: <6jcbj5$fo3$1@nntpd2.cxo.dec.com>

I somewhat disagree.  I've been programming for awhile and I'd say that
starting with the Camel book will turn most people off to Perl before they
can truly appreciate it.  Llama, especially the latest edition offers much
less intimidating information and doesn't make you lose focus with highly
esoteric examples.  In fact, I had gone away from Perl for some time and
came back just to refresh myself--I like the Llama better.

That's not to say that Camel isn't an excellent reference--it is!  If you
want to be a guru or just impress your friends (who are all probably nerds
like you and not easily impressed with much of anything) you gotta have
Wall's book.  It's so obvious that Perl's author also co-authored this
intensive manual.  IMHO, being the author of a language makes one the most
*and* least qualified to write documentation for it!

Another one I like, which is different altogether is "Perl 5 How To"; one of
the better ones of the "How To" series.

Greg Rebuck <Gregory.Rebuck@digital.com>

angst wrote in message <6j87if$96f$1@jelerak.scrye.com>...
>matthew d. p. k. lanier <lanier@shell6.ba.best.com> wrote:
>: programming perl is a pretty dense book, and i would recommend getting it
>: concurrently to learning perl, but reading and trying to digest learning
>: perl first.
>
>I would modify this a little...I learned perl with the camel book, never
>touched the llama book.  I would say, you need only the camel book if you
>have some experience in programming any other free-form language previously
>(such as C or Pascal, but not something like line-oriented BASIC), and
>particularly if you've done anything with shell scripting.  If you are new
>to programming (and scripting) in general, get the llama book first, then
>the camel book (or use both side by side).





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

Date: Wed, 13 May 1998 08:08:32 -0700
From: Jason Murray <jmurray@mfg.sgi.com>
Subject: Matching period with regular expression
Message-Id: <3559B770.996E93D1@mfg.sgi.com>

I am using the following as part of a program to find large files on my
hard drive.  The problem I am having is how to match a period at the
begging of the line with a regular expression.  I am using the following
but it dosen't seem to work.  Any suggestions.

#!/usr/bin/perl5
open(FILES, "ls -lRA /|");
while (<FILES>){
chomp $_;
if (/^\./){
print "$'\n";
}

Thanks in advance,
Jason



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

Date: Wed, 13 May 1998 07:10:31 -0700
From: erik@earthlink.net (Erik Y. Adams)
Subject: Modules:  why doesn't this work?
Message-Id: <erik-1305980710320001@pool029-max10.mpop2-ca-us.dialup.earthlink.net>

Well, I feel like this is one of those really basic things that I just
never had to do before, and now that I do I can't figure it out.

Background:  the latest ActiveState Perl, WinNT 4.0.

So, I can't install a module into the normal lib directory, so I tried
this instead:

   @INC = ("e:/mydir/mysubdir/myotherdir", ".");
   use mymodule;

However, I keep getting the "Can't locate CGI.pm in @INC at myscript.pl line 2".

So, how do I use a module that isn't in lib?

Erik


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

Date: 13 May 1998 14:18:49 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Modules:  why doesn't this work?
Message-Id: <6jca49$bpl@news-central.tiac.net>

There are usually 2 distinct phases of a perl program's execution, the
compilation phase and the run phase.  The push happens when the program's
running, but the use takes effect during compilation. 

There are a couple of ways to get the desired result - either wrap the
push in a BEGIN block or use the

  use lib 'some_dir';

pragma.  

  perldoc lib

should get you information on the use of the lib pragmatic module.

Hope this helps,

Mike

In article <erik-1305980710320001@pool029-max10.mpop2-ca-us.dialup.earthlink.net>,
Erik Y. Adams <erik@earthlink.net> wrote:
>Well, I feel like this is one of those really basic things that I just
>never had to do before, and now that I do I can't figure it out.
>
>Background:  the latest ActiveState Perl, WinNT 4.0.
>
>So, I can't install a module into the normal lib directory, so I tried
>this instead:
>
>   @INC = ("e:/mydir/mysubdir/myotherdir", ".");
>   use mymodule;
>
>However, I keep getting the "Can't locate CGI.pm in @INC at myscript.pl line 2".
>
>So, how do I use a module that isn't in lib?
>
>Erik


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 13 May 1998 09:46:41 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Nuclear bombing of NEW YORK! Small countries can target with nukes!
Message-Id: <3559B251.70390AB5@mindspring.com>

Jonathan Feinberg wrote:
> 
> gdw <gdw@yahoo.com> writes:
> 
> > Understand the magic is that MASS and ENERGY are ONE and THE SAME
> > ENTITY!!  MASS can be easily converted into energy and ENERGY can be
> > easily converted into MASS!! The eqn is E=m*c*c c=speed of light
> > m=mass and E=energy!
> 
> Did this remind anyone else of the stuff that's printed on those
> wonderful Dr. Bronner's Essene soap bottles?
> 
>    9th: More good is caused by evil than by good, do what's right!
>    Enlarge the positive! Replace the negative with the Moral ABC of
>    All-One-God-Faith that lightning-like unites the Human race! For we're
>    All-One or none! As Mao found in Redbook '51, "Marxism once in power,
>    is unworkable! Has less value than cow dung! Its power is the gun!"
>    Khruschev added, "Without profits, farmers won't deliver food, we
>    starve!"
> 
That's it exactly!  KNEW IT REMINDED ME!  OF SOMETHING!!!  Sorry.


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

Date: 13 May 1998 14:04:35 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: ODBC.pm: Is there a size limit to SQL statements?
Message-Id: <6jc99j$sgi$2@supernews.com>

It would appear that ODBC.pm has a limit on the size of SQL statements
(around 60K) that it can handle.  It seems that after a given size, the
SQL that gets passed off to the ODBC driver is truncated, which of course
results in syntax errors.

Am I right on this one?  Searching through the source and the FAQ turns up
nothing, and nary a peep in AltaVista or Dejanews.

Any alternatives?  Workarounds?  Sympathetic ears?

Thanks,
xoxo,
Andy


--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Wed, 13 May 1998 09:13:01 -0500
From: "kll" <kliou@ichat.com>
Subject: Re: Perl script on Internet Information Server
Message-Id: <6jc4tk$g7a$1@nntp.smartdna.com>

In the Virtual Directory you keep Perl scripts, you need to set up App
Option for .pl.

Kan

Silvana Gsmez wrote in message <35581C2F.23713637@ptg.es>...
>I have NT 4.O and IIS v. 2.0 and I want executing perl scripts from my
>html pages but I can4t. I don4t know how to do it. Do I have to
>configure IIS to execute perl scripts?
>
>Thank you.
>
>
>




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

Date: Wed, 13 May 1998 10:01:59 -0400
From: Bryan Beske <beske@worldnet.att.net>
Subject: Re: PROFESSIONAL PERL TRAINING
Message-Id: <6jc969$463@bgtnsc03.worldnet.att.net>

Try:

http://www.onsightinc.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 2580
**************************************

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