[12968] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 378 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 5 04:07:18 1999

Date: Thu, 5 Aug 1999 01:05:07 -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, 5 Aug 1999     Volume: 9 Number: 378

Today's topics:
        @foo = @{[@arry, shift @arry]};  behaves oddly? philipp+perl@cnct.com
    Re: Autovivification? (Bart Lateur)
    Re: Autovivification? <uri@sysarch.com>
        Cookie the only way? <master@openendon.com>
    Re: Get Executables path (Larry Rosler)
    Re: Get Executables path (Abigail)
        How do I open another browser window using Perl? <church@NOSPAMspinn.net>
    Re: patten matching (Larry Rosler)
    Re: patten matching (Abigail)
    Re: patten matching (Abigail)
    Re: Perl & Win95 <thomas@dreamsister.de>
    Re: Perl vs HTML (Abigail)
    Re: Possible to get a HTML file from somewhere and use  lpwong@my-deja.com
    Re: Question of DBI: Statement Handle Methods <rhrh@hotmail.com>
    Re: Regular expression for matching an e-mail address. (Abigail)
    Re: Regular expression for matching an e-mail address. (Bart Lateur)
    Re: SET interface <irishcream@iname.com>
    Re: towards uploading binary files... irf@netexecutive.com
    Re: Useless error when {} unbalanced (Alan Curry)
    Re: while loop teminates too early (Bart Lateur)
    Re: Why is it.... (Abigail)
    Re: Why is it.... (Abigail)
    Re: Why is it.... (Abigail)
    Re: Why is it.... (Bart Lateur)
    Re: Why is it.... (Abigail)
    Re: Why no Perl books at Fry's? <paul@mccombes.demon.co.uk>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sat, 31 Jul 1999 04:21:28 GMT
From: philipp+perl@cnct.com
Subject: @foo = @{[@arry, shift @arry]};  behaves oddly?
Message-Id: <37a2759c.13443072@news.cnct.com>

This is the smallest I can get it...
the results of the following:

@arry = qw(a b c d e f g);
@foo = @{[@arry, shift @arry]};
print join ":", @foo, "\n";

is: 

a:b:c:d:e:f:g::

the last item is undef (which a -w shows).
I would have expected it to end in "a"
and I'm not sure I'd know when it would evaluate the shift, actually,
so I wouldn't have been surprised if it had been:

b:c:d:e:f:g:a:

either.  But this result does not make sense to me.
There are ways of making it more complicated that also get (to me)
unexpected results.

It's worth noting that if the two arrays are *not* the same, it
behaves as you would expect.

Any ideas what's going on?
thanks			philipp

P.S.:  no, there's no real good reason why I would want to do this.  I
stumbled across it trying to obfuscate some code.



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

Date: Thu, 05 Aug 1999 06:30:53 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Autovivification?
Message-Id: <37ad2b32.1905128@news.skynet.be>

Uri Guttman wrote:

>  BL> You can catch this by "use strict refs", but it's annoying, anyway.

BTW it's "use strict 'refs'" or "use strict qw(refs)".

>you don't run with use strict in general?

No. Especially not in one-off scripts, whuich is... most of them. See
the eternal discussion of why "strict" is not the standard option for
Perl, i.e. why YOU have to turn it on, explicitely.

If I liked what "strict" requires from me, I'd be using Ada. ;-)

	Bart.


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

Date: 05 Aug 1999 03:35:49 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Autovivification?
Message-Id: <x7so5yhe7e.fsf@home.sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  >> you don't run with use strict in general?

  BL> No. Especially not in one-off scripts, whuich is... most of them. See
  BL> the eternal discussion of why "strict" is not the standard option for
  BL> Perl, i.e. why YOU have to turn it on, explicitely.

  BL> If I liked what "strict" requires from me, I'd be using Ada. ;-)

when you are working with deep perl structures like this thread has
covered, strict becomes your friend. and very few one-off scripts use
complex structures.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Thu, 05 Aug 1999 06:22:59 GMT
From: Jordan DeLozier <master@openendon.com>
Subject: Cookie the only way?
Message-Id: <37A9305A.F2F8EA0C@openendon.com>


--------------CA151388F9AF4005E6ACF89F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,
        I need some way to pass information into the users browser and
retrieve it if/when they click on a cgi link. Is a cookie the only way?
If so, could someone show me the source code to use or where to find the
information.

Thanks,
Jordan

--
*************************
Openendon Top Sites
http://www.openendon.com
Top Sites Listing
*************************



--------------CA151388F9AF4005E6ACF89F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hello,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I&nbsp;need some way to
pass information into the users browser and retrieve it if/when they click
on a cgi link. Is a cookie the only way? If so, could someone show me the
source code to use or where to find the information.
<p>Thanks,
<br>Jordan
<pre>--&nbsp;
*************************
Openendon Top Sites
<A HREF="http://www.openendon.com">http://www.openendon.com</A>
Top Sites Listing
*************************</pre>
&nbsp;</html>

--------------CA151388F9AF4005E6ACF89F--



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

Date: Wed, 4 Aug 1999 22:55:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Get Executables path
Message-Id: <MPG.1212c745a52cebe8989ddc@nntp.hpl.hp.com>

In article <Pl7q3.233$Qj2.8797@nsw.nnrp.telstra.net> on Thu, 05 Aug 1999 
03:15:59 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
> In article <37A8D56C.2EED1A5C@cybersurf.net>,
> 	Matt Kennedy <mattk@cybersurf.net> writes:
> > Thomas Schmickl wrote:
> >> 
> >> How can I determine (In the _BEGIN_ of the script-execution)
> >> in which directory the executet perl-script is ?
> >
> > Try: 
> > ###
> > use Cwd;
> > 
> > $cwd = getcwd();
> 
> Of course this does _not_ give you the directory the script is in, but
> the current working directory. They are not necessarily the same, and
> in fact often _not_ the same.
> 
> You could have a look at the FindBin module, maybe. Or you could use
> dejanews to search for answers to this question, which comes up
> regularly.

If 'regularly' ~ 'frequently', why isn't it in the FAQ?

Isn't it as simple as $0 if $0 is absolute, "$cwd/$0" if $0 is relative?

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 5 Aug 1999 02:54:05 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Get Executables path
Message-Id: <slrn7qignm.tvu.abigail@alexandra.delanet.com>

Larry Rosler (lr@hpl.hp.com) wrote on MMCLXV September MCMXCIII in
<URL:news:MPG.1212c745a52cebe8989ddc@nntp.hpl.hp.com>:
 .. In article <Pl7q3.233$Qj2.8797@nsw.nnrp.telstra.net> on Thu, 05 Aug 1999 
 .. 03:15:59 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
 .. > In article <37A8D56C.2EED1A5C@cybersurf.net>,
 .. > 	Matt Kennedy <mattk@cybersurf.net> writes:
 .. > > Thomas Schmickl wrote:
 .. > >> 
 .. > >> How can I determine (In the _BEGIN_ of the script-execution)
 .. > >> in which directory the executet perl-script is ?
 .. > >
 .. > > Try: 
 .. > > ###
 .. > > use Cwd;
 .. > > 
 .. > > $cwd = getcwd();
 .. > 
 .. > Of course this does _not_ give you the directory the script is in, but
 .. > the current working directory. They are not necessarily the same, and
 .. > in fact often _not_ the same.
 .. > 
 .. > You could have a look at the FindBin module, maybe. Or you could use
 .. > dejanews to search for answers to this question, which comes up
 .. > regularly.
 .. 
 .. If 'regularly' ~ 'frequently', why isn't it in the FAQ?
 .. 
 .. Isn't it as simple as $0 if $0 is absolute, "$cwd/$0" if $0 is relative?


You know, my first though was, yes, either of $0 or "$cmd/$0" will give
one of the locations the executable is found. (Which links, a file can
be found on many different (logical) places in the filesystem).

My second thought was, wait-a-minute, what about the indirect object of
exec() (and system())? According to the manual, that will lie to the
called program about its name.

So, I did a test.

    $ cat /tmp/foo1
    #!/opt/perl/bin/perl -w
    use strict;
    print $0, "\n";
    $
    $ cat /tmp/foo2
    #!/opt/perl/bin/perl -w
    use strict;
    exec {"/tmp/foo1"}  "lalala";
    $
    $ /tmp/foo2
    /tmp/foo1
    $


I was expecting "lalala", and now I'm confused.




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


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 5 Aug 1999 00:56:40 -0600
From: "DC" <church@NOSPAMspinn.net>
Subject: How do I open another browser window using Perl?
Message-Id: <7obcgb$iq5$1@news.gstis.net>

I want to display a URL in another browser window and then be able to switch
back to my original browser window where my Perl/CGI script is running.  Is
it a simple print " line of code that ends up being HTML code after all?

Thanks.

dan :)




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

Date: Wed, 4 Aug 1999 23:02:10 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: patten matching
Message-Id: <MPG.1212c8b5c91a2c47989ddd@nntp.hpl.hp.com>

In article <37aaff50.218977046@news.panix.com> on Thu, 05 Aug 1999 
03:08:25 GMT, Steve Manes <smanes@NOSPAM.HEREmagpie.com> says...
> On Thu, 05 Aug 1999 01:56:53 GMT, ming@tickets.com wrote:
> >I need to compare string1 to string2, if string1 is a substring of
> >string2, then return truth.
> 
> if ($string2 =~ /$string1/) ...

Two problems there:  metacharacters in $string1 (fix with \Q), and 
performance relative to 'index'.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 5 Aug 1999 02:55:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: patten matching
Message-Id: <slrn7qigpt.tvu.abigail@alexandra.delanet.com>

ming@tickets.com (ming@tickets.com) wrote on MMCLXV September MCMXCIII in
<URL:news:7oar11$d2r$1@nnrp1.deja.com>:
"" 
"" I need to compare string1 to string2, if string1 is a substring of
"" string2, then return truth.


index



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 5 Aug 1999 02:59:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: patten matching
Message-Id: <slrn7qih1e.tvu.abigail@alexandra.delanet.com>

Larry Rosler (lr@hpl.hp.com) wrote on MMCLXV September MCMXCIII in
<URL:news:MPG.1212c8b5c91a2c47989ddd@nntp.hpl.hp.com>:
// In article <37aaff50.218977046@news.panix.com> on Thu, 05 Aug 1999 
// 03:08:25 GMT, Steve Manes <smanes@NOSPAM.HEREmagpie.com> says...
// > On Thu, 05 Aug 1999 01:56:53 GMT, ming@tickets.com wrote:
// > >I need to compare string1 to string2, if string1 is a substring of
// > >string2, then return truth.
// > 
// > if ($string2 =~ /$string1/) ...
// 
// Two problems there:  metacharacters in $string1 (fix with \Q), and 
// performance relative to 'index'.


The p5p archive (or is it this newsgroup?) should have some extensive
benchmarking from me where for large strings, // beats index by orders
of a magnitude. Specially if there is no match, // seems to detect
failure much faster than index. 

Mind that this was pre-5.005. Unfortunally, I've lost my testcases.



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


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 05 Aug 1999 06:40:26 GMT
From: "Thomas Fvrtsch" <thomas@dreamsister.de>
Subject: Re: Perl & Win95
Message-Id: <ulaq3.13318$J5.148188@c01read02-admin.service.talkway.com>

What do I have to write exactly?
It does not work at all.

Thomas
--
Posted via Talkway - http://www.talkway.com
Exchange ideas on practically anything (tm).



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

Date: 5 Aug 1999 03:04:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl vs HTML
Message-Id: <slrn7qihat.tvu.abigail@alexandra.delanet.com>

Martien Verbruggen (mgjv@comdyn.com.au) wrote on MMCLXV September
MCMXCIII in <URL:news:7E7q3.241$Qj2.9513@nsw.nnrp.telstra.net>:
__ In article <37A8BDC0.EC693C6B@club-internet.fr>,
__ 	YANG Tong <ytong@club-internet.fr> writes:
__ 
__ > $ch="    <A HREF=/toto/titi.html  ></A>     ";
__ > $ch=~s/(^.*?href\s*=\s*)("|'|)(.*?)(\1|\s|>)(.*$)/$1$2hello.html$4$5/i;
__ 
__ This is really bad. Both the HTML and the RE are not very beautiful.


I can quantify that a bit more. There's no HTML in this posting, [1]
including the quoted paragraphs.


[1]  Yangs line contains an HREF attribute in the anchor element that
     doesn't have a value. And there's no open anchor element when
     encountering </A>.  Invalid HTML is no HTML.


Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 05 Aug 1999 07:52:53 GMT
From: lpwong@my-deja.com
Subject: Re: Possible to get a HTML file from somewhere and use it as string?
Message-Id: <7obfsi$rsh$1@nnrp1.deja.com>

Thanks a lot

In article <37A88072.41D85D45@mail.cor.epa.gov>,
  David Cassell <cassell@mail.cor.epa.gov> wrote:
> lpwong@my-deja.com wrote:
> >
> > Hi,
> >
> >   I'm a newbie of writting Perl/CGI.
>
> Then let me help.  Perl and CGI are two very different thingies.
> Perl is a programming language which is used for a very large
> number of different purposes, one of which is web programming.
> CGI is simply a protocol for an interface.
>
> >                                      Recently i want to write a
simple
> > CGI (hopefully) to extract some links from a HTML located in other
> > server.  Is it possible to get the HTML using Perl/CGI and then
convert
> > it into a string for pre-format before display?  thanks in advance.
>
> Yes.  You probably want to look at the LWP::Simple module.
> It may even be on the machine you're using.  If it is,
> you can type this:
>
>     perldoc LWP::Simple
>
> and get the documentation.  For some really nifty but
> short examples of gobbling up a webpage and then re-formatting
> it for output, look in issue #13 of The Perl Journal,
> which you can subscribe to by going to www.tpj.com .
>
> HTH,
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 05 Aug 1999 09:01:40 +0100
From: Richard H <rhrh@hotmail.com>
Subject: Re: Question of DBI: Statement Handle Methods
Message-Id: <37A944E4.B4D68EA5@hotmail.com>

Carfield Yim wrote:
> 
>     I have a question of the return of fetchrow_arrayref and
> fetchrow_hashref method. I have written a mod for general database
> function. In one subroutine of this mod, the return value is statement
> handle object ($sth).
> 
>     When I use the fetchrow_arrayref method of this return value.
> (i.e.:$sth -> fetchrow_arrayref). First time, it is okay, but in second
> time, it return a error message, and I don't know why...
> 
>     I wonder, do the address of the return address will change after
> being called, but I don't sure. If yes, is there any other Module behave
> like this? Please tell me.

Cant really help unless you post the <relevant> bits of your code,
what error do you get and when??

Richard H


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

Date: 5 Aug 1999 01:32:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Regular expression for matching an e-mail address.
Message-Id: <slrn7qibu7.tec.abigail@alexandra.delanet.com>

Daniel Doreika (daniel@fabric.com) wrote on MMCLXIV September MCMXCIII in
<URL:news:37a8babe.101714222@news.earthlink.net>:
"" I remember reading somewhere many months ago a really good regular
"" expression for matching e-mail address.  Now I need to use it, and I
"" can not seem to find it anymore.  Can someone please provide me with
"" the best possible regular expression for matching an e-mail address?


You must have read it in the appendix of MRE.



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 05 Aug 1999 07:23:58 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Regular expression for matching an e-mail address.
Message-Id: <37b2379f.5085780@news.skynet.be>

Tom Christiansen wrote:

>Try:
>
>    $addr =~ /^tchrist\@.*\bperl.com$/i
>
>I find that it works admirably for me.

$addr = 'tchrist@.!@)(*@#....perl.com';

Oh yeah. Really great. 	;-)

	Bart.


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

Date: Thu, 5 Aug 1999 08:49:33 +0200
From: "John" <irishcream@iname.com>
Subject: Re: SET interface
Message-Id: <7obbnm$liv$1@wanadoo.fr>

My only suggestion is that I would not recommend using
SET ....

>
>Any suggestions are welcome.  Thanks in advance.
>





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

Date: Thu, 05 Aug 1999 06:59:59 GMT
From: irf@netexecutive.com
Subject: Re: towards uploading binary files...
Message-Id: <7obcpc$otd$1@nnrp1.deja.com>


> Matt's Script Archive is full of message board programs, guestbook
> programs, etc. that will "work" when they're so lightly loaded that
two
> people are never using them at the same time.  But they suddenly stop
> working and start trashing their data once traffic picks up.

oh, i understand now why this is so crucial. thank you. sorry abigail.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 05 Aug 1999 06:34:45 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Useless error when {} unbalanced
Message-Id: <9gaq3.312$LM2.3243@news13.ispnews.com>

In article <7o9mka$8r7$2@brokaw.wa.com>,
Jerome O'Neil <jeromeo@atrieva.com> wrote:
>
>When you start a new block, always put the closing bracket in before
>you do anything else.

I've been wondering if I'm the only one who does that. I can't remember when
I picked up this habit, but I always type first:

  sub foo ()
  {
  }

Then I go up and fill in the middle part. Now I never have mismatched braces.
If I'm going to quit coding for the day, or even for just a few minutes, I
put a little bit of uncompilable garbage in the empty block just to be sure I
won't forget to fill it in later.
-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


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

Date: Thu, 05 Aug 1999 07:23:55 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: while loop teminates too early
Message-Id: <37b032a9.3815859@news.skynet.be>

Andy Collado wrote:

>I have a while loop that should verify that a user is valid, but it will
>only validate whoever is the first user in the user file.
>Here's the block of code that I'm using:
>
>open (USERS, "C:/www/users");
>while($line=<USERS>) {
>     if ($line=~/^$user/) {
>      &check;
>     }
>     else {
>      &goaway;
>     }
>     exit;
>}

Of course it does. You're telling the user to go away if he's not the
first user. Plus, you're exiting the program in the loop, after the
first test. You should have tested ALL possible users before telling him
to go away, if not accepted.

Let's see...

  my $accepted = 0;
  open (USERS, "C:/www/users");
  while($line=<USERS>) {
#     if ($line=~/^$user/) {

# Fishy. Inefficient, because the regex is recompiled every time in the
# loop, and if $user contains funny characters, it might even kill the
# program. Do either:

      if($line =~ /\Q$user\E:/) {

# or:

      my($testuser,$testpwd) = split /:/,$line
      if($testuser eq $user) { 

# Now see if the password matches.
# If so, set the flag, and leave the loop:

          $accepted = &checkpwd($testpwd,$pwd) and last;
      }
  }

# all tested. See if the user passed:

  unless($accepted) {
      &goaway;
      exit;
  }

	Bart.


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

Date: 5 Aug 1999 01:11:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why is it....
Message-Id: <slrn7qiao8.tec.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXV September
MCMXCIII in <URL:news:37a8cf01@cs.colorado.edu>:
&&      [courtesy cc of this posting mailed to cited author]
&& 
&& In comp.lang.perl.misc, 
&&     abigail@delanet.com writes:
&& :I don't believe in this crap. Programming isn't some gift or art.
&& :Programming is something you can learn. Just like car mechanics.
&& :Or surgery. Or glass blowing. Or shoe repair.
&& 
&& Really?  You don't believe that some people have a knack for math and
&& that other don't?

Oh, yes I do. I just don't believe having a knack for math is a
requirement for being a programmer. Knowledge of certain fields of math
is a requirement to be a good programmer. But knowledge can be achieved
without having a knack for math. It just takes longer.

&&                    Do you believe that someone who doesn't have a logical
&& mind can be taught to have one?

I don't know what a 'logical mind' is. If this is some psychological
classification of how someone usually thinks, I do not believe that's
a scale with 2 buckets. It's most likely not a discrete scale either.
And even if someone on average is far away from the "logical" end of
this scale, it doesn't mean someone cannot think in a "logical" way.

&&                                  Do you believe that someone who doesn't
&& have intuitive leaps of insight can be taught to have them?

I do not know. Psychology hasn't been something I studied. But I do not
think that's a requirement for programming.

&&                                                               How do you
&& do that?  Where is creativity?

I do not think creativity is necessary for programming. A creative
solution might win you a round of Perl golf one day, or produce a real
nifty program, but the majority of the code is just bulk, not needing
any creativity.

&&                                 How do you teach it?  How do you learn it?

It? Creativity or programming? I do not know how to teach or learn
creativity, but having experience help. As for programming, you would
learn it just like any other skill: from someone who has the didactive
qualifications to teach you. If that someone is a maestro as well,
all the better. As for teaching, I'd use a good textbook and a blackboard.

&& Do you feel that the people who just don't "get" programming are all lazy?

No. People who don't "get" programming aren't lazy; they are just
normal. People who don't "get" programming, and make no effort to learn
programming are lazy. Programming isn't a divine gift. Programming is
something you can learn. A few people probably never learned how to
program, and are yet very good programmers.  One might say they "got"
it. There might even be such a person in the Perl community. But the rest
just has to learn. And some people will learn it with less effort than
others, because they are more interested, are smarter, or just happen
to have a more suitable mindset.

I will never be a Michael Schumacher. I never "got" driving. Yet I can
still safely drive a car. I wouldn't call myself an expert though. But
I can certainly be a better driver if I spend lots of time studying it.

If I would believe programming isn't something you can learn, I'd never
flame all those people not putting in any effort.


Abigail
-- 
Programming is a skill, not a gift.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 5 Aug 1999 01:20:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why is it....
Message-Id: <slrn7qib7h.tec.abigail@alexandra.delanet.com>

Tom Briles (sariq@texas.net) wrote on MMCLXIV September MCMXCIII in
<URL:news:37A8CD89.977F6F72@texas.net>:
<> Abigail wrote:
<> > 
<> > David Cassell (cassell@mail.cor.epa.gov) wrote on MMCLXIV September
<> > MCMXCIII in <URL:news:37A88A10.A96611AC@mail.cor.epa.gov>:
<> > ()
<> > () BTW, why is it acceptable to tell people that they have no
<> > () athletic ability, no musical ability, etc., but you
<> > () are a creep if you try to tell someone they have no gift
<> > () for programming?
<> > 
<> > I don't believe in this crap. Programming isn't some gift or art.
<> 
<> Weren't you espousing Knuth's _The Art of Computer Programming_ just a
<> day or two ago?

I didn't pick the title, nor did I make any statements derived from
that title, did I?

<> > Programming is something you can learn. Just like car mechanics.
<> > Or surgery. Or glass blowing. Or shoe repair.
<> 
<> I can also learn how to play basketball, but that doesn't mean I'll be a
<> Michael Jordan - no matter how much I practice.

My point exactly. You don't have to be Michael Jordan to be a basketball
player. You don't have to be MJ to know that the object of the game is
to throw a ball through a hoop. More people than MJ know when it's a good
time to pass the ball to a fellow player, and when to make a break for it.

<> >But there's no such thing as a born programmer.
<> 
<> I'd agree that people who become great programmers generally aren't
<> *just* great programmers.  They often have an aptitude for other related
<> activities.  But I don't think that someone born without the aptitude
<> will ever be a *great* programmer.

Maybe, maybe not. That probably depends on where you draw the line on
who's a great programmer or not. But being a programmer is what we're
discussing. Not being a great programmer. And please, don't try to go
that way; being "great" is a highly subjective.



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 5 Aug 1999 01:28:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why is it....
Message-Id: <slrn7qibmk.tec.abigail@alexandra.delanet.com>

David Cassell (cassell@mail.cor.epa.gov) wrote on MMCLXV September
MCMXCIII in <URL:news:37A8E2B4.370013F0@mail.cor.epa.gov>:
^^ Abigail wrote:
^^ > 
^^ > I don't believe in this crap. Programming isn't some gift or art.
^^ > Programming is something you can learn. Just like car mechanics.
^^ > Or surgery. Or glass blowing. Or shoe repair.
^^ 
^^ Yes, but some people can't learn *everything*.

That's why the above paragraph doesn't have 'and's, just 'or's.

^^ > Some people are better learners than others. Some people aren't interested
^^ > to learn programming, or how to repair shoes. Some jobs require more
^^ > learning than others. But there's no such thing as a born programmer.
^^ 
^^ I agree.  But is there a born baseball-player?  At some point,
^^ someone has to introduce you to a field of endeavor and get 
^^ you started.  Then you either take to it, or you don't.  You
^^ may need more help - that's fine.  You may have a different
^^ learning style, or take longer to get around to learning X -
^^ that's fine too.  But if you can never get past X - if can
^^ never pick up an insight in constructing algorithms, or if
^^ you can never hit the curveball, or if you can never sight-read,
^^ or...  Well, for every arena there is Spartacus, and there
^^ are lion-burgers.

You are trying to compare physical abilities with mental abilities.
I don't go there. That swamp smells too bad.

^^ My wife comes from a home ec background and never touched
^^ a computer until she was in grad school.  So what?  She's
^^ an accomplished programmer in SAS now.  Why?  Because she
^^ was willing to learn the syntax, to read the manuals, to
^^ try experiments to learn what works, etc.  Others with
^^ more hard-science training may be utter failures at the
^^ same tasks, because they just don't grok the concepts
^^ that underlie the code.

Your wife proves my point.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 05 Aug 1999 06:30:55 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Why is it....
Message-Id: <37ae2da0.2527264@news.skynet.be>

Eric Bohlman wrote:

>The "hacker" in the classic sense is motivated by a love of learning.  
>The script kiddie is motivated by an aversion to learning.

I like it.

	Bart.


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

Date: 5 Aug 1999 02:43:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why is it....
Message-Id: <slrn7qig40.tvu.abigail@alexandra.delanet.com>

Eric Bohlman (ebohlman@netcom.com) wrote on MMCLXV September MCMXCIII in
<URL:news:7oaqe2$od8@dfw-ixnews6.ix.netcom.com>:
<> 
<> The "hacker" in the classic sense is motivated by a love of learning.  

Strange. I never get that feeling when I think "hacker". The picture
I get by "hacker" is "if all else fails, try the manual".



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 4 Aug 1999 20:37:17 +0100
From: Paul <paul@mccombes.demon.co.uk>
Subject: Re: Why no Perl books at Fry's?
Message-Id: <l7aBbDAtZJq3EwDh@mccombes.demon.co.uk>

In article <slrn7qf1ab.s67.abigail@alexandra.delanet.com>, Abigail
<abigail@delanet.com> writes
>
>Lecture Notes in Computer Science; Springer Verlag. They also have a
>yellow wall, for their Math series. Yellow and grey walls are usually
>found in academic libraries, although there's at least one book shop in
>London (I can't remember the name, but I sure will be able to find it)
>that does have a grey wall.
>
Probably Foyle's in Charing Cross Road, as (a) it has a huge academic
stock and (b) it displays by publisher (even in the fiction department).
-- 
Paul


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 378
*************************************


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