[13413] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 823 Volume: 9

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

Date: Thu, 16 Sep 1999 16: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)
Message-Id: <937523114-v9-i823@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 16 Sep 1999     Volume: 9 Number: 823

Today's topics:
    Re: Anyone know what "premature script header means"? <cassell@mail.cor.epa.gov>
    Re: Case insensitive SQL query (Mark W. Schumann)
    Re: CONTEST: Range Searching <madebeer@igc.apc.org>
    Re: CONTEST: Range Searching (Don Blaheta)
    Re: Critique/comments for web board? (Mark-Jason Dominus)
    Re: ENOWORD: Referer (Abigail)
    Re: HELP PARSE EMAIL ADDRESSES PLEASE <cassell@mail.cor.epa.gov>
    Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People <latsharj@my-deja.com>
    Re: How can I know if string have points? (Abigail)
    Re: How can I know if string have points? <cassell@mail.cor.epa.gov>
    Re: How can I know if string have points? (Larry Rosler)
    Re: how to produce a 'beep'? <cassell@mail.cor.epa.gov>
    Re: how to produce a 'beep'? <uri@sysarch.com>
    Re: how to produce a 'beep'? <tchrist@mox.perl.com>
    Re: Labelling warns and dies <laurensmith@sprynet.com>
    Re: NDBM_File problem. (Joseph A. DiVerdi)
    Re: Parsing Tab Delimited File <tchrist@mox.perl.com>
    Re: perl equivalent of a Unix command line sort? (Jim Hutchison)
    Re: perl mail automatically processing? <cassell@mail.cor.epa.gov>
    Re: perl mail automatically processing? <madebeer@igc.apc.org>
    Re: Please help a newbie! (Matthew Bloch)
        Reading files from other systems armadilloman@my-deja.com
    Re: Reading files from other systems <makkulka@cisco.com>
        Reading non-system html files armadilloman@my-deja.com
        Reading non-system html files armadilloman@my-deja.com
    Re: Reading non-system html files <makkulka@cisco.com>
    Re: references in dbms <makkulka@cisco.com>
    Re: REQ: tell-a-friend script <flavell@mail.cern.ch>
    Re: slightly offtopic: who know ISPs with mod_perl supp <elaine@chaos.wustl.edu>
    Re: Some e-mails get sent, some don't (Greg Miller)
    Re: Unix and Perl script (Jim Hutchison)
    Re: Where do I get perl2exe for Win32? <sjohns17@uic.edu>
        Windows NT command line fmonteiro@my-deja.com
    Re: Windows NT command line <makkulka@cisco.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Thu, 16 Sep 1999 14:26:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Anyone know what "premature script header means"?
Message-Id: <37E1609D.5B5EEF00@mail.cor.epa.gov>

Kenneth Bandes wrote:
> 
> David Cassell wrote:
> > I recommend going to
> >     http://language.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
> > for Tom Christiansen's rudely-named-but-still-helpful
> > "Idiot's Guide to Solving Perl CGI Problems".  Working through
> > this guide will not only help you, but will also teach you more
> > about how CGI works - and doesn't work.
> 
> Good document but bad link (at least at the moment). Try
> http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
> or any CPAN mirror.

Thanks for the heads up.  It worked when I suggested it.
I walked through a search at www.perl.com and then copied
the URL.  Oh well...

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 16 Sep 1999 17:16:14 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Case insensitive SQL query
Message-Id: <7rrmmu$son@junior.apk.net>

In article <7rburv$1e7$1@nnrp1.deja.com>,  <mrbog@my-deja.com> wrote:
>In article <7r8boa$38k@junior.apk.net>,
>  catfood@apk.net (Mark W. Schumann) wrote:
>> In article <7r43rg$91l$1@nnrp1.deja.com>,  <mrbog@my-deja.com> wrote:
>> >Hello, genius, guess what, there are other people to answer the
>> >questions besides you. The more people in the group, the more people
>to
>> >answer questions. I can and have answere the questions of others, for
>> >example.
>>
>> If you actually read this group you'd know I practically never answer
>> questions.  Other people get to them first.
>
>Well then you're proving my point FOR me. If there are so many people
>getting to the questions before you can, then there's PLENTY of room
>for more questions!

No, they're getting to the questions before I do because I check in
about every two weeks.

>> >Besides that, how fucking stupid are you to think that of 2400 new
>> >messages, they will all be questions? You're a programmer and I need
>to
>> >explain that to you?  It's more lik 10% at most.  Note I said new
>> >messages not new threads.
>>
>> Okay, so there are 240 new threads.  You want to add to that by asking
>> about unrelated issues?
>
>YES, I DO, because there are 2400 people to answer them.

More like a couple dozen.  And they're here to help answer questions
about Perl.  Why make busy-work for them?  They're doing a nice thing
for us.  It's only fair to avoid making extra demands.



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

Date: Thu, 16 Sep 1999 12:45:52 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: CONTEST: Range Searching
Message-Id: <APC&1'0'50775db0'b74@igc.apc.org>

Any restrictions on system calls?
If not, this could be a very short script ;)

-Michael


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

Date: 16 Sep 1999 22:35:53 GMT
From: dpb@cs.brown.edu (Don Blaheta)
Subject: Re: CONTEST: Range Searching
Message-Id: <7rrrc9$dj8@cocoa.brown.edu>

Quoth Tom Christiansen:
>     3) Write a "patba" program that prints out up to
>        X lines before the match and Y lines after the match.
> 
> 	    patba [-A X] [-B T] pattern [files ...]

This isn't consistent with itself or the previous two items; I assumed
-A to indicate "after" and -B "before" as with the previous two.

Here are the three while loops comprising the brunt of my programs:

	# pataft
	while (<>) {
	  $aftleft = $aft + 1 if /$pat/o;
	  print and $aftleft-- if $aftleft;
	}

	#patfore
	while (<>) {
	  shift @forelines if @forelines > $fore;
	  push @forelines, $_;
	  print @forelines and @forelines = () if /$pat/o;
	}

	#patba
	while (<>) {
	  shift @forelines if @forelines > $fore;
	  push @forelines, $_;
	  print and $aftleft-- and @forelines = () if $aftleft;
	  print @forelines and $aftleft = $aft if /$pat/o;
	}

Each one starts with the same header:
	#!/usr/local/bin/perl -w
	use Getopt::Std;

	getopt('ABC', \%opt);
	$fore = $opt{B} || $opt{C} || 3;
	$aft = $opt{A} || $opt{C} || 3;
	$pat = shift;

And here's a test file to pipe through them (using pattern "foo"):
	a
	b
	foo
	foo
	c
	foo
	d
	e
	f
	g
	foo
	h
	i
	j
	k
	l
	m
	n
	foo
	o

That tests the cases where the pattern lines are adjacent, where the
second pattern lies in the "aft" region of the first, where it lies
outside the "aft" region but its "fore" region overlaps it, and where
they do not interfere at all.

>       * correctness: does it actually do the right thing?  if not, 
> 	nothing else matters. :-)
>       * space efficiency: don't use more space than minimally needed
>       * test coverage: do you include test data to check all border cases?

Well, I meet these three, at least. :)

>       * time efficiency: is your solution fast?

Hard to say until I have something to test it against.  I think I at
least avoided anything excruciatingly _slow_.

-- 
-=-Don Blaheta-=-=-dpb@cs.brown.edu-=-=-<http://www.cs.brown.edu/~dpb/>-=-
To iterate is human, to recurse divine.


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

Date: Thu, 16 Sep 1999 21:46:20 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Critique/comments for web board?
Message-Id: <7rroeb$s1n$1@monet.op.net>

[mailed and posted]

In article <37e05478_1@news2.one.net>, David Wall <darkon@one.net> wrote:
>In article <7rnome$ho2@dfw-ixnews19.ix.netcom.com>, ebohlman@netcom.com (Eric Bohlman) wrote:
>>2) You're using symbolic references just to reduce typing.  This is a 
>>false economy.  Use a hash instead, and use strict.
>
>I'm not sure I understand offhand what you mean here.  I guess I shouldn't 
>have done something like the following?
>
># grab the message fields and put them in their own variables
># so I don't have to type so much when maintaining this code
>foreach $field ( keys %{$Messages{$id}} ) {
>   $$field = $Messages{$id}{$field};
>}

Right.  

>What's so bad about symbolic references?  [Time passes while I look it up in 
>the Camel]  Hmm, I suppose I could accidentally mix up a hard and a symbolic 
>reference, and then have one hell of a time figuring out the bug, eh?

No.  The real problem is that if your string contains something
unexpected, it will sabotage a totally unrelated part of the program,
and then you will have one hell of a time figuring out the bug.

Suppose something goes wrong and one of the `field names' in one of
the messages get mangled.  Maybe there was some error return you
didn't detect, and so one of the keys turns out to be '0', or maybe
some function got called in the wrong context and you ended up with a
field name of '4' for some reason, or something gets quoted that
shouldn't be and the field names end up being '*'.  

Then your loop goes blithely ahead and tries to modify $0 or $4 or $*,
which are reserved variables with special meanings, and then something
bizarre and disgusting happens---the details depend on the variable
name.  For example, if you accidentally modify $*, suddenly some of your
regexes might start matching when they shouldn't.  Try debugging that.

If the field name comes out to be '/', then you end up modifying $/,
and suddenly every filehandle read in the rest of the program comes
out bizarre and wrong.  The read operations might appear in a part of
your program very far away from the place that the bug occurred, and
it could take you days to figure it out---or you might never figure it
out.  

If there's field name which is accidentally `i', and you go and tamper
with $i, then you might not even notice the problem, until one day
someone adds some code that does

	for $i (...) { 
	   ...
	}

and then your $$fields assignment smashes the loop variable, and the
program goes into an infinite loop, and the whole thing is mystifying.

The real problem is that $$fields = ... is not confined at all, and if
something goes wrong, it can smash *any* variable in the entire
program, which will have a bizarre effect, possibly on something far
away.

This is the sort of problem that variable namespaces are supposed to
prevent.  Code A is not supposed to be able to tamper with the
variables of code B that is far away.  A hash is a portable namespace,
and if you use a hash here, you are safe from all these weird
problems:

	# grab the message fields and put them in their own variables
	# so I don't have to type so much when maintaining this code
	my %f;
	foreach $fieldname ( keys %{$Messages{$id}} ) {
	   $f{$fieldname} = $Messages{$id}{$fieldname};
	}

Now you have to write $f{SUBJECT} or whatever.  That is only three
characters extra, and you no longer run the risk of smashing variables
in distant parts of the program.

Also, when you write it like this, it becomes immediately apparent
that you can make it shorter and simpler at the same time:

	# grab the message fields and put them in their own variables
	# so I don't have to type so much when maintaining this code
	my %f = %{$Messages{$id}};

This is shorter, simpler, safer, and more efficient.  That is a couple
of big wins and a medium-sized win, and the cost in return is that you
have to write

	$f{SUBJECT}

instead of

	$SUBJECT

So as usual there are tradeoffs, but in this case the tradeoffs are
rather lopsided.  The soft-reference technique has big problems, and
trivial benefits.

>So instead I should just go ahead and use $Messages{$id}{$field}?  Hey, 
>whatever happened to Laziness? 

I'm all for laziness.  I'm too lazy to spend half my life tracking
down monster bugs caused by accidentally modified global variables.
That's why we have private variables in the first place:  To prevent
exactly this sort of error.

I hope this makes the potential problem clearer.



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

Date: 16 Sep 1999 16:11:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: ENOWORD: Referer
Message-Id: <slrn7u2nd7.vd4.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCCVII September
MCMXCIII in <URL:news:37e11cd0@cs.colorado.edu>:
== 
== In comp.lang.perl.misc, 
==     kragen@dnaco.net (Kragen Sitaker) writes:
== :In article <37B3266A.8970EAA3@microcal.com>, Larry Yu  <yu@microcal.com> wrote:
== :What is the download record?  You can get the HTTP Referer header from
== :$ENV{HTTP_REFERER}.
== 
== There is, of course, no word "referer" in English.  It's "referrer".
== The illiterati strike again, but this time deep into the heart of the
== standards docs.  Don't these people have proofreaders and spell checkers?

The professor [1] who taught me programming, would say something like:

    But it isn't English. It's just a token consisting of the characters
    'H', 'T', 'T', 'P', '_', 'R', 'E', 'F', 'E', 'R', 'E', and 'R'.

    Resemblence with the English language is only a coincidence.


[1] S. D. Swierstra


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\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, 16 Sep 1999 14:33:29 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: HELP PARSE EMAIL ADDRESSES PLEASE
Message-Id: <37E16229.A0E8CCBC@mail.cor.epa.gov>

Tom Phoenix wrote:
> 
> On Wed, 15 Sep 1999, Larry Rosler wrote:
> 
> >   #!perl -nw
> >   print "$1\n" if /\s(\S+@\S+)\s/
> 
> Of course, that won't necessarily find or extract an e-mail address from a
> text stream. In fact, I can't think of a real-world use for that program.

I can.  It will make e-mail address harvesting even less
efficient than it already is.  A Good Thing.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 16 Sep 1999 21:21:50 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People
Message-Id: <7rrn11$39$1@nnrp1.deja.com>

In article <7rp1do$ph$1@gellyfish.btinternet.com>,
  Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Wed, 15 Sep 1999 18:11:43 GMT Kragen Sitaker wrote:
> > In article <7rolu9$ol7$1@nnrp1.deja.com>,  <harad@my-deja.com>
wrote:
> >>great new twist on a 100 year old business, and
> >>are seeking to add to our All Star team!
> >
> > Who's on your All Star team?
>
> I'd go for it if they had:
>
>   Atom Ant
>   Secret Squirrel
>   Hong Kong Phooey
>   Scooby Doo
>   Dick Dastardly
>   Mutley

Unfortunately, they probably have:

BullWinkle
Boris Badinoff
Daffy Duck

Oh, well - they don't want to talk to me. I live in Florida, at least
until the next hurricane.
--
Regards,
Dick


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


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

Date: 16 Sep 1999 16:06:47 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How can I know if string have points?
Message-Id: <slrn7u2n46.vd4.abigail@alexandra.delanet.com>

Makarand Kulkarni (makkulka@cisco.com) wrote on MMCCVII September
MCMXCIII in <URL:news:37E13DA7.37112A5B@cisco.com>:
## 
## $str = "../whatever/....\.\.\." ;

Why the backwacks?

## $count  = $str =~ tr/\./\./;

Why the backwacks?


Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


  -----------== 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, 16 Sep 1999 14:36:40 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How can I know if string have points?
Message-Id: <37E162E8.6B57EE98@mail.cor.epa.gov>

Kragen Sitaker wrote:
[snip]
> _Picking Up Perl_, on the Web at http://www.ebb.org/PickingUpPerl/,
> seems rather thorough, although it's less than half finished and the
> tone is a bit dry.  I have confidence in the author.  (I am certain
> there is no Spanish translation of PUP yet.)

Ummm Kragen, I just took a quick glance, and the first thing I
noticed is that the author refers to the construct <STDIN> as
a filehandle, rather than an operator working on a filehandle.
I stopped reading at that point.

Maybe you'll want to proofread this for said author.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 16 Sep 1999 14:33:32 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How can I know if string have points?
Message-Id: <MPG.124b02026ce78c0989f93@nntp.hpl.hp.com>

In article <37E13DA7.37112A5B@cisco.com> on Thu, 16 Sep 1999 11:57:43 -
0700, Makarand Kulkarni <makkulka@cisco.com> says...
> [ Abel Almazán wrote:
> 
> > How can I know if string have points?
> 
> use tr()
> 
> $str = "../whatever/....\.\.\." ;
> $count  = $str =~ tr/\./\./;

More simply,

  $count = $str =~ tr/.//;

But note that this scans the entire string to count all the dots.  If 
all you want to know is whether there is at least one, index() or even 
/\./ are likely to be faster.

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


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

Date: Thu, 16 Sep 1999 14:42:13 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: how to produce a 'beep'?
Message-Id: <37E16435.E0D7FFB8@mail.cor.epa.gov>

Larry Rosler wrote:
[snip of Tom's Curses approach]
> It might be simpler (and more portable?) first to try:
> 
>       print "\a";
> 
> Or perhaps "\a\n" or whatever it takes to flush the output immediately.

Oddly enough, this seems to be *less* portable than using
the Curses module for me.  We have at least one Sun box on
which 
    print "\a";
or
    print "\a\n";
does nothing.

C'est la vie,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 16 Sep 1999 17:49:37 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: how to produce a 'beep'?
Message-Id: <x7vh9ail1q.fsf@home.sysarch.com>

>>>>> "SDJ" == Seth David Johnson <sjohns17@uic.edu> writes:

  SDJ> On 16 Sep 1999, Tom Christiansen wrote:

  >> use Curses;
  >> initscr();
  >> beep();
  >> endwin();

  SDJ> print "\a";

i can't resist it:

use Acme::RoadRunner ;

$wiley = Acme::RoadRunner->new() ;

print $wiley->beepbeep() ;

:-)

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: 16 Sep 1999 16:34:17 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how to produce a 'beep'?
Message-Id: <37e17069@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Seth David Johnson <sjohns17@uic.edu> writes:
:>     use Curses;
:>     initscr();
:>     beep();
:>     endwin();
:
:What about simply:
:print "\a";

You don't win style points on that one. :-)

--tom
-- 
"Internet is so big, so powerful and pointless that for some people it is a 
 complete substitute for life."
				- Andrew Brown, `The Independent'


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

Date: Thu, 16 Sep 1999 14:56:23 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: Labelling warns and dies
Message-Id: <7rrp27$tb3$1@brokaw.wa.com>


Brundle wrote in message <7rrh6f$rg2$1@nnrp1.deja.com>...
>One can fairly straightforwardly trap warns and dies, and label them as
>such, but I think this would be an excellent built-in feature.
>
>It is of great significance to the programmer whether an error stopped
>execution or not.
In what sense do you mean 'stopped'?  If a program encounters an error
opening a file or matching a regex, it will happily continue running to
completion.  It will just run into a whole ton of errors.  It makes
sense for the programmer to specify when a die() or exit() should be
executed, not for the program to (arbitrarily) decide that it can no
longer continue.

If, OTOH, you mean that Perl should give you messages when errors are
encountered, then you always have the -w switch.  :-)

Lauren
"You just keep doing what you're supposed to be doing, no matter how
crazy it seems."
    - Ram to Flynn,  Tron




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

Date: Thu, 16 Sep 1999 15:15:29 -0600
From: diverdi@XTRsystems.com (Joseph A. DiVerdi)
Subject: Re: NDBM_File problem.
Message-Id: <diverdi-1609991515290001@lulu.xtrsystems.com>

In article <37E10B1B.A2FA6F8C@mcs.drexel.edu>, Justin Smith <jsmith@mcs.drexel.edu> wrote:

>"Joseph A. DiVerdi" wrote:
>
>> In article <Pine.OSF.4.05.9909142053350.13794-100000@mail.med.upenn.edu>, Nico Zigouras <zigouras@mail.med.upenn.edu> wrote:
>>
>> >Hi:
>> >
>> >I have some databases that need NDBM_File module to access them but the
>> >version of Perl that came with RH Linux 6.0 doesn't seem to have it or let
>> >my CGI access it.
>> >I am trying to install a new Perl but getting errors when trying to load
>> >NDBM_File.
>> >
>
>I think that this is a Redhat 6.0 problem rather than
>a Perl problem. When I compile Perl from scratch (rather
>than using Redhat's package) I find that it fails the AnyDBM tests
>(and other tests related to DBM's). Somehow, Redhat's libraries
>are wrong (glibc, I think).
>--
>______________________________________________________________________
>                                        |
>Time blows wildly against my door       | Justin R. Smith
>Stirring discarded sorrows              | Department of Mathematics and
>Like dead leaves of summers past        |     Computer Science
>Memories of forgotten lore              | Drexel University
>Making way for new tomorrows            | Philadelphia, PA 19104
>New hopes, new fears,                   |
>         and new ways that last         | Office: (215) 895-1847
>                                        |
>c Justin R. Smith, March 14, 1994       | Fax:    (215) 895-1582
>
>My home page: http://www.mcs.drexel.edu/~jsmith

I agree with your thinking. My ISP's sys admin has been looking into the problem and has been looking in the direction of glibc also. We still don't have a fix and I would appreciate from others with the same or related problems.

-- 
Joseph A. DiVerdi, Ph.D.                     
<diverdi@XTRsystems.com>                    970.221.3982 (voice)
<http://www.XTRsystems.com>                 970.224.3723 (fax)


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

Date: 16 Sep 1999 16:36:56 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Parsing Tab Delimited File
Message-Id: <37e17108@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    abigail@delanet.com writes:
:-- And a C string is not a general purpose data format because
:-- you can't use nulls in it.  Well, perhaps, but we seldom
:-- care.  The normal thing is to use an alternate representation.
:
:Hmm. Then why did Larry decide to do it different in Perl?

He did the normal thing: he chose an alternate representation.

:Like the people designing shells, where whitespace separates arguments,
:except inside quotes, or when backwacked?

It's not always clear that the shells were designed.  Certainly
csh was not.  It's a nightmare to parse.  rc is much nicer.

:--     for (@fields = split /:/) { s/\\0(\d+)/ord $1/ge }
:Which means, a split no longer sufficies. And you'd have to escape
:all your \0\d+ present in the data. And it makes it very hard to read,
:and/or hand edit.

That's true, but a split and a for aren't bad when both 
are so easy.  Another approach is the data dumper style.
I just can't stand fricking complicated non-intuitive crud.
It looks nothing like a C or Perl data declaration, or even
a termcap one. :-)

--tom
-- 
    signal(i, SIG_DFL); /* crunch, crunch, crunch */
        --Larry Wall in doarg.c from the perl source code


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

Date: Thu, 16 Sep 1999 21:21:53 GMT
From: jimhutchison@metronet.ca (Jim Hutchison)
Subject: Re: perl equivalent of a Unix command line sort?
Message-Id: <37e15ade.2235549512@24.64.2.57>

On Mon, 30 Aug 1999 15:46:49 -0700, lr@hpl.hp.com (Larry Rosler)
wrote:

>[Posted and a courtesy copy mailed.]
>
>In article <h67ogfo29ty.fsf@baynetworks.com> on 30 Aug 1999 18:16:25 -
>0400, Paul L. Lussier <plussier@baynetworks.com> says...
>> I'm trying sort a lists of ip addresses in a script, and thought there
>> must be a perl way of doing it.  I'm can get exactly what I want from
>> the command line using this:
>> 
>> 	sort -n -t. -k 1,1 -k 2,2 -k 3,3 -k 4,4
>...
>> ...  I've tried various ugly and cpu intensive 
>> ideas with hashes and for loops that seem to just take forever.
>
>I can see why!
>
>...
>
>> sub sorthosts {
>> 
>>   # Sort hosts based on IP address
>...
>
>> I either:
>> 
>> 	a) don't know enough about sorting in perl
>> 	b) have run out of creative ideas
>> 	c) am making more of the problem than I should, and am missing 
>> 	   a quite obvious and simple solution
>> 	d) all of the above
>> 
>> Does anyone else have any more elegent, more efficient ways of doing this?
>
>How would a paper whose primary example is sorting a list of strings 
>acccording to an embedded IP address suit you?  If you absorb all of it, 
>I guarantee that item 'a' in your list will be taken care of.  Item 'c' 
>won't be far behind.  And if you come up with anything under item 'b', 
>please let us know.
>
><URL:http://www.hpl.hp.com/personal/Larry_Rosler/sort/>
>
>-- 
>(Just Another Larry) Rosler
>Hewlett-Packard Laboratories
>http://www.hpl.hp.com/personal/Larry_Rosler/
>lr@hpl.hp.com


According to your paper, the Unix sort is much better for huge files,
which is too bad 'cause I prepfer to use just Perl.  I've had to
resort to it on a Sun E-450 box with 786 mb of memory!! 


jim



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

Date: Thu, 16 Sep 1999 14:24:13 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perl mail automatically processing?
Message-Id: <37E15FFD.42A26DB3@mail.cor.epa.gov>

weiq@cs.dal.ca wrote:
> 
> Hi All
> 
> I plan to write a program to check my mail automatically. If the mail
> subject match certain string, the program should process the mail
> automatically, saving the mail into a file or puting into database. My
> program right now is that I do not know how to check the mail
> automatically by using perl (the mail is in Unix Solaris).
> 
> I would be very grateful if anyone could give me some advise or
> providing some sample perl code.

non-Perl recommendation:
Rather than writing all of this in Perl, I would suggest that
you take a look at the functionality of the procmail program,
which may already be on your system (depending on your sysadm).

If you still want to do this yourself, check the CPAN archive.
There are several modules in the Mail::* hierarchy which may
do part or all of what you want.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 16 Sep 1999 11:01:24 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: perl mail automatically processing?
Message-Id: <APC&1'0'50775daf'058@igc.apc.org>

Wei wrote
>I do not know how to check the mail
>automatically by using perl (the mail is in Unix Solaris).

The mail-server on your Solaris machine is probably a POP server.
It might be an IMAP server.  

There are perl modules that let you connect to either of these 
servers and check a list of messages, download messages, delete
your messages, etc...

http://search.cpan.org/search?module=Mail::POP3Client
http://search.cpan.org/search?module=Net::IMAP

The POP3Client works well.  I've never used the IMAP module.,

-Michael


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

Date: Thu, 16 Sep 1999 21:38:04 GMT
From: mattbee@eh.org (Matthew Bloch)
Subject: Re: Please help a newbie!
Message-Id: <slrn7u2hbn.mjn.mattbee@soup-kitchen.demon.co.uk>

In article <7rqkbi$k6g$1@lublin.zrz.tu-berlin.de>, Anno Siegel wrote:
> <makau@multimania.com> wrote in comp.lang.perl.misc:
>>Seems some people are much too serious here :-)
>>
>>In fact, I did right an incorrect code on purpose! It was to test the
>>reactivity of the group and to know if you would flame me or not...
>
>[...]
>
>Go where your experiments in group psychology are appreciated.  If
>such a place exists...

Or at least don't make clear to whole newsgroups they're the subject of
such an experiment next time.  That way you get your results and your
subjects get to feel helpful, knowledgeable and can generally sleep better
at night with the knowledge of a newbie helped out.

-- 
Matthew       ( http://www.soup-kitchen.demon.co.uk/ )


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

Date: Thu, 16 Sep 1999 22:20:57 GMT
From: armadilloman@my-deja.com
Subject: Reading files from other systems
Message-Id: <7rrqft$2pc$1@nnrp1.deja.com>

Is there a way for a script to read .html files
from other sites?  I have a bunch of sites that I
want to all put in the same search engine type
thing.  I have everything done, except I can't
open files from other websites.
$page = "http://mysite.host.net/index.html";
open(FILE, "$page") || die $!;
doesn't work and returns a 500 Internal Server
error.  I do not have access to all of the
directories on my host (specifically, the
directory where perl is stored).
If this is impossible (at least without full
access to the system, since I have seen scripts do
this before), please tell me so I can stop
searching :P.

Thanks for your time and any help you can give me
:)
-Matt


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


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

Date: Thu, 16 Sep 1999 15:50:05 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Reading files from other systems
Message-Id: <37E1741C.C492A994@cisco.com>

{ armadilloman@my-deja.com wrote:

> Is there a way for a script to read .html files

Please cancel your duplicate postings.
Thanks.





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

Date: Thu, 16 Sep 1999 22:17:51 GMT
From: armadilloman@my-deja.com
Subject: Reading non-system html files
Message-Id: <7rrqa2$2mj$1@nnrp1.deja.com>

Is there a way for a script to read .html files
from other sites?  I have a bunch of sites that I
want to all put in the same search engine type
thing.  I have everything done, except I can't
open files from other websites.
$page = "http://mysite.host.net/index.html";
open(FILE, "$page") || die $!;
doesn't work and returns a 500 Internal Server
error.  I do not have access to all of the
directories on my host (specifically, the
directory where perl is stored).
If this is impossible (at least without full
access to the system, since I have seen scripts do
this before), please tell me so I can stop
searching :P.

Thanks for your time and any help you can give me
:)
-Matt


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


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

Date: Thu, 16 Sep 1999 22:17:52 GMT
From: armadilloman@my-deja.com
Subject: Reading non-system html files
Message-Id: <7rrqa3$2mk$1@nnrp1.deja.com>

Is there a way for a script to read .html files
from other sites?  I have a bunch of sites that I
want to all put in the same search engine type
thing.  I have everything done, except I can't
open files from other websites.
$page = "http://mysite.host.net/index.html";
open(FILE, "$page") || die $!;
doesn't work and returns a 500 Internal Server
error.  I do not have access to all of the
directories on my host (specifically, the
directory where perl is stored).
If this is impossible (at least without full
access to the system, since I have seen scripts do
this before), please tell me so I can stop
searching :P.

Thanks for your time and any help you can give me
:)
-Matt


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


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

Date: Thu, 16 Sep 1999 15:36:13 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Reading non-system html files
Message-Id: <37E170DD.192F8437@cisco.com>

[armadilloman@my-deja.com wrote:

> Is there a way for a script to read .html files
> from other sites?

yes.
use   LWP::Simple or LWP::UserAgent.
The perldoc should give you ample information to keep you going.
--



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

Date: Thu, 16 Sep 1999 15:06:06 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: references in dbms
Message-Id: <37E169CD.9856261F@cisco.com>

Todd Smith wrote:

> I'd like to store complicated data structures, such as lots of
> references inside references, into a db file. Is there any way to do it?

Not in a rdbms. But if you have Object oriented database management
system like ObjectStore then you can save your objects and restore
them in Perl/java/C++ etc.

Your other alternatives are using
Data::Dumper()
FreezeThaw
ObjectStore (perl module, not the oodbms).
--



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

Date: Thu, 16 Sep 1999 23:06:41 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: REQ: tell-a-friend script
Message-Id: <Pine.HPP.3.95a.990916225935.4553B-100000@hpplus03.cern.ch>

On 16 Sep 1999, Abigail wrote:

> A computer
> is an *INANIMATE THING*. Inanimate things are *DEAD*. Please ask your
> question in alt.dead.

One on-board microprocessor that we worked with had nothing better as a
display than a bank of eight hex digits.  We used to play around with
error codes like DEADDEAD and stuff.  S'cuse the whimsical intrusion. 



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

Date: Thu, 16 Sep 1999 18:15:08 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: slightly offtopic: who know ISPs with mod_perl support?
Message-Id: <37E16BBF.C7F399F3@chaos.wustl.edu>

Joern Reder wrote:

Since I used to work at one of the largest Web Hosting houses in the US
I'll point out a few misconceptions here.

> Does anyone know ISPs who offer this features:

Web Hosting Service, not ISP.

> - virtual account with full ftp/telnet/ssh access
virtual account or server? at the bare minimum you will need an IP bound
to either a physical or logical device.

> - min. 200 MB disk space

200mb is a lot but not unheard of.

> - no additional charge for data transfer
>   (actually about 10-15GB / month, 30GB peak)

DREAM ON. I'd like to see anyone offer this. Everything is ala carte.

> - Apache 1.3.x with builtin Perl 5.004_04 (or better)
>   Support (mod_perl), administrated by us
> - MySQL database 3.21 or better, administrated by us
> - unlimited number of POP3/SMTP mailboxes, administrated by us
> - possibility to install additional software (e.g. Majordomo,
>   Perl modules, etc.)

Do you need colocation or sudo? 

> - location of server preferable in USA or Canada

http://www.shore.net/services/ is one of the cheapest going and
reasonbly well managed.

> Costs of about 150$ per month would be OK.

Yes it would, but no way you will find it with that list. 

maybe get a dsl line, a sparc and put it in a friends basement.

e.


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

Date: Thu, 16 Sep 1999 21:38:01 GMT
From: gmiller@iglou.com (Greg Miller)
Subject: Re: Some e-mails get sent, some don't
Message-Id: <37e562d7.174741970@news.alt.net>

On Thu, 16 Sep 1999 18:42:54 GMT, kragen@dnaco.net (Kragen Sitaker)
wrote:

>Most pipe errors show up when you close the filehandle, not when you
>open it.  Are you checking close M for errors?

	Thanks for the suggestion, but close() is always returning 1.

Greg Miller (gmiller@iglou.com)
http://www.customprogrammer.com
http://members.iglou.com/gmiller/
http://www.net-chess.com


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

Date: Thu, 16 Sep 1999 22:26:28 GMT
From: jimhutchison@metronet.ca (Jim Hutchison)
Subject: Re: Unix and Perl script
Message-Id: <37e16b46.2239749643@24.64.2.57>

On Tue, 14 Sep 1999 23:59:52 GMT, fybar@junctionnet.com (Trevor
Osatchuk) wrote:

>I am trying to write a backup script for a Unix machine using Perl as
>I can only pass a finite number of filenames to a tar at a time.  The
>Unix command that I want to use is:
>
>find ./usr -name "bin" -print > files.list
>
>The best I can come up with is this:
>
>open (FILES_LIST,"|find ./usr -name "bin" -print >files.list");
>
>I have used the same type of command with an ls, but I cannot get the
>syntax right for the find.
>
>trev


Look up "xargs".  It's a Unix command that solves the "list too long"
problem.




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

Date: Thu, 16 Sep 1999 15:58:15 -0500
From: Seth David Johnson <sjohns17@uic.edu>
To: Andy Cragg <andrew_cragg@csi.com>
Subject: Re: Where do I get perl2exe for Win32?
Message-Id: <Pine.A41.4.10.9909161556030.230986-100000@tigger.cc.uic.edu>

On Thu, 16 Sep 1999, Andy Cragg wrote:

> Hi,
> 
> Erm, where do I get perl2exe for Win32?

http://www.demobuilder.com/perl2exe.htm

> 
> Not on CPAN or ActiveState documentation.  Is it free?

Shareware. The evaluation version creates an executable with a "created
with" message and a 2-second delay. Registration info's on the page
(kind of expensive).

-Seth




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

Date: Thu, 16 Sep 1999 21:57:37 GMT
From: fmonteiro@my-deja.com
Subject: Windows NT command line
Message-Id: <7rrp4b$1q4$1@nnrp1.deja.com>

Hi,

I'm doing a CGI app that will excecute a Windows NT (4.0) command line
application.

My problem is: using NT's DOS Prompt, the program returns each
successful operation. How can I can these parameters on a Perl script ??

Thanks !!


Fernando Monteiro


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


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

Date: Thu, 16 Sep 1999 15:48:12 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Windows NT command line
Message-Id: <37E173AC.61F9916D@cisco.com>

{fmonteiro@my-deja.com wrote:

> My problem is: using NT's DOS Prompt, the program returns each
> successful operation. How can I can these parameters on a Perl script ??

read perldoc -f system
@args = ($program_name, $arg1, $arg2);
 system( @args ) == 0   or die "system call failed " ;
--



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

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


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