[8888] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2504 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 5 14:20:19 1998

Date: Tue, 5 May 98 11:00:44 -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           Tue, 5 May 1998     Volume: 8 Number: 2504

Today's topics:
        Accessing ACCESS database ?? <TiTus@starmail.com>
    Re: Bidirectional pipe filehandles? <lwp@flenser.ibm.net>
    Re: Bill Gates should be invited to O'Reilly's "Free So (Phillip Rulon)
    Re: cd with a perl-script (H. Eckert)
    Re: Chicago Perl Mongers meeting May 8 (Jim Allenspach)
    Re: condition to subroutine (Tom Grydeland)
    Re: condition to subroutine <danboo@negia.net>
    Re: condition to subroutine <sowmaster@juicepigs.com>
        cookies esxpiration mdlbikes@walrus.com
    Re: cookies esxpiration (brian d foy)
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) (Matthew Cravit)
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) (Chris Nandor)
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) <scribble@pobox.com>
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) <birgitt@order.booktraders.com>
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) (Stuart McDow)
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) (Chris Nandor)
    Re: Ever Wonder Why Not Everyone Uses Modules? (Bennett Todd)
    Re: Ever Wonder Why Not Everyone Uses Modules? (Matthew Cravit)
    Re: Ever Wonder Why Not Everyone Uses Modules? (Matthew Cravit)
    Re: failing to interpret * on NT command line <david.richards@alderley.zeneca.com>
    Re: failing to interpret * on NT command line (Gurusamy Sarathy)
    Re: Hello people, want to learn Perl ? (Matthew Cravit)
    Re: help a novice in perl! (brian d foy)
        HELP! how do I insert page breaks?! <asisson@onramp.net>
        How to delete an element in an array? <tsui@cbmi.upmc.edu>
    Re: How to delete an element in an array? (brian d foy)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 5 May 98 16:03:23 GMT
From: "Yun" <TiTus@starmail.com>
Subject: Accessing ACCESS database ??
Message-Id: <01bd783f$2ca00800$577d74cb@joy-ong>

Hi All

I'm new at PERL.  Wonder if anyone would be kind enough to help this poor
kid :P

How do I generate a report (in html) with data from an ACCESS database?
Does anyone has the code to it?
Been trying with Win32::ODBC, but keep having compilation errors!

please help!




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

Date: 5 May 1998 17:07:06 GMT
From: Lou Poppler <lwp@flenser.ibm.net>
Subject: Re: Bidirectional pipe filehandles?
Message-Id: <354f473a.1@news1.ibm.net>

On Mon, 04 May 1998 14:10:23 GMT, 
Randal Schwartz <merlyn@stonehenge.com> wrote:
:>>>>> "Lou" == Lou Poppler <lwp@flenser.ibm.net> writes:

: Lou> I did not write the text quoted below.

: Yes.  We can tell.  How come you couldn't?  It's plain to me that you
: *quoted* that from another article, and didn't write it.  I might
: infer something from the fact that you *quoted* it, but as far as
: writing is concerned, no biggy.

: Lou> Please be more careful with your attributions.

: I'd say tigger@io.com was already pretty careful.  Please be careful
: with your complaints. :-)

The issue is sloppiness, I think.  My article <3548cd7b.0@news1.ibm.net>,
to which tigger was following up, includes the attribution line for the
actual writer of the text quoted by tigger.  Tigger seems to be ignoring
everything I wrote, and replying to Alik Widge's original question.

I stand by my complaint, minor though it may be :-)


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

Date: 5 May 1998 17:11:01 GMT
From: rulon@xtender.com (Phillip Rulon)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <6inh75$16a$3@server.cntfl.com>

In article <6i9ugc$jo3@bgtnsc03.worldnet.att.net>, "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> writes:
>
>Drew Csillag wrote in message <3548740C.9929FE0F@geocities.com>...
>>Frank Sweetser wrote:
>>>
>>> Oleg Dulin <dulino@ulticom.nvo.com> writes:
>>>
>>> > > I keep imagining a musical piece called Dueling Bootsectors...
>>> >
>>> >
>>> > Yeah... (defun question(To-be) (OR (To-be (NOT To-be))))
>>>
>>> heh... perfer perl myself...
>>>
>>> sub question{
>>>         2*b || ! 2*b;
>>> }
>>>
>>Or Python, my drug of choice:
>>def question():
>> return 2*b or not 2*b
>
>I hope I have this syntax right. It's been a long time . . .
>
>: question b 2 * dup not or ;
>

question = 2*b? 2*b: !(2*b);

Do we need a life or what :^)



-- 
Phil Rulon                                           rulon@msd.xtender.com




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

Date: 5 May 1998 15:59:05 GMT
From: ripley@nostromo.in-berlin.de (H. Eckert)
Subject: Re: cd with a perl-script
Message-Id: <slrn6kudq9.71t.ripley@nortobor.nostromo.in-berlin.de>

michael.pokerschnig@stk.co.at (Michael Pokerschnig):
> If the script finds the file it should set the current working dircetory
> of the shell from which it was called.

No way you can do this with Unix unless you call the script in a
special way.

cd `scriptname`

Greetings,
				Ripley
-- 
http://www.in-berlin.de/User/nostromo/


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

Date: 5 May 1998 11:22:27 -0500
From: jima@MCS.COM (Jim Allenspach)
Subject: Re: Chicago Perl Mongers meeting May 8
Message-Id: <6inec3$oov@Venus.mcs.net>

petdance@maxx.mc.net (Andy Lester) writes:

>Is it true that with the cuts in funding that the donuts and dancing girls
>are being replaced with Cheerios and waddling old ladies?

	Not true! We still have them. They're just not actual size.
jma



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

Date: 5 May 1998 16:21:36 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: condition to subroutine
Message-Id: <slrn6kuf4f.136.Tom.Grydeland@mitra.phys.uit.no>

On Tue, 05 May 1998 11:04:44 -0400,
Bob Trieger <sowmaster@juicepigs.com> wrote:

> I haven't used the ampersand since I found out it wasn't needed in perl
> 5. When I call a subroutine that needs no values passed to it I've been
> doing it via:   SUBROUTINE();  Have I been missing something important
> for a couple of years? Are there any meaningful differences between
> "&SUB" and "SUB()"?

The difference is between &sub; and &sub();

Go look it up.  It's on the first pagefull of perlsub.

> Bob Trieger               |  Titanic: big boat, bigger

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: Tue, 05 May 1998 11:40:05 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: condition to subroutine
Message-Id: <354F32D5.591EFA22@negia.net>

Bob Trieger wrote:
> 
> Ilya Zakharevich wrote:
> > <sowmaster@juicepigs.com>],
> > who wrote in article <354E701D.76CD@juicepigs.com>:
> > > I also learned empty parens aren't needed when ampersand is used.
> >
> > Whatdoyoumean, "aren't needed"?  They provide a different semantic.
> 
> I haven't used the ampersand since I found out it wasn't needed in perl
> 5. When I call a subroutine that needs no values passed to it I've been
> doing it via:   SUBROUTINE();  Have I been missing something important
> for a couple of years? Are there any meaningful differences between
> "&SUB" and "SUB()"?

yes there are meaningful and useful differences. try this:

sub foo { defined @_ ? 'def' : 'undef'; }
print &foo, "\n";
print &foo(), "\n";

one thing i typically do is use the &foo form to return a values and
the &foo() to explicitly clear the value. its use is really up to you
of course. it just allows you to make a distinction between calls with
the empty list and calls with no list. just be sure the behavior is
well documented since this difference may not be entirely intuitive to
anyone who comes along to use your subroutines.

cheers,

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: Tue, 05 May 1998 13:34:31 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: condition to subroutine
Message-Id: <354F4DA7.5FE3@juicepigs.com>

Tom Grydeland wrote:
> 
> On Tue, 05 May 1998 11:04:44 -0400,
> Bob Trieger <sowmaster@juicepigs.com> wrote:
> 
> > I haven't used the ampersand since I found out it wasn't needed in perl
> > 5. When I call a subroutine that needs no values passed to it I've been
> > doing it via:   SUBROUTINE();  Have I been missing something important
> > for a couple of years? Are there any meaningful differences between
> > "&SUB" and "SUB()"?
> 
> The difference is between &sub; and &sub();
> 
> Go look it up.  It's on the first pagefull of perlsub.

Perhaps I phrased my question wrong. If I intend to call a subroutine
and need to pass no values to or from the subroutine, can passing a null
string to it be harmful? Benchmark shows no timing issues.

I got into this bad habit back in 5.001 (on freeBSD) somewhere when I
was having problems calling subroutines without the ampersand and
passing nothing at all to the sub.


-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: Tue, 05 May 1998 11:44:21 -0600
From: mdlbikes@walrus.com
Subject: cookies esxpiration
Message-Id: <6infl6$nc0$1@nnrp1.dejanews.com>

I trying to set a cookie to expire an hour from the time the cgi script runs.
I am using the syntax "Set-Cookie: Day, mon-day-year 00:00:00 GMT". What
happens is that Netscape shows me the alert window with a different expiration
time an date. Is there a specific syntax for the date on the Set-Cookie
command?

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 05 May 1998 13:36:30 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: cookies esxpiration
Message-Id: <comdog-ya02408000R0505981336300001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6infl6$nc0$1@nnrp1.dejanews.com>, mdlbikes@walrus.com posted:

>I trying to set a cookie to expire an hour from the time the cgi script runs.
>I am using the syntax "Set-Cookie: Day, mon-day-year 00:00:00 GMT". What
>happens is that Netscape shows me the alert window with a different expiration
>time an date. Is there a specific syntax for the date on the Set-Cookie
>command?

see the cookie documentation referenced in the CGI Meta FAQ, or use
a module such as CGI.pm that makes it a no-brainer.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: 5 May 1998 09:46:32 -0700
From: mcravit+usenet@mcravit.vip.best.com (Matthew Cravit)
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <6infp8$78k$1@shell3.ba.best.com>

In article <u3753hy5.fsf@mailhost.panix.com>,
Jonathan Feinberg  <jdf@pobox.com> wrote:

>The CPAN module does indeed know about dependencies, etc.  Try it, if

Some of the time, anyway. I note that the example for updated all loaded
modules which is given in the CPAN docs,

     # install everything that is outdated on my disk:
     perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'

has blown up my copy of perl every time I've tried it. The problem is that
it blithely goes through in alphabetical order, and so when it gets to the
IO:: modules, it upgrades IO.pm and then I get IO version mismatches and
nothing works after that.

A major pain in the butt, I think. This function would be handy if it did
not try to upgrade any of the bundled Perl modules, but only processed the
optional modules which were loaded.

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@net.com (work)      | time you make it.


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

Date: Tue, 05 May 1998 16:59:32 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <pudge-0505981257230001@192.168.0.3>

In article <6infp8$78k$1@shell3.ba.best.com>,
mcravit+usenet@mcravit.vip.best.com (Matthew Cravit) wrote:

# Some of the time, anyway. I note that the example for updated all loaded
# modules which is given in the CPAN docs,
# 
#      # install everything that is outdated on my disk:
#      perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'
# 
# has blown up my copy of perl every time I've tried it. The problem is that
# it blithely goes through in alphabetical order, and so when it gets to the
# IO:: modules, it upgrades IO.pm and then I get IO version mismatches and
# nothing works after that.
# 
# A major pain in the butt, I think. This function would be handy if it did
# not try to upgrade any of the bundled Perl modules, but only processed the
# optional modules which were loaded.

Well, you could just do:

    % perl -MCPAN -e shell

    cpan> r

Then install the ones you want.  Yes, the problem with the IO modules is a
problem.  Ugh.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 5 May 1998 12:02:18 -0500
From: Tushar Samant <scribble@pobox.com>
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <6ingmq$abi@tekka.wwa.com>

mcravit+usenet@mcravit.vip.best.com writes:
>
>     # install everything that is outdated on my disk:
>     perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'
>
>has blown up my copy of perl every time I've tried it. The problem is that
>it blithely goes through in alphabetical order, and so when it gets to the
>IO:: modules, it upgrades IO.pm and then I get IO version mismatches and
>nothing works after that.

Set UNINST=1 in your 'make install' options. Currently the standalone
IO:: modules install themselves in a different place than the core,
so you get two copies unless you have UNINST=1.



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

Date: Tue, 05 May 1998 13:12:02 -0400
From: Birgitt Funk <birgitt@order.booktraders.com>
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <354F4862.DFDD6137@order.booktraders.com>

> Chris Nandor <pudge@pobox.com> wrote:
> 
> : Since when can clueless newbies be expected to understand useful resources?
> 

They are expected and challenged to understand them, every day.


> Maybe because of the volumes of replies on this newsgroup that simply say
> "There's a module that does that available on CPAN".
> 
> : You say above that clueless newbies should be able to figure it out.  Why
> : on earth should clueless newbies be able to do this?  CPAN is made by
> : programmers for programmers. 

Aha - nice to hear.

So why should we clueless newbies be able to 'figure it out' ?

Never been a newbie yourself ? Do you have children/teenage/
college kids newbies by any chance who want, need to do their
first projects on their own? Are no programmers yet, but
may be could become one day ?

I am a blond, female, dumb, clueless newbie non-programmer who 
needs to use CPAN in the near future for the first time.

May be your remark is aimed to scare someone like me away ?
IMHO it just causes the opposite, at least for me.

I can't wait to try it out and will be delighted 
to have been allowed access and been pointed to it as one of 
the best resources there are. 

> : it, and naught a user here will shed a tear.

You bet that no matter what I wouldn't shed a tear over any 
of your lost potential newbie customers who decided to do the 
job by themselves. 

And you bet that I will point out to authors if I find 
wishy-washy documentation for the sake of "sitting on 
their knowledge" or "being docs just for programmers".  


> : it, and naught a user here will shed a tear.
> 
> This is idiotic. It is not valid to assume that "newbie != programmer".
> 
> There are plenty of "newbies" (of varying degrees of cluelessness) who
> could become a lot more clueful if CPAN were better organized.
> 

Don't worry, even if CPAN should be a mess (what I seriously 
doubt) we clueless will figure it out and leave the clueful 
in their parlor. 

Might get pretty lonely out there after a while ... 

Birgitt Funk


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

Date: 5 May 1998 17:19:30 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <6inhn2$lgb$1@ns1.arlut.utexas.edu>

cpierce1@ford.com writes:
>
> Mostly because I could almost never find the module they were
> talking about on CPAN, or get it installed without a lot of
> problems--so I re-invented a LOT of Perl's wheels.  Not a really
> good use of my time.

I can't understand why we (you and I) have such different experiences
with CPAN. I've been using perl for a long time, but I didn't start
playing around with CPAN.pm until about six months ago. From day one,
I was able to download, build, and install modules (and bundles)
without *any* problems. Then I kicked myself for putting off using it
for so long. I'm just not understanding what is so difficult about
CPAN.pm.

IMO, CPAN.pm (combined with the ExtUtils modules) is even easier to
use than downloading, building, and installing GNU tools. That's
saying a lot, 'cause the FSF makes it really easy via autoconf.

> If CPAN were a useful, easily searched, indexed, and well-maintained
> resource then a pointer to CPAN would be a valid, helpful answer.

I've always been able to find what I was looking for using
% perl -MCPAN -eshell
cpan> i /something/

 ... and then by using a little intuition (and reading readmes), I can
determine the module or bundle I need to download. If a module is part
of a bundle, then I just install the bundle and be on my way.

> (But the CPAN Ego is hard to overcome.  Is an index by module
> _author_ really necessary, other than for stroke value?)

It sounds like you don't know how the CPAN and PAUSE works. If my
understanding is correct, authors are registered by name. There has to
be *somewhere* they upload files to.

> But since the re-invention of that module is strongly discouraged by
> the Perl Cabal, the author has no incentive to keep his descriptions
> up-to-date, dependencies low, and user-interface easy to use.  Thank
> the gods that CPAN has no competition.

Perl is a general-purpose language. One can work at any level of
abstraction one chooses to. There is nothing to stop people from
reinventing the wheel if they want to. A lot of us have already
reinvented the wheel bazillions of times during the reign of perl4. I
can't speak for everyone, but I've done it enough times to never, ever
want to do it again (except for those cases where a particular wheel
didn't already exist, but then that wouldn't be reinvention. It'd be
just invention). For that, I'm extremely grateful for modules
available from the CPAN. If were to post on clpm, asking how to do
something, I'd be *very* annoyed if someone explained to me how to
reinvent the wheel and I later found that the wheel was available from
the CPAN. Very annoyed indeed.

> A point made on a different branch of this thread was "but there's nothing
> like this re-use resource anywhere in commercial or free software".
> Absolutely!  The idea of CPAN is wonderful.  Doesn't mean we shouldn't
> improve it.  (Perl 4 is wonderful--doesn't mean we should still be running
> it!)

Agreed (except for the perl4 part). But like I mentioned earlier, I
don't understand how we could have such different experiences with
CPAN and CPAN.pm. You've had much difficulty and I've found it be
very, very easy to use. I can't figure the discrepancy.

> Dependency information I can get without having to download the
> tarfile, unbundle it, and browse the README.

What's wrong with
% perl -MCPAN -eshell
cpan> i /something/
      [ ... stuff about modules and bundles is returned ... ]
cpan> readme module

This has always worked fine for me.

I agree that there should probably be more dependency information in
the readme files, but then that's back to the author's court.

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
  "It is obvious that about 750,000 people ago, Austin was a wonderful City."


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

Date: Tue, 05 May 1998 17:47:27 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <pudge-0505981345350001@192.168.0.3>

In article <354F4862.DFDD6137@order.booktraders.com>, Birgitt Funk
<birgitt@order.booktraders.com> wrote:

# > Chris Nandor <pudge@pobox.com> wrote:
# > : You say above that clueless newbies should be able to figure it out.  Why
# > : on earth should clueless newbies be able to do this?  CPAN is made by
# > : programmers for programmers. 
# 
# Aha - nice to hear.
# 
# So why should we clueless newbies be able to 'figure it out' ?
# 
# Never been a newbie yourself ? Do you have children/teenage/
# college kids newbies by any chance who want, need to do their
# first projects on their own? Are no programmers yet, but
# may be could become one day ?

Yes, and they need to know that it will be a baptism by fire.  Programming
is not easy, it takes a lot of hard work and a lot of self-initiation and
self-motivation.


# I am a blond, female, dumb, clueless newbie non-programmer who 
# needs to use CPAN in the near future for the first time.

If you are clueless, you cannot figure it out until which time you become
clued.  Even if you could get some use out of CPAN while still holding
onto your cluelessness, you would not be able to do anything with the
module once you got it, because you are cluless.  Now, when you are clued,
then you can make use of it.


# May be your remark is aimed to scare someone like me away ?
# IMHO it just causes the opposite, at least for me.

Good!  I don't want to scare anyone away.  I just don't want anyone to say
that CPAN is bad just because it can't be used by clueless people.  Perl
itself cannot be used by clueless people.  You need some modicum of clue
to even do perl -e 'print "hello, world\n"'.

If there is a suggestion on making CPAN better, great, we can discuss it. 
But CPAN will NEVER EVER EVER be easy to use for cluless newbies.  Never.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Tue, 5 May 1998 15:47:15 GMT
From: bet@network.rahul.net (Bennett Todd)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <slrn6kudhr.p5r.bet@ritz.mordor.net>

1998-05-05-12:54:11 Andy Armstrong:
>One of the inherent problems with encouraging reuse is that you're also
>encouraging people's ability to engineer solutions from first principles to
>atrophy.

That's certainly true; I doubt you can find very many programmers graduating
today who could engineer a good robust application for e.g. text editing
if given only a bucket of sand and an outcropping to mine and refine for
impurities. Worse, if you made them go back and start with a loose gas cloud
of remnants of previous supernova almost everyone would give up. And even that
is indulging in reuse; pushing elements up the packing curve past iron is
_hard_.

Not many people pursue the art of engineering solutions from first principles.
Having a few clowns around who really devote themselves to such frippery
is good; sometimes they deduce what happened in ages past and we call 'em
archaeologists or cosmologists or whatever; sometimes they review design from
first principles and maybe even stumble across loopholes and exceptions --- a
popular passtime of physicists, though perhaps a bit more prolific a century
ago or thereabouts. And if you want to found a fundamental revolution in an
established industry it always helps to review the origins of current practice
in that industry and look for limiting assumptions.

But for your typical programmer out to solve a problem, the ability to
engineer solutions from first principles rarely pays any dividends, and the
work is completed by people who've cultivated the ability to build on the work
of others.

Anybody else out there read E. E. "Doc" Smith's ``Spacehounds of the IPC''?
I really liked the description of building the radio station on Ganymede.
I don't think Steve was a big fan of engineering solutions from first
principles....

-Bennett


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

Date: 5 May 1998 09:37:13 -0700
From: mcravit+usenet@mcravit.vip.best.com (Matthew Cravit)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6inf7p$4cs$1@shell3.ba.best.com>

In article <894365105.733593@thrush.omix.com>,
Zenin  <zenin@archive.rhps.org> wrote:

>	On the other hand, I'd guess that easily 1/5 of the Unix systems
>	I've worked worked with had nothing listing on port 25.  Even if
>	you have access to another SNTP server (smell a vary non-portable
>	code change here to point to it? I do!) it might not be up when you
>	try to send your mail (intermittent connections never happen,

Sure...but when you send mail, you're not necessarily connecting to a
local mail server anyway...if I want to send mail to user@aol.com, I'd
be just as likely to connect to aol.com's mail server as to my own.

>	So, by using SNTP directly you build code that's *extremely*
>	NON-portable between many, many common Unix servers as well
>	as being vary unstable (no queuing system available), just to

Sure there is...you're just talking to someone else's sendmail daemon (or
whatever) instead of to your own. Talking the SMTP protocol is very portable
if you have an SMTP server to talk to. If you don't, you're probably going to
have a hard time anyway.

>	Sendmail is FAR more cross-platform compatible then directly talking
>	SNTP will *ever* be.  The "guru" that suggested the Net::SNTP module
>	for simple mail on a Unix server was *vary* mistaken.

But how's talking directly to sendmail portable if you need to RUN THE PERL
SCRIPT on machines that aren't UNIX? I have a number of scripts that RUN on
NT, MacOS and UNIX. Only one of those three has sendmail available in /usr/lib
or /usr/sbin, and only one (or possibly two) even have sendmail at all.

The advantage, to my mind, of the Net::SMTP module, is that your Perl script
is portable to machines on which sendmail might be:

- Non-existant
- In a non-standard location
- Buggy
- Improperly configured

There's a distinction here that I think you're not making, between the process
which actually delivers your mail, and the method you use of talking to it. 
If you open a pipe to sendmail, your script is tied to sendmail, and assumes
that you have a copy of sendmail on the machine your script is running on.
If you use a module like Net::SMTP, you can talk to any SMTP mail server,
whether it's on your local machine or not, and whether it's sendmail or not.

>	And let's not forget queuing messages even if "instant" delivery
>	might be available.  If you're on a heavily loaded server it can
>	be life or death.

But when you connect to a mail server with Net::SMTP, that server will
queue the messages for you. 

>	If you want a fairly clean, robust, and portable interface to
>	sendmail, checkout (soon to be at CPAN, but it's still alpha):

You're using the phrase "cross-platform" in a different way than some of
the other posters in this thread, I think. There's a difference between
"portable to 37 varieties of UNIX", and "portable to platforms besides
UNIX". I have scripts which I've written for work which (not by my choice)
HAVE to be able to run on MacOS, WinNT, SunOS 4.1.[1234], and Solaris 
2.(5|5\.1|6). Opening a pipe to sendmail is NOT an option for those scripts.

/MC

>
>	ftp://thrush.omix.com/pub/perl/modules/Mail-Sendmail-1.10.tar.gz
>
>-- 
>-Zenin
> zenin@archive.rhps.org


-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@net.com (work)      | time you make it.


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

Date: 5 May 1998 10:05:45 -0700
From: mcravit+usenet@mcravit.vip.best.com (Matthew Cravit)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6ingt9$fi5$1@shell3.ba.best.com>

In article <CUpT1IIelwLS092yn@netins.net>,  <phdss@netins.net> wrote:
>/d:Disk spam.  Take libwww for instance:  installing it (guessing)
>   2-4 meg of spam for what?  A set of slow running subscripts that

2-4 megs of spam? Have you actually _looked_ at it? Apart from the rants
which Tom posted about your silly comment that this module is a set of
slow subroutines which do nothing that couldn't be more easily done manually,
let me just point out that the entire libnet distribution, including the 
Makefile.PL, the revision history file, the test suite and some demo code 
which uses it, comprises (when uncompressed and untarred) 205 KB of data. 
The compressed tarfile is 55K.

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@net.com (work)      | time you make it.


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

Date: 5 May 1998 16:58:05 GMT
From: "David Richards" <david.richards@alderley.zeneca.com>
Subject: Re: failing to interpret * on NT command line
Message-Id: <01bd7846$f7a261e0$55a0479c@UKMCPHISFW051.ukmcph.zeneca.com>

Tim

Use double quotes when running perl from the command line - this is
discussed in detail in the FAQ.

DAvid

Tim Gray <tgray@smlny.com> wrote in article
<6in2nb$7ls$1@m5.stny.lrun.com>...
> I am trying, in WinNT, to do the simple one liner
> 
> perl -pi.bak -e 's/foo/bar/;' *



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

Date: 5 May 1998 17:25:06 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: failing to interpret * on NT command line
Message-Id: <6ini1i$3pj@srvr1.engin.umich.edu>

  [ mailed and posted ]

In article <6in2nb$7ls$1@m5.stny.lrun.com>, Tim Gray <tgray@smlny.com> wrote:
>I am trying, in WinNT, to do the simple one liner
>perl -pi.bak -e 's/foo/bar/;' *
>and it gives me
>Can't open *: No such file or directory
>I also tried *.* and *.txt.  I could have sworn I have done this before.  I
>am using Mr. Sarathy's port of 5.004_02.  Any suggestions?  Thanks.

You would've gotten to this if you'd tried http://www.dejanews.com/

=head2 Why won't my perl understand wildcards in arguments?

The default command shells on DOS descendant operating systems (such
as they are) usually do not expand wildcard arguments supplied to
programs.  They consider it the application's job to handle that.
This is commonly achieved by linking the application (in our case,
perl) with startup code that the C runtime libraries usually provide.
However, doing that results in incompatible perl versions (since the
behavior of the argv expansion code differs depending on the
compiler, and it is even buggy on some compilers).  Besides, it may
be a source of frustration if you use such a perl binary with an
alternate shell that *does* expand wildcards.

Instead, the following solution works rather well. The nice things
about it: 1) you can start using it right away 2) it is more powerful,
because it will do the right thing with a pattern like */*/*.c
3) you can decide whether you do/don't want to use it 4) you can
extend the method to add any customizations (or even entirely
different kinds of wildcard expansion).

	C:\> copy con c:\perl\lib\Wild.pm
	# Wild.pm - emulate shell @ARGV expansion on shells that don't
	use File::DosGlob;
	@ARGV = map {
		      my @g = File::DosGlob::glob($_) if /[*?]/;
		      @g ? @g : $_;
		    } @ARGV;
	1;
	^Z
	C:\> set PERL5OPT=-MWild
	C:\> perl -le "for (@ARGV) { print }" */*/perl*.c
	p4view/perl/perl.c
	p4view/perl/perlio.c
	p4view/perl/perly.c
	perl5.004_02/win32/perlglob.c
	perl5.004_02/win32/perllib.c
	perl5.004_03/win32/perlglob.c
	perl5.004_03/win32/perllib.c
	perl5.004_531/win32/perlglob.c
	perl5.004_531/win32/perllib.c

Note there are two distinct steps there: 1) You'll have to create
Wild.pm and put it in your perl lib directory. 2) You'll need to
set the PERL5OPT environment variable.  If you want argv expansion
to be the default, just set PERL5OPT in your default startup
environment.

 - Sarathy.
   gsar@umich.edu




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

Date: 5 May 1998 10:10:18 -0700
From: mcravit+usenet@mcravit.vip.best.com (Matthew Cravit)
Subject: Re: Hello people, want to learn Perl ?
Message-Id: <6inh5q$hen$1@shell3.ba.best.com>

In article <354E6018.63ACB21A@fccjmail.fccj.org>,
Bill 'Sneex' Jones  <bill@astro.fccj.cc.fl.us> wrote:

>My local Barnes & Nobles is a little slow 
>on the ordering & shipping process :(

You should be able to order the book directly from O'Reilly, as well as 
Amazon.COM et al. (Amazon has it listed already, I think, and is taking
advance orders for it.)

/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@net.com (work)      | time you make it.


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

Date: Tue, 05 May 1998 13:34:14 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: help a novice in perl!
Message-Id: <comdog-ya02408000R0505981334140001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6inaas$phd$1@minus.oleane.net>, "sg" <info@atig.fr> posted:

>I would wanted to do a perl script which can
>put in a table, *.html files founded in a directory.
>but (even if i've made some researches on
>FAQ, and try to found an information on perl
>book) i didn't found a function which can return
>(or repertoriate) the *.html files in a directory.

see opendir(), readdir(), and friends.  you may also want to skim 
the entire perlfunc manpage to see all of the functions available to
you.

good luck. :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Tue, 05 May 1998 12:31:21 -0500
From: Andrew Sisson <asisson@onramp.net>
Subject: HELP! how do I insert page breaks?!
Message-Id: <354F4CE9.25C4778A@onramp.net>

Is there a special character for page breaks in PERL? I've tried "\f" -
form feed, and this doesn't work. Thanks.

Andrew Sisson



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

Date: Tue, 05 May 1998 12:22:41 -0400
From: Rich Tsui <tsui@cbmi.upmc.edu>
Subject: How to delete an element in an array?
Message-Id: <354F3CD1.18FC648@cbmi.upmc.edu>

Hi Perl guru,

   Could any one out there help me to find a way to delete an element in an
array?
What I know for the deleted item is the content instead of the index in the
array.
For example, I have an array @foo=('Jan', 'Feb', 'Dec', 'Bar', 'Mar') and I
would
like to delete item 'Bar' in array @foo without knowing the index of the item
'Bar'.

Any suggestion?

Rich Tsui
University of Pittsburgh



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

Date: Tue, 05 May 1998 13:37:51 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to delete an element in an array?
Message-Id: <comdog-ya02408000R0505981337510001@news.panix.com>
Keywords: from just another new york perl hacker

In article <354F3CD1.18FC648@cbmi.upmc.edu>, Rich Tsui <tsui@cbmi.upmc.edu> posted:

>   Could any one out there help me to find a way to delete an element in an
>array?
>What I know for the deleted item is the content instead of the index in the
>array.
>For example, I have an array @foo=('Jan', 'Feb', 'Dec', 'Bar', 'Mar') and I
>would
>like to delete item 'Bar' in array @foo without knowing the index of the item
>'Bar'.

why don't you want to know the index (which would allow you to use 
splice() )?  i guess you could use grep in some devious way...

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

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

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