[13344] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 754 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 9 20:07:23 1999

Date: Thu, 9 Sep 1999 17:05:15 -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, 9 Sep 1999     Volume: 9 Number: 754

Today's topics:
    Re: 6 first numbers of a chain of numbers? <agray@infoscience.otago.ac.nz>
    Re: About "Permission Dennied" (Abigail)
    Re: addressing multiple columns with sort <steadmrd@cafes.net>
    Re: addressing multiple columns with sort (Abigail)
    Re: Automating Secure Copy using Perl (Lachlan Cranswick)
    Re: Find 'sendmail' with only ftp... (Kai Henningsen)
    Re: fork? (Kai Henningsen)
        Generating random numbers from an array tmcandr@sears.com
    Re: Good way to learn PERL (Eric Bohlman)
        HELP!! Regular Expression GRU: Extract Text between two smansoor@my-deja.com
    Re: HELP!! Regular Expression GRU: Extract Text between <laurensmith@sprynet.com>
    Re: How do I get Userid <clwolfe@indiana.edu>
    Re: How to chown a symbolic link in Perl? (Kai Henningsen)
        Inserting environment variables at the command prompt steveeq1@earthlink.net
        LWP: Get <susan@dietzdesign.com>
        Opening files versus array searching <jebell@fas.harvard.edu>
        perl Makefile.PL fails <mikej@1185design.com>
    Re: perl Makefile.PL fails <dove@synopsys.com>
    Re: Removing a line from a text file (Kai Henningsen)
        Review of Object Oriented Perl by Damian Conway <david@kasey.umkc.edu>
        Services in Perl <alister2NOfnSPAM@csc.co.nz>
    Re: Smile... <mrdovey@iedu.org>
    Re: suggestion to revise grep (another Q: reference com (Kai Henningsen)
        Syntax Error <splinter@monmouth.com>
    Re: Syntax Error <uri@sysarch.com>
    Re: Syntax Error (Abigail)
        using 'my' and 'required' files <cLive@direct2u.co.uk>
    Re: Using strict? <agray@infoscience.otago.ac.nz>
    Re: Win32::ODBC help <jeff@vpservices.com>
    Re: Win32::ODBC help (Larry Rosler)
    Re: Y2K bugs on the Internet <keithmur@mindspring.com>
    Re: Y2K bugs on the Internet (Kai Henningsen)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 10 Sep 1999 10:07:03 +1200
From: Andrew Gray <agray@infoscience.otago.ac.nz>
Subject: Re: 6 first numbers of a chain of numbers?
Message-Id: <uk8pzivso.fsf@infoscience.otago.ac.nz>

Olivier Maas <olivier.maas@at-lci.com> writes:
> I have a chain of numbers han can be more than 6 numbers
> test =~ s/(\d\d\d\d\d\d)\d+/$1/;
> works but is there something better?

If you want to find the first six numbers then look at "perldoc
perlre" and read the section of quantifiers.

For example,

#!/usr/bin/perl -w
use strict;
my $value="9876543210";
my ($extract)=$value=~/(\d{6})/;
print $extract;

will return

987654

> please also mail answer to maas@ensae.fr

Sorry, but I can't do that.  You shall read as you post.

Cheers,
Andrew




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

Date: 9 Sep 1999 18:43:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: About "Permission Dennied"
Message-Id: <slrn7tghm2.pg8.abigail@alexandra.delanet.com>

Luis Toyos (uov02694@correo.uniovi.es) wrote on MMCC September MCMXCIII
in <URL:news:37D829E8.A4C218AA@correo.uniovi.es>:
() 
()     I am trying to execute an open(FILE,">file.dat") from a CGI and the
() system returns a 'Permission dennied'.

That's not a Perl problem.

() I was trying to do a 'chmod 777 directory'; (file.dat is @ directory),
() but
() it does not work


"It does not work"... Hmmm, verrrrrry clear what you mean by that.

You need of course only write permission to a directory, if you are going
to change the directory structure. Opening an existing file has nothing
to do with changing a directory structure.

But this has nothing to do with Perl....


Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== 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, 9 Sep 1999 17:33:26 -0500
From: "Josh Steadmon" <steadmrd@cafes.net>
Subject: Re: addressing multiple columns with sort
Message-Id: <37d83c88.0@news.isdn.net>

Most people don't know that lots of people don't have the faq (I didn't in
my first version of perl, which came in a crappy perl tutorial).  So try to
be a little kinder, ok?
Abigail wrote in message ...
>rootdog (corlando@NOTpop.phnx.uswest.net) wrote on MMCXCIX September
>MCMXCIII in <URL:news:6amB3.1269$IP5.153029@news.uswest.net>:
>::
>:: how do i use the sort { $a <=> $b} and its variants to sort on any
>:: of the  columns that I wish or how do I construct a subroutine that
>:: given n columns will sort on any combination of the given columns.
>
>RTFFAQ.
>
>:: In other words I am blocking (sucking)  big-time on figuring out complex
>:: sorting with the sort command.
>
>
>That's majorly stupid, as it's spelled out in the FAQ.
>
>
>
>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())))))))))))))))))))
))))
>
>
>  -----------== 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: 9 Sep 1999 18:39:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: addressing multiple columns with sort
Message-Id: <slrn7tghfd.pg8.abigail@alexandra.delanet.com>

Josh Steadmon (steadmrd@cafes.net) wrote on MMCC September MCMXCIII in
<URL:news:37d83c88.0@news.isdn.net>:
:: Most people don't know that lots of people don't have the faq (I didn't in
:: my first version of perl, which came in a crappy perl tutorial).  So try to
:: be a little kinder, ok?

No. And you're a Jeopardist, fully quoting sig and advertisement. So:

   *plonk*


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: Thu, 9 Sep 1999 23:49:04 LOCAL
From: l.cranswick@dl.ac.uk (Lachlan Cranswick)
Subject: Re: Automating Secure Copy using Perl
Message-Id: <l.cranswick.370.0BE2DF10@dl.ac.uk>


In article <m34sh65mj3.fsf@gandalf.bluecoat93.net> Brian Landers 
<blanders@gandalf.bluecoat93.net> writes:>Path: 
daresbury!server5.netnews.ja.net!nntp.news.xara.net!xara.net!gxn.net!news.maxwe
ll.syr.edu!newsfeed.atl!news4.atl.POSTED!not-for-mail>> Would rsync (Andrew 
Tridgell's software) work over ssh?

>Yes

Rsync does downloading via Secureshell very well.  Example webpage on this at:

  http://www.ccp14.ac.uk/ccp14admin/rsync/

Also refer download area at:
  http://rsync.samba.org

It can be a bit troublesome with mirrors over 1 Gig - but this seems to
be rather erratic at the moment.  It is a problem for some people
but not others.  I mirror material from the UK to Canada and UK to
Australia - around 2.5 Gig incrementally each night in around 10
minutes.  I do not seem to have any troubles at the moment.

Lachlan.

===
Lachlan M. D. Cranswick

Collaborative Computational Project No 14 (CCP14)
    for Single Crystal and Powder Diffraction
Daresbury Laboratory, Warrington, WA4 4AD U.K
Tel: +44-1925-603703  Fax: +44-1925-603124
E-mail: l.cranswick@dl.ac.uk  Ext: 3703  Room C14
                           http://www.ccp14.ac.uk



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

Date: 09 Sep 1999 21:57:00 +0200
From: kaih=7OYHCihXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Find 'sendmail' with only ftp...
Message-Id: <7OYHCihXw-B@khms.westfalen.de>

efflandt@xnet.com (David Efflandt)  wrote on 28.08.99 in <slrn7sem5h.173.efflandt@efflandt.xnet.com>:

> The most common path is /usr/lib/sendmail (not in your path, so 'which' or

I suspect these days the most common path is /usr/sbin/sendmail.

In any case, check both.

Of course, if this is not a Unix system, you may be out of luck.

Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: 10 Sep 1999 00:19:00 +0200
From: kaih=7ObHEaFHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: fork?
Message-Id: <7ObHEaFHw-B@khms.westfalen.de>

dan@tuatha.sidhe.org (Dan Sugalski)  wrote on 07.09.99 in <RlbB3.390$9v5.5433@news.rdc1.ct.home.com>:

> Dan Sugalski <dan@tuatha.sidhe.org> wrote:
>
> > (And threads are *not* tough to program--they're really a snap. I don't
> > understand the mental blocks folks have about 'em. OTOH, signals drive me
> > loopy. To each his own...)
>
> As I've had pointed out to me in private mail, this is defintely a matter
> of opinion. Some folks (like me) find threads really easy to deal with.
> And others don't. That I find them easy probably just means I'm weird...

Threads *are* a very nice programming paradigma. But to use them right,  
you need to

(1) *understand* about concurrency issues (such as the dining philosopher  
problem and so on)

(2) be able to find the right abstractions to minimize thread interaction  
(a useful skill in general, but one that's in sadly short supply in the  
general programming public)

Object oriented programming style is actually a pretty good match for  
threads; you get to hide all the ugly locking inside your object  
implementation. Getting it right with procedural style is quite a bit  
harder.

In any case, try to find a style of locking that works, and then *USE*  
*IT* *EVERYWHERE*! That helps a lot.

Once you get the basics right, threads can express a lot of stuff in a far  
more readable way. Servers are an obvious example. GUI code is another.  
Anything that needs to keep track of several independent, interleaved,  
complex operations qualifies.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Thu, 09 Sep 1999 22:39:15 GMT
From: tmcandr@sears.com
Subject: Generating random numbers from an array
Message-Id: <7r9cui$5kv$1@nnrp1.deja.com>

Would anyone happen to know how to generate a random number from
a set of array elements?

For example:  say I have an array containing the values 10,20,30
I'd lke to be able to randomly select one of these integer numbers from
the array.

Have not had much luck.

Thanks!!!!



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


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

Date: 9 Sep 1999 22:53:10 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Good way to learn PERL
Message-Id: <7r9dom$pe7@dfw-ixnews3.ix.netcom.com>

Jim Carison (matthew357@hotmail.com) wrote:
: Hello. I am fairly new to PERL and CGI. Although I understand enough to make
: small scripts that do a little bit of stuff, I am interested in making my
: skills good enough to use on the commercial level. If you can give me any
: information as to how I can learn PERL much better without a lot of upfront
: costs (like IT schools) but things like webpages or good books.

Step 1: learn the difference between Perl (the language itself), perl 
(the program that interprets the language) and PERL (which doesn't exist) ;-)

Step 2: Get on intimate terms with the very comprehensive set of 
documentation that comes with perl itself.  Learn to use perldoc and to 
use your OS's tools to search the documentation.  Definitely read all the 
FAQs that are included with the documentation.

Step 3: In most people's opinion, the best Perl books, with a couple 
exceptions, come from O'Reilly.  If you're comfortable reading books 
on-screen and don't mind not having something you can carry with you and 
read away from the computer, spend $70 on O'Reilly's Perl Desktop CD, 
which has all of their major Perl books: both the Unix and Win32 versions 
of _Learning Perl_, _Programming Perl_, _Advanced Perl Programming_, the 
_Perl Cookbook_ and _Perl in a Nutshell_ (you also get a hard copy of the 
last one).  If you want hard copies of everything, you'll probably have 
to limit your selections based on your budget (though if you have $200 to 
blow, get all of them).

If most of the documentation is Greek to you, start with the appropriate 
version of _Learning Perl_.  If the documentation makes sense to you but 
you're still unclear about a lot of things, get _Programming Perl_.  If 
the documentation is reasonably clear to you and you learn best by 
looking at examples, start with _Perl Cookbook_; you'll eventually want 
to get this no matter what.  _Advanced Perl Programming_ covers a 
grab-bag of topics; get it if any of them are of special interest to you.

Step 4: <URL:http://www.perl.com> contains a comprehensive listing of 
Perl resources, including reviews of all the books I mentioned.



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

Date: Thu, 09 Sep 1999 22:16:02 GMT
From: smansoor@my-deja.com
Subject: HELP!! Regular Expression GRU: Extract Text between two HTML Tags
Message-Id: <7r9bio$4hd$1@nnrp1.deja.com>

I need some help writing a regular expression that can extract text
between two HTML tags. For example I need to extract <BODY><IMG SRC ....
(Some other HTML)...</BODY> the resulting text will be <IMG SRC ...
(Some other HTML)...

I am new to regular expression and by reading other posts on this
group, I think it is very powerful tool for manipulating text. I am
still learning and at this point not sure if this is big task or just
a  single expression. I will appreciate your help.

Thanks

Shariq


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


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

Date: Thu, 9 Sep 1999 16:04:14 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: HELP!! Regular Expression GRU: Extract Text between two HTML Tags
Message-Id: <7r9edl$fff$1@brokaw.wa.com>


smansoor@my-deja.com wrote in message <7r9bio$4hd$1@nnrp1.deja.com>...
>I need some help writing a regular expression that can extract text
>between two HTML tags. For example I need to extract <BODY><IMG SRC
 ....
>(Some other HTML)...</BODY> the resulting text will be <IMG SRC ...
>(Some other HTML)...
>
>I am new to regular expression and by reading other posts on this
>group, I think it is very powerful tool for manipulating text. I am
>still learning and at this point not sure if this is big task or just
>a  single expression. I will appreciate your help.


s/<BODY>(.*?)<\/BODY>/$1/s;

But, then again, you may want to do more than just this.

perlfaq9 "How do I remove HTML from a string?"

has more information that you may find useful.

Lauren




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

Date: Thu, 09 Sep 1999 18:10:15 -0500
From: Clinton Wolfe <clwolfe@indiana.edu>
Subject: Re: How do I get Userid
Message-Id: <37D83E57.6A74AEFB@indiana.edu>

Mar Soto wrote:
> print of the variables:
> $< and $>.  I also tried using $EFFECTIVE_USER_ID and $REAL_USER_ID and

$< and $> should work OK.  $EFFECTIVE_USER_ID requires "use English;".

> it does not work.
> It returns an integer.  How do I get this value and then how do I change
> it?  `setuid $value` is not working.

Yes, it returns an integer.  It's working fine.  the uid IS an integer. 
If you want the userNAME, use this:

$username = getpwuid $<; # (scalar context) or
($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwuid
$<;

No, $passwd is not the real password for the user.  You should spend
some time learning about the history and idioms of the UN*X world, and
then these things will be much clearer.  

> Thank You,
> 
> Omar Soto


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

Date: 09 Sep 1999 22:14:00 +0200
From: kaih=7OYHCsfmw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: How to chown a symbolic link in Perl?
Message-Id: <7OYHCsfmw-B@khms.westfalen.de>

pdf@morgan.ucs.mun.ca (Paul David Fardy)  wrote on 29.08.99 in <7qbv4k$5dn$1@coranto.ucs.mun.ca>:

> "Stein-Erik Engbråten" <seen@statoil.no> writes:
> > How do I change the UID and/or GID on a symbolic link in Perl (this is
> > on Unix machines, by the way...:-)
>
> Tom Christiansen <tchrist@mox.perl.com> writes:
> > Perl doesn't do this.  Do you know why many systems don't support the
> > idea?  Because it conveys no distict functionality.  Modes and owners
> > and times on symbolic links have no meaning.  So why bother?  And it's
> > very non-portable.
>
> It seems to mean something to web servers.  I've seen Apache and NCSA
> httpd refuse to follow a symlink unless the owner of the link matched
> the owner of the target.
>
> Is that unusual?  Maybe it's a (mis?)configuration option.

It's obviously meant to improve security. I don't know if it actually  
does.

However, there's another situation where symlink ownership matters.

On some Unix systems, /tmp (and some other directories) has the sticky bit  
set, which means (on those systems - I think it's originally a BSDism)  
that only the owner of a file (or root) is allowed to remove it, so that  
different users can't stomp on their temp files. Obviously, this also  
works for symlink owners.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Thu, 09 Sep 1999 22:26:27 GMT
From: steveeq1@earthlink.net
Subject: Inserting environment variables at the command prompt
Message-Id: <7r9c66$56a$1@nnrp1.deja.com>

I am debugging a script in Perl that uses variables dervied from the
$ENV{"QUERY_STRING"} variable. Is there a way to manually provide the
$ENV{"QUERY_STRING"} from the command prompt for debugging purposes?

- Steve


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


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

Date: Thu, 09 Sep 1999 16:09:36 -0700
From: "Susan Malmrose" <susan@dietzdesign.com>
Subject: LWP: Get
Message-Id: <Y4XB3.2048$FX.89848@news.uswest.net>

I need to use LWP and the get function to pull several text files from an 
outside server, however I need them to all end up as one text file on my
server. I'm completely new to Perl. Can anyone give me an example or point
me to some resources that will show examples of how to code for something
like this?

Thanks,

Susan

susan@dietzdesign.com
Dietz Design Co.
80 S. Jackson #308
Seattle, WA 98104
206-621-1855

http://www.dietzdesign.com



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

Date: 9 Sep 1999 23:09:14 GMT
From: Jefferson Bell <jebell@fas.harvard.edu>
Subject: Opening files versus array searching
Message-Id: <7r9emq$ffd$1@news.fas.harvard.edu>

Hi,
	I'm writing a script that searches through
several textfiles that are somewhat interconnected
as a rough database.  In writing this script, I'm
wondering if it would be faster in searching to create 
one large 3 dimensional array at first or to open and close 
each of the ~50 files as needed possibly opening and
closing the same file more than once. 

thanks,
Jeff Bell


-- 
---
 Jefferson Eliot Bell
 jebell@fas.harvard.edu


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

Date: Thu, 09 Sep 1999 16:50:24 -0700
From: mikej <mikej@1185design.com>
Subject: perl Makefile.PL fails
Message-Id: <37D847E8.B7293A58@1185design.com>

Heres what I get after I expand a new Perl module and try to run the
Makefile, or attempt to run any scripts at all from the shell:

# perl Makefile.PL
perl: not found

Does anyone know what the problem is and how I can fix it? Thanks.

-mike



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

Date: Thu, 09 Sep 1999 16:57:48 -0700
From: David Amann <dove@synopsys.com>
Subject: Re: perl Makefile.PL fails
Message-Id: <37D8497C.5E352890@synopsys.com>

Hi Mike,

Try typing the full path to the perl interpreter.  For example, if perl
is in the /usr/local/bin directory, try typing

% /usr/local/bin/perl Makefile.PL

Hope this helps,
-=dav


mikej wrote:

> Heres what I get after I expand a new Perl module and try to run the
> Makefile, or attempt to run any scripts at all from the shell:
>
> # perl Makefile.PL
> perl: not found
>
> Does anyone know what the problem is and how I can fix it? Thanks.
>
> -mike



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

Date: 09 Sep 1999 23:21:00 +0200
From: kaih=7OYHEEpXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Removing a line from a text file
Message-Id: <7OYHEEpXw-B@khms.westfalen.de>

lr@hpl.hp.com (Larry Rosler)  wrote on 28.08.99 in <MPG.1231bf3083d23984989ec4@nntp.hpl.hp.com>:

> That question is Frequently Asked here.

What fascinates me is that this *is* a FAQ, when to me the answer would  
seem extremely obvious. I don't think I want to think about what this says  
about the people posing this particular question.

I mean, even a completely non-computer person should get the analogy to  
inserting/deleting from the middle of a page of a book, say.

I guess I'm still far too optimistic.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Thu, 09 Sep 1999 23:24:33 +0000
From: "David L. Nicol" <david@kasey.umkc.edu>
To: kansas-city-pm-list@hfb.pm.org
Subject: Review of Object Oriented Perl by Damian Conway
Message-Id: <37D841B1.9FD5F97F@kasey.umkc.edu>



Damian Conway's Object Oriented Perl,

http://www.amazon.com/exec/obidos/ASIN/1884777791/tipjartransactioA/t

is an excellent introduction to OO using Perl.

Written as a textbook and used as such by Stonehenge Consulting
services,
Object Oriented Perl may be the ultimate reference on object oriented
theory and practice using the standard all-purpose programming language
of the twentyfirst century. For the autodidact, this book is readable in
much the same way as the Llama or Camel.

Conway provides examples of use of the features of the very latest
iteration of the Perl OO standard, 5.005, such as blessed regular
expressions and _init methods, while always keeping an eye on the truth
that the end goal of your programming project is probably, somewhere,
somehow, "to engender a warm feeling."

As Randal Schwartz claims in the book's forward, the wait is now over
for
the perfect object-oriented Perl book. In the spirit of reusability, I
quote:

"Damian Conway has written a comprehensive guide, organized well for
both
the casual OO hacker as well as the experienced OO user, including large
reusable chunks of code (and that's what OO is all about.)

"Damian's humor makes the reading light and fast. The depth of coverage
from 'what's the big fuss about Perl objects?' to 'creating a self-tied
inheritable overloaded filehandle with autoloaded accessors' means that
this is the first and last book I need to teach Perl objects to my
students.

"For experienced users, the appendix comparing and contrasting Perl with
other popular OO languages is by itself worth the entire price of the
book."


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

Date: Thu, 09 Sep 1999 16:44:41 -0700
From: Aaron Lister <alister2NOfnSPAM@csc.co.nz>
Subject: Services in Perl
Message-Id: <1415c574.0de9d1ae@usw-ex0102-013.remarq.com>

Anyone know how to create a service on a winnt platform in 
perl?

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Thu, 09 Sep 1999 17:09:36 -0500
From: Morris Dovey <mrdovey@iedu.org>
Subject: Re: Smile...
Message-Id: <37D8301F.C352EBB4@iedu.org>

Greg Martin wrote:

> On Wed, 08 Sep 1999 19:38:12 GMT, Karl Schmidt <nospam@nospam.de>
> wrote:
>
> I feel much better now. I kept hearing about this ear-to-cake problem
> and thinking what a silly lot. Just take the cake out of your ear. I
> see now the problem was some what more serious.
> Regards,
> Marie Antoinette

And all this time I'd thought it was "Why U.K.?"

Morris Dovey
West Des Moines, Iowa USA
  Where the power failed today (9-9-99) at half past nine [True!]
mrdovey@iedu.org




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

Date: 09 Sep 1999 21:24:00 +0200
From: kaih=7OYHC4pHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: suggestion to revise grep (another Q: reference comparison)
Message-Id: <7OYHC4pHw-B@khms.westfalen.de>

lr@hpl.hp.com (Larry Rosler)  wrote on 08.09.99 in <MPG.123fff1a394620a7989f2b@nntp.hpl.hp.com>:

> In article <slrn7tad96.m3v.sitaram@diac.com> on 8 Sep 1999 04:58:27 -
> 0700, Sitaram Chamarty <sitaram@diac.com> says...

> > If you mean what is also called a "deep compare" (comparing the
> > referants for equality, recursively if they happen to be or
> > contain references), then it may be a little more difficult.  I'm
> > sure there's a module for this somewhere though :-)
>
> I don't understand what you mean.  If two references are equal, they
> refer to the same entity -- 'pointing at the exact same referant' in
> your words.  Therefore there is no such thing as a 'deep compare'.

Oh, there is.

> I think you are confusing this comparison with 'deep copy'.  Please
> enlighten me if I have misunderstood your observation.

I don't think so.

He's talking about what Lisp calls "equal" (as opposed to, say, "eq").

You'll get something like a (not particularly cheap) deep comparision from  
the following (not tested):

use Data::Dumper;

sub equal($$)
{
   Data::Dumper->Dump([\$_[0]], ['x'])
     eq Data::Dumper->Dump([\$_[1]], ['x']);
}

From this, it should be clear how to write a better implementation. Also,  
what the main caveat is (circular data structures).

Where would you use something like that? Well, maybe when implementing  
subexpression elimination :-)

Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Thu, 9 Sep 1999 18:32:48 -0400
From: "Matt" <splinter@monmouth.com>
Subject: Syntax Error
Message-Id: <7r9cg4$c37$1@news.monmouth.com>

Hi,

Perl reported back to me that the following line had a syntax error...could
someone tell me what I'm doing wrong?

    if (!($alreadyfound ~= /$B_make/)) {

Thanks,

-Matt




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

Date: 09 Sep 1999 18:37:30 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Syntax Error
Message-Id: <x7aeqvn239.fsf@home.sysarch.com>

>>>>> "M" == Matt  <splinter@monmouth.com> writes:

  M> Perl reported back to me that the following line had a syntax
  M> error...could someone tell me what I'm doing wrong?

  M>     if (!($alreadyfound ~= /$B_make/)) {

the bind operator is =~.

and you can better express the negative if with unless.

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: 9 Sep 1999 18:40:47 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Syntax Error
Message-Id: <slrn7tghh6.pg8.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCC September MCMXCIII in
<URL:news:x7aeqvn239.fsf@home.sysarch.com>:
\\ >>>>> "M" == Matt  <splinter@monmouth.com> writes:
\\ 
\\   M> Perl reported back to me that the following line had a syntax
\\   M> error...could someone tell me what I'm doing wrong?
\\ 
\\   M>     if (!($alreadyfound ~= /$B_make/)) {
\\ 
\\ the bind operator is =~.
\\ 
\\ and you can better express the negative if with unless.


Or with !~



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, 09 Sep 1999 15:43:39 -0700
From: cLive hoLLoway <cLive@direct2u.co.uk>
Subject: using 'my' and 'required' files
Message-Id: <37D8381B.F529E7F6@direct2u.co.uk>

Hi,

I'm trying to (belatedly) convert a bunch of scripts so they'll work
under strict. Two problem areas though.

I require a configuration file at runtime. How should I declare
variables in this file, and how should I then refer to them from the
program?

Also, I create a bunch of vars (for convenience) from a hash by:

foreach $var (keys %Hash) {
	$$var = $Hash{$var};
}

I'm still a little vague on reference thingies. Do I declare the $$var
created? how do I refer to it in one script if it's being run in a
script required by the original script?

aaaarghh. Anyone seen a nice description of all this with lovely, pink,
fluffy examples that won't make my brain hurt too much?

cLive ;-)



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

Date: 10 Sep 1999 10:15:12 +1200
From: Andrew Gray <agray@infoscience.otago.ac.nz>
Subject: Re: Using strict?
Message-Id: <uhfl3ivf3.fsf@infoscience.otago.ac.nz>

Danny <danny@blueberry.co.uk> writes:
> My developers are currently being forced to use strict by the software
> environment that they are programming in - apart from pre-declaring vars
> is there any other obvious potential things that they should look for in
> their code?

Forced to use strict?  What environment is this?  You should always
use strict unless you have a good reason not to, but I can't say that
I've ever heard of a tool that demanded it.

If there are parts of their code that fail strict then the compiler
should complain.  If you mean instead, what do you have to do in order
to ensure that your code will pass strict, read "perldoc strict".  You
may also want to check "perldoc perldiag" for warnings generated by
-w.  Is that mandatory as well?

> They are getting some odd occurencies where sometimes the perl script is
> being executed and at other times it is not - any ideas?

I suspect that your programmers are failing to stand on one leg at all
times while the script is running.  Perhaps I could offer more advice
if you offered more details.

Cheers,
Andrew


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

Date: 9 Sep 1999 23:02:05 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Win32::ODBC help
Message-Id: <37D83B6C.6627F001@vpservices.com>

"Harlan Carvey, CISSP" wrote:
> 
> > >       $stmt = "INSERT INTO ITEST1 (HostID,RegKey,Value,Data)".
> > >                 "VALUES ('$server','$rkey','$valkey','$value')";
> >
> > There is an SQL syntax error in the contents of $stmt
> 
> Where?

Try printing out $stmt to see what it actually looks like.  Hint: white
space!

-- 
Jeff


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

Date: Thu, 9 Sep 1999 16:50:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Win32::ODBC help
Message-Id: <MPG.1241e78a2b1e25d8989f3d@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <37D82B1D.8AB610FF@patriot.net> on Thu, 09 Sep 1999 17:48:13 
-0400, Harlan Carvey, CISSP <carvdawg@patriot.net> says...
> > >       $stmt = "INSERT INTO ITEST1 (HostID,RegKey,Value,Data)".
> > >                 "VALUES ('$server','$rkey','$valkey','$value')";
> >
> > There is an SQL syntax error in the contents of $stmt
> 
> Where?  I've spelled everything correctly, there are 4 fields and 4 values, all
> identified correctly.

Did you try -- instead of simply looking at the code -- actually 
printing the value of $stmt?  Then the problem should be clear.

Learning how to debug code is essential to self-sufficient programming.

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


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

Date: Thu, 09 Sep 1999 17:53:27 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Y2K bugs on the Internet
Message-Id: <37D83A67.29C68CD6@mindspring.com>



Malcolm Ray wrote:
> 
> On Tue, 07 Sep 1999 12:40:22 GMT, finsol@ts.co.nz <finsol@ts.co.nz> wrote:
> >Is it any surprise that there is such a lot of Y2K bugged code about
> >when many prominent programmers do very little in informing their
> >programming community on this subject and in some cases deny there is
> >indeed any problem?
> 
> You're so right!  There's been *no* publicity about Y2K.  I've seen no
> TV or newspaper coverage of the issue, and it's never raised in the trade
> press.  It never gets a mention in programming-related newsgroups, and
> I've seen no websites devoted to it.  I've yet to meet a programmer who's
> aware that it's an issue, and certainly nobody realises that they should
> *test* their code.  In fact, you're probably the only person writing
> about it.  Boy, won't everyone be surprised on 1/1/2000!

At least one person in the world at large has heard about it.  I was
recently watching a program on C-SPAN about it, and some hayseed
actually called in and drawled:

"Has ennybody ever tried askin' Bill Gates about how to solve this?"

I tell no lie.  I guess they haven't, though, so Bill Gates' mighty
brain will remain untapped.  What a waste.  Maybe one of y'all could ask
him.  ;-)


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

Date: 09 Sep 1999 23:09:00 +0200
From: kaih=7OYHDFj1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Y2K bugs on the Internet
Message-Id: <7OYHDFj1w-B@khms.westfalen.de>

pudge@pobox.com (Chris Nandor)  wrote on 07.09.99 in <pudge-0709991617590001@192.168.0.77>:

> I defy you to show me one example of a good programmer making a Y2K error
> in Perl.  Oh, that's right, you don't know Perl, and you couldn't tell if
> the programmer who wrote a program is good or not.

Well, there *is* the Y2K bug written by Larry himself and published in one  
of the early Perl books (I forget which one). The one about generating man  
pages out of Perl code. (It's a "19$year" style bug.)

The fact that this selfsame bug has been talked about here quite often  
argues for it being the only example of this people could find.

> # Despite frequent admonishments that programmers should 'read the
> # manual', it is clear that Perl is often learnt by example.  The
> # following Perl book review makes this point.
>
> Irrelevant.  Don't read the docs, and you are stupid and deserve whatever
> fate you get.

Wrong argument.

"Doesn't read the docs, so how are we supposed to teach him, then?" would  
be the right one.

> Learn by doing AFTER reading the docs.

Before, after, doesn't really matter, as long as you *do* read the docs.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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