[13535] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 945 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 29 16:07:42 1999

Date: Wed, 29 Sep 1999 13:05:13 -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: <938635513-v9-i945@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 29 Sep 1999     Volume: 9 Number: 945

Today's topics:
    Re: Advice wanted: Creating an .exe (Abigail)
    Re: Calling windows API through Perl? <cassell@mail.cor.epa.gov>
    Re: Can in UNIX, But How in Perl (Abigail)
    Re: CGI.pm POST_MAX uploading <admin@gatewaysolutions.net>
        Complex hashes and CGI <ubu@easynet.ca>
    Re: counting problem <cassell@mail.cor.epa.gov>
    Re: deprecated $[ <crdevilb@mtu.edu>
        Email Attachments <xbradsjer@dtgnet.com>
    Re: Email Attachments <dan@tuatha.sidhe.org>
    Re: embedding java in cgi to preload .wav files <cassell@mail.cor.epa.gov>
    Re: gcos/gecos <cassell@mail.cor.epa.gov>
    Re: How to append an extension to a value in a variable <cassell@mail.cor.epa.gov>
    Re: How to convert perl file into binaries? (Abigail)
    Re: HTML to ASCII <cassell@mail.cor.epa.gov>
    Re: HTML to ASCII <Tbone@pimpdaddy.com>
    Re: HTML::Filter docs <cassell@mail.cor.epa.gov>
    Re: Installing Tk on solaris? <lusol@Pandora.CC.Lehigh.EDU>
    Re: kill extra white space in a variable <sariq@texas.net>
    Re: kill extra white space in a variable <crt@kiski.net>
    Re: kill extra white space in a variable <aqumsieh@matrox.com>
    Re: korn shell to perl <cassell@mail.cor.epa.gov>
    Re: looking for robust fast,scalable database engine fo <cassell@mail.cor.epa.gov>
    Re: Perl - SQL examples <cassell@mail.cor.epa.gov>
    Re: perl Ad <cassell@mail.cor.epa.gov>
        perl checksum code <vwilding@digizen.net>
    Re: perl checksum code <makkulka@cisco.com>
    Re: Perl IDE for X <kperrier@blkbox.com>
    Re: Perl Question <cassell@mail.cor.epa.gov>
    Re: Question from a starter <cassell@mail.cor.epa.gov>
    Re: Question from a starter (Abigail)
    Re: question: cgi-script on server a database on server <cassell@mail.cor.epa.gov>
    Re: Regex for quotes in text database (Eric Bohlman)
    Re: Sendmail and Perl in NT <cassell@mail.cor.epa.gov>
    Re: Sequential Debugging ? - Problems <cassell@mail.cor.epa.gov>
        Split() on vertical bar | <feduskabm@msx.upmc.edu>
    Re: Split() on vertical bar | <vincent.murphy@cybertrust.gte.com>
        test cuncua@hotbot.com
    Re: time <cassell@mail.cor.epa.gov>
    Re: UNIX (Solaris 2.6) to NT ACCESS DB? (Scott McMahan)
    Re: Wow! cgi.pm is great! <cassell@mail.cor.epa.gov>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 29 Sep 1999 13:27:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Advice wanted: Creating an .exe
Message-Id: <slrn7v4mvp.avl.abigail@alexandra.delanet.com>

Henry Penninkilampi (spamfree@metropolis.net.au) wrote on MMCCXX
September MCMXCIII in <URL:news:spamfree-3009990218100001@d5.metropolis.net.au>:
-- In article <slrn7v2u50.9kl.abigail@alexandra.delanet.com>, Abigail
-- <abigail@delanet.com> wrote:
--
-- > No Perl distribution comes with LWP anyway.
--
-- Incorrect, the MacPerl distribution comes with LWP.


With a Perl distribution I mean the distribution as coming from Larry
and/or the current pumpkin. 



Abigail
-- 
perl -wlne '}for($.){print' file  # Count the number of lines.


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


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

Date: Wed, 29 Sep 1999 12:11:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Calling windows API through Perl?
Message-Id: <37F26457.6321948D@mail.cor.epa.gov>

tiiger@my-deja.com wrote:
> 
> I am trying call windows API functions throught Perl.

There are lots of ways to do this.

First, check whether there are Perl modules which will do
all the work for you.  Some Win32 APIs have already been
utilized in Perl modules.  A number of them have names like

Win32::Event
Win32::File
Win32::Process
Win32::Service
  .
  .
  .

There are lots of them.  If no one has yet written one
just for your needs, then check out these:

Win32::API
Win32API::Net
Win32API::Registry


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


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

Date: 29 Sep 1999 13:35:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Can in UNIX, But How in Perl
Message-Id: <slrn7v4net.avl.abigail@alexandra.delanet.com>

Alex Rhomberg (rhomberg@ife.ee.ethz.ch) wrote on MMCCXX September
MCMXCIII in <URL:news:37F249A8.29B6DBFD@ife.ee.ethz.ch>:
'' Jerry Preston wrote:
'' > 
'' > In UNIX I can do the following:
'' > 
'' >     cd */9181339
'' > 
'' > and UNIX will change directory correctly.
'' > 
'' > How can I do this in Perl.
'' 
'' The same way:
'' $_ = `cd */9181339`; chomp; chdir $_ or become_unhappy;

Uhm, in which shell is the output of cd the name of the new directory?

Perhaps you meant `ls */9181339` ?


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


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


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

Date: Wed, 29 Sep 1999 14:48:28 -0500
From: "Scott Beck" <admin@gatewaysolutions.net>
Subject: Re: CGI.pm POST_MAX uploading
Message-Id: <rv4reveb3i592@corp.supernews.com>


> > > Is there a way around this to give a friendly html error instead ?
> >
> > Yes there is a way around this. Use CGI::Carp
> >     use CGI::Carp qw(fatalsToBrowser set_message);
> >     BEGIN {
> >        sub handle_errors {
> >           my $msg = shift;
> >           print "<h1>Oh gosh</h1>";
> >           print "Got an error: $msg";
> >       }
> >       set_message(\&handle_errors);
> >     }
> Cheers, exactly what I wanted. I'm fairly new to Perl and only just
> starting to discover all the other goodies in those pm files !
> Terry
>

I would say the best way to learn about what the Modules have to offer and
the little intricacies is to just download them and open them up and read
the Data section. Most of them have there entire readme built right in to
the module. Either at the top or at the bottom.

Cheers,
Glad I could help.
Scott



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

Date: Wed, 29 Sep 1999 19:04:53 GMT
From: Ubu <ubu@easynet.ca>
Subject: Complex hashes and CGI
Message-Id: <7stnsa$h9c$1@nnrp1.deja.com>

I'm working on some CGI scripts, using CGI.pm, which need to maintain
information stored in a complex hash (ie hash of hashes, hash of lists).
My current plan is to use Data::Dumper to store the data in temporary
files, save/reload the data on each load of the page.

What I'm wondering is if anyone has taken a different approach,
specifically if there is any way to pass a complex hash with an
arbitrary structure as a form element(s) (hidden probably) using CGI.pm
itself. From what I can tell it is not possible, but I suspect other
people have probably come up against this sort of problem before, and
I'm interested to hear what other solutions you might have tried.

Thanks in advance,

Barry Hemphill

"Love is a snowmobile racing across the tundra and then suddenly it
flips over, pinning you underneath.  At night, the ice weasels come."
                -- Matt Groening


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 29 Sep 1999 11:48:48 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: counting problem
Message-Id: <37F25F10.FFFC15EC@mail.cor.epa.gov>

Fulko van Westrenen wrote:
> 
> Hello,
> 
> I have a problem with counting. My data is stored in a large hash
> of records and each record has one field that codes its type,
> a one-letter string.
> I want to know the sums of the different types. For this I made the
> following code but it keeps giving me error messages about the counters.
> Can anyone give me a hint on how to fix it?
> 
>  .
>  .
>   foreach $tmp (@sortrec){
>     $sum++;
>     @tr = split (/;/, $tmp);
>     $pntr = $tr[0];
>     @tr = split(/;/,$dataset{$pntr});
>     $_ = $tr[17];
>     /w/ && $wijzig++;
>     /n/ && $nieuw++;
>     /o/ && $onbekend++;
>     /a/ && $actief++;
>     /i/ && $inactief++;
>     /b/ && $blokkeer++;
>     /v/ && $verwijder++;
>   }

My PSI::ESP module is telling me that your $dataset{$pntr}
value does not always have 18 fields in it.

If that is not the problem, then perhaps you could show us 
a complete program which demonstrates the problem, while
staying at less than 30 lines.  Tell us what the error is,
and what debugging steps you have taken.

Then we may be of more help next time.

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


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

Date: 29 Sep 1999 19:34:40 GMT
From: Colin R. DeVilbiss <crdevilb@mtu.edu>
Subject: Re: deprecated $[
Message-Id: <7stpkg$es4$1@campus3.mtu.edu>

Abigail <abigail@delanet.com> wrote:
> Uri Guttman (uri@sysarch.com) wrote on MMCCXX September MCMXCIII in
> <URL:news:x7iu4twwj3.fsf@home.sysarch.com>:
> @@ can you think of a good reason to use it? the powers that be thought
> @@ there was none and it was open to abuse.

> Which raises the question, why was it ever introduced in the first place?

what about a2p? (I know it can be done even without, but it lets reluctant
awk-to-perl converts not shift all $\d+ down one, doesn't it?)

Colin DeVilbiss
crdevilb@mtu.edu


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

Date: Wed, 29 Sep 1999 14:06:07 -0500
From: "Jeremy Bradshaw" <xbradsjer@dtgnet.com>
Subject: Email Attachments
Message-Id: <frtI3.33$xK5.788@newsfeed.slurp.net>

Hello,

I have a form written with Perl that sends emails with attachments.  Under
Outlook 97 everything works great.  Under Outlook 98 the attachments come
through, but without file extensions.  It looks like the MIME types may be
different for Outlook 98???  A typical MIME type that I'm using is
"Content-Type: application/pdf; name=filename.pdf".  If someone could please
let me know what is wrong or point me towards a URL with more information, I
would be very appreciative.

Thanks in advance.

Jeremy




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

Date: Wed, 29 Sep 1999 19:32:47 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Email Attachments
Message-Id: <zPtI3.1284$S32.2280@news.rdc1.ct.home.com>

In comp.lang.perl.misc Jeremy Bradshaw <xbradsjer@dtgnet.com> wrote:
> Hello,

> I have a form written with Perl that sends emails with attachments.  Under
> Outlook 97 everything works great.  Under Outlook 98 the attachments come
> through, but without file extensions.  It looks like the MIME types may be
> different for Outlook 98???  A typical MIME type that I'm using is
> "Content-Type: application/pdf; name=filename.pdf".  If someone could please
> let me know what is wrong or point me towards a URL with more information, I
> would be very appreciative.

The only thing that's wrong is you're assuming that what yo're seeing in
Outlook98 is what you sent. Outlook's probably hiding the extensions of
files that it recognizes.

					Dan


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

Date: Wed, 29 Sep 1999 11:21:18 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: embedding java in cgi to preload .wav files
Message-Id: <37F2589E.34233DB1@mail.cor.epa.gov>

sophieloo@my-deja.com wrote:
> 
> I am a beginning programmer... I am looking for a way to preload
> small .wav files onto a webpage. I have been told that there is a java
> function which will do this. I have been reading through the perlxstut
> man page to try to understand how java can be embedded in perl. Anyone
> ever do this? Any help appreciated.

Since your problem is really a web programming problem which
is (somewhat) language independent, you may have more luck
getting a good answer in a group like 
comp.infosystems.www.authoring.cgi instead of here.

But if you really are a beginning programmer, then I really
don't think you want to try to tackle using XS .. which is for
C anyway, not java.  You'd need the JPL package from O'Reilly
to do that.

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


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

Date: Wed, 29 Sep 1999 11:56:49 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: gcos/gecos
Message-Id: <37F260F1.38B69F19@mail.cor.epa.gov>

Peter Icaza wrote:
> 
> > General (Electric) Comprehensive? Operating System
> >
> 
> thanks.  how would anyone else but you know this?  i got some pretty funny

Flattery will get you nowhere.

> looks from people i asked, ("who cares?").  i should have looked on the web
> but i didnt think of that thinking "its gotta be  in here someplace...".

Check the web for the "The Hacker's Jargon File".  It has
this and a lot more fun oddities.

> was it first documented in the stonehedge, (not related to randal), user's
> guide? :)
> 
> again,
> thanks for the arcania, (is that a word?)

Arcana.  We also handle requests for Latin and Greek too,
if you use the secret pass-phrase for the day.

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


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

Date: Wed, 29 Sep 1999 12:17:52 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to append an extension to a value in a variable
Message-Id: <37F265E0.B22A8170@mail.cor.epa.gov>

Henry Penninkilampi wrote:
[snip]
> $filename .= $extension;

Just a nit to pick, Henry.  Since you're dealing with someone
who hasn't learned enough Perl to know what '.' does, don't you
think he'll be totally confused by the '.=' construct?  Nice
answer.  But if you want to help beginners, then you need to
explain what your help does.  Otherwise they can't tell the
difference between your code and Abigail's ingenious obfuscations.

[We really have had someone ask how to use the nefarious
 pohc() subroutine Abigail supplied as an answer here.]

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


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

Date: 29 Sep 1999 13:38:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to convert perl file into binaries?
Message-Id: <slrn7v4nja.avl.abigail@alexandra.delanet.com>

Chicheng Zhang (Chicheng_Zhang-P29601@email.mot.com) wrote on MMCCXX
September MCMXCIII in <URL:news:37F23B85.CDDAAC26@email.mot.com>:
--
-- I do need convert a perl file into binaries, the cases are:
-- as a root, sometimes we write a new application(command) in perl but don't
-- want it to be readable but executable by users.
-- chmod +s it,   is a solution to my knowledge.

For a somewhat strange definition of "solution". If you are not very
careful, your "solution" might become a problem, or even a security
hazard.

It's beyond me why you don't want the thing readable by users though.



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: Wed, 29 Sep 1999 11:23:55 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: HTML to ASCII
Message-Id: <37F2593B.ADAC849@mail.cor.epa.gov>

Abigail wrote:
> 
> David H. Adler (dha@panix7.panix.com) wrote on MMCCXIX September MCMXCIII
> in <URL:news:slrn7v2ke0.9c5.dha@panix7.panix.com>:
> ^^ In article <7sl4cr$cuq$1@gellyfish.btinternet.com>, Jonathan Stowe wrote:
[snip]
> ^^ >Thats a *little* harsh wouldnt you say ?  I would suggest flogging
> ^^ >it least it gives them an opportunity to recant.
> ^^
> ^^ No one said anything about shooting them *fatally*...
> 
> Yeah.... just the knee caps will be fine....

Oh, so now you'll be writing with a German accent and we'll
have to pronounce your name as "Ahh-bi-gail".  Hmmph.

Or maybe not.  Wasn't the T-1000 programmed in COBOL?
No wonder he lost to a couple humans.

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


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

Date: 29 Sep 1999 19:44:16 GMT
From: Tushar Samant <Tbone@pimpdaddy.com>
Subject: Re: HTML to ASCII
Message-Id: <7stq6g$8ah$1@eve.enteract.com>

knok@daionet.gr.jp writes:
>w3m is also good. It can handle table and frame.

"Also good" is understating it. This browser is small, fast,
beautiful, and good for every casual surfing need. And text
formatting is awesome. Lynx is dead meat. Long live w3m.
Thanks for mentioning it.



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

Date: Wed, 29 Sep 1999 11:28:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: HTML::Filter docs
Message-Id: <37F25A57.8C49F00A@mail.cor.epa.gov>

Steven Cotton wrote:
> 
> Hi,
> 
> Does anyone have any further examples of HTML::Filter, or any further docs?
> I find the documentation that comes with the module not very helpful and
> I really don't want to write something that's already been written, I am
> unfamiliar with the callback method. Deja.com has been semi helpful, but
> I'm still confused as to the use of this module.

Perhaps you could show us 10 or 20 lines of what you have
written thus far, and someone here can assist you from there.

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


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

Date: 29 Sep 1999 17:50:26 GMT
From: "Stephen O. Lidie" <lusol@Pandora.CC.Lehigh.EDU>
Subject: Re: Installing Tk on solaris?
Message-Id: <7stjh2$1big@fidoii.cc.Lehigh.EDU>

Clayton L. Scott <tex@engsoc.carleton.ca> wrote:
> You, yes you, Mario. Stop writing stuff like this:
> : Hi
> : I'm quite new to this perl-stuff so I'm not sure if this is the right
> : mailing list.

> 	This is not a mailing list. It is a newsgroup. Read
>  news.announce.newusers for guidelines on participating in newsgroups .

> : Is there a binary distribution of Tk available somewhere? Or can I
> : perhaps compile it myself somehow? The target machine in question is a
> : SUN Enterprise Server with OS-Version SunOS 5.5.1

> 	This is not a perl question. Try asking in a Tcl forum such as
>  comp.lang.tcl

Hmm.

Or try asking in a Perl forum such as comp.lang.perl.tk (-:

Perl/Tk is available on CPAN/authors/id/NI-S.


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

Date: Wed, 29 Sep 1999 13:10:23 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: kill extra white space in a variable
Message-Id: <37F2560F.FD2FCB84@texas.net>

"Casey R. Tweten" wrote:
> 
> On Wed, 29 Sep 1999, Tom Briles wrote:
> 
> :$string =~ s/^\s+//;
> :$string =~ s/\s+$//;
> 
> You don't need two lines.  Can we add this to the FAQ?
> 
> $_ = '    space space   ';
> s/(^\s*|\s*$)//g;
> 

Perhaps you should *read* the FAQ.

- Tom


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

Date: Wed, 29 Sep 1999 14:56:04 -0400
From: "Casey R. Tweten" <crt@kiski.net>
Subject: Re: kill extra white space in a variable
Message-Id: <Pine.OSF.4.10.9909291446590.30176-100000@home.kiski.net>

On 29 Sep 1999, Abigail wrote:

:Casey R. Tweten (crt@kiski.net) wrote on MMCCXX September MCMXCIII in
:<URL:news:Pine.OSF.4.10.9909291102480.4735-100000@home.kiski.net>:
:--
:-- You don't need two lines.  Can we add this to the FAQ?
:--
:-- $_ = '    space space   ';
:-- s/(^\s*|\s*$)//g;
:
:No, as that's less efficient and less clear than the 2 liner.
:
:But we might want to add to the FAQ why this isn't a good idea...

Great idea!

It is, at 1_000_000 iterations, close to 2.5 times slower that the one
liner, the above being around 38 secs, and the two liner at 15.  That is
discusting.

-- 
   Casey R. Tweten    <joke> This
    Web Developer      is 100% certified
HighVision Associates    virus and bug
 crt@highvision.com     free code. </joke>




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

Date: Wed, 29 Sep 1999 14:10:39 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: kill extra white space in a variable
Message-Id: <x3y905pvba8.fsf@tigre.matrox.com>


"Casey R. Tweten" <crt@kiski.net> writes:
> On Wed, 29 Sep 1999, Tom Briles wrote:
> :$string =~ s/^\s+//;
> :$string =~ s/\s+$//;
> 
> You don't need two lines.  Can we add this to the FAQ?
> 
> $_ = '    space space   ';
> s/(^\s*|\s*$)//g;

You don't need the brackets. Also using + instead of * should be a bit
faster.

	s/^\s+|\s+$//g;

I benchmarked the one-line approach against the two-line one. The
two-line one is a bit faster (not by much, though).

HTH,
--Ala



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

Date: Wed, 29 Sep 1999 11:38:57 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: korn shell to perl
Message-Id: <37F25CC1.479A6CCA@mail.cor.epa.gov>

Kent Mehr wrote:
> 
> I'm looking for an easy way to translate korn shell scripts to perl.
> Any hints ?

You could have found this yourself in the FAQ [in perlfaq8 to
be exact and maybe even helpful].  It would have turned up
if you had tried any one of the following perldoc searches:

perldoc -q convert
perldoc -q shell
perldoc -q script
perldoc -q "shell script"

And the bottom line is that there is no simple way to do it,
other than the not-quite-helpful technique of wrapping your
old shell script in a Perl program which just exec()s it.

So many of the programs which ksh has to call are already
built into Perl.  And Perl has a host of flow control and
translation features which ksh doesn't.  So for any
non-trivial ksh script, you'll end up sitting down and
re-writing the code into something more Perlish to
get the most out of your efforts.

P.S.  Pay no attention to old version of the Perl FAQ
which reference an AI program to do the conversion.  That
AI program got way too smart, and now refuses to do any
such conversions without payments.

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


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

Date: Wed, 29 Sep 1999 11:31:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: looking for robust fast,scalable database engine for e-mail application
Message-Id: <37F25B0B.15C75196@mail.cor.epa.gov>

Abigail wrote:
> 
> Bernie Goldberg (goldberg@goldsoft.com) wrote
[snip]
> [] Are there any cgi scripts which can be used to create a hotmail type
> [] service?
> 
> Try Matt Wright's archive. Hotmail was coded using just 50 lines of code!

That should consititute 'cruel and unusual punishment'.

Not to the poster, but to us in this newsgroup.  Every lurker
who reads this note and then gets a Matt Wright script will
feel entitled to come pester us on 01/01/2000 [errr, I mean
01/01/19100 :-] when the script malfunctions.

Please, Abigail.  It was funny.  I enjoyed reading it.
But...

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


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

Date: Wed, 29 Sep 1999 11:51:55 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl - SQL examples
Message-Id: <37F25FCB.D0F0DD62@mail.cor.epa.gov>

nileshnimkar@my-deja.com wrote:
[snip]
> To access various databases you get various Modules of perl like Sybperl
> and oraperl. Find one to suite your needs.

Even ignoring typos, this does not seems like good advice to me.

To access various databases, one should instead get the DBI module
and various DBD::* modules which serve as the drivers.  Oracle
and Sybase both have DBD drivers, and there are also drivers for
MySQL, CSV text files, ODBC-compliant databases, etc.

If you think this is too picky, remember that you have heard
the following phrase before:
    "Nit 1, Perl 2"

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


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

Date: Wed, 29 Sep 1999 12:05:33 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perl Ad
Message-Id: <37F262FD.30202903@mail.cor.epa.gov>

One Bored Guru wrote:
[the same thing he writes every time]

Wow.  Isn't this guy ever going to stop posting this job ad
here?  I haven't killfiled anyone in this NG yet, but I'm
considering it...

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


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

Date: Wed, 29 Sep 1999 18:57:24 GMT
From: Vince Wilding <vwilding@digizen.net>
Subject: perl checksum code
Message-Id: <37F26114.9D0FBA73@digizen.net>

Looking for code to do a simple checksum.  Here's something I cobbled 
together, but does anyone know of perl source for CRC or MD5?

## SNIP ----------------------------------------------------------
# Rudimentary Checksum

CheckSum("ABCDEF");
print "$CkSum\n";
CheckSum("ABCDFE");
print "$CkSum\n";

sub CheckSum {
  $ItemToCkSum = shift;
  $Len = length($ItemToCkSum);
  $CkSum = 0;
  for ($Idx = 0; $Idx < $Len; $Idx++) {
      $Single = substr($ItemToCkSum,$Idx,1);
      $Ascii = ord($Single);             # Get Value of ASCII to
      $CkSum = $CkSum + ($Ascii * $Idx); # use in Calc'ing  checksum
  }
}
## SNIP ----------------------------------------------------------

--
Vince Wilding, Web Wrangler, MetaData Maven, Perl Hacker Wannabe
USGS/BRD/OBIO   Voice: 703-648-4220  Fax: 703-648-4224
El Jefe di CASA --- http://www.wdn.com/casa
mailto:vince_wilding@usgs.gov  http://biology.usgs.gov/~vwilding/
Machines used in demolition are called Cats. Coincidence?


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

Date: Wed, 29 Sep 1999 12:36:37 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: perl checksum code
Message-Id: <37F26A45.67557EEC@cisco.com>

[ Vince Wilding wrote:

> Looking for code to do a simple checksum.

Just use unpack.
perldoc -f unpack
--



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

Date: 29 Sep 1999 14:28:48 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: Perl IDE for X
Message-Id: <DC0C3C5D09731199.97CE5C76D0B2DE71.90FEF9633D125C75@lp.airnews.net>

Francisco Romero <fromero@csudh.edu> writes:

> Does anyone know if there is an Integrated Developmental Enviornment for
> perl?

Sure.  have two xterms open.  In one, have a vi session going with your
code in it.  in the other, run your script.

> 
> Is there anything to help me write Perl code in X ?
> 

Xterm's (or Eterms or gnome-terminals, etc) are of tremendous
help.

Kent
-- 
work hard, save aggressively, invest well and get the hell out


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

Date: Wed, 29 Sep 1999 11:18:24 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl Question
Message-Id: <37F257F0.B38C6FBF@mail.cor.epa.gov>

Larry Rosler wrote:
> 
> In article <37F15987.55AF676@mail.cor.epa.gov> on Tue, 28 Sep 1999
> 17:12:55 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
> > Dheera wrote:
[snip]
> > ...  And you don't need to backwhack
> > a slash *inside* a character class, you know.
> 
> You do when the slash is foolishly used as the regex delimiter, as in
> this case.

Thank you.  It seems I left out a large portion of what I was
thinking there.  

Maybe I shouldn't have taken Jonathan's advice on that typing 
tutorial program, if I'm going to elide entire clauses.  :-)

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


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

Date: Wed, 29 Sep 1999 12:12:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Question from a starter
Message-Id: <37F264B5.35610B46@mail.cor.epa.gov>

Jonathan Stowe wrote:
[snip]
> @name = (
>           ["blah","woof"],
>           ["plio","roow"],
>           ["zippey","dippey"]
>         );
> 
> print $name[3][0]; # zippey

Funny, I would have said:

    print $name[2][0];

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


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

Date: 29 Sep 1999 14:39:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Question from a starter
Message-Id: <slrn7v4r6g.avl.abigail@alexandra.delanet.com>

Ivo Swartjes (i.m.t.swartjes@student.utwente.nl) wrote on MMCCXX
September MCMXCIII in <URL:news:7st5f4$95d$1@dinkel.civ.utwente.nl>:
?? I was wondering how a multidimensional array is created in Perl (something
?? like @name=((a,b),(c,d),(e,f)) ?  ) and how I can access say the second
?? element of the third subarray (which is f in this case)...someone said
?? something like $value = @name{3}{2} but that doesn't work...I've tried
?? @name[3,2] too, without good results


Tsssk. In my days, students at Dutch universities taught how to RTFM.

But then, in those times, Univ. of Twente wasn't a university anyway.


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: Wed, 29 Sep 1999 11:44:06 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: question: cgi-script on server a database on server b
Message-Id: <37F25DF6.A665DCC1@mail.cor.epa.gov>

[Note: I am replying to Abigail's post because Thorsten's post
never showed up on my newsfeed]

Abigail wrote:
> 
> Thorsten Muschler (thorsten.muschler@uni-essen.de) wrote
[snip]
> ;; $filename = "urls.txt";      # The database text file
[snip]
> ;; for example the urls.txt file should be  stored
> ;; on the server http://www.myserver.de/datebase/urls.txt

Abigail provided correct advice, as always.  But you may not
have gleaned a key aspect from that advice.

Your old code apparently assumes urls.txt to be a file on a
local filesystem.  You want urls.txt to be accessible via
HTTP, which is *not* a filesystem despite the way it looks.
You can't get do that without changing from a simple open()
to the use of a Perl module which will speak the protocol
needed.

Look into LWP::Simple and LWP::UserAgent .  One of them
may be what you want, since you apparently need to snag
a webpage and then work with it.  You may also need to
strip HTML tags out.  If so, you may need to use HTML::Parser
[or else lynx].

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


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

Date: 29 Sep 1999 19:36:50 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Regex for quotes in text database
Message-Id: <7stpoi$hc6@dfw-ixnews14.ix.netcom.com>

Abigail (abigail@delanet.com) wrote:
: Kim Saunders (kims@emmerce.com.au) wrote on MMCCXX September MCMXCIII in
: <URL:news:938579711.779677@draal.apex.net.au>:
: () 
: () Would someone be so kind as to help me out with a regex to strip *unwanted*
: () (as opposed to all) double-quotes (") from a string. They are always at the
: () start and end of the string.
: 
: 
: You want the /u modifier. That only removes unwanted characters.

You forgot to mention that it's only enabled if you load the dwim pragma:

use dwim;



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

Date: Wed, 29 Sep 1999 12:04:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Sendmail and Perl in NT
Message-Id: <37F262BC.A3942581@mail.cor.epa.gov>

ldh7@my-deja.com wrote:
> 
> I am currently working on a project where I am trying to send email
> from a server running on Windows 98/Windows NT.  I would like to use
> Perl 5.0 to send the mail; however, I am having a bit of difficulty in
> creating the proper program.
> 
> When I run sendmail.pm the system says "use vars;" and "Time::Local" -
> I do not have either on my system.  This leads me to believe that I am
> using the wrong version of Perl. 

Whoa!  You HAVE to have the 'vars' pragma on your system, 
unless you're using Perl 4 or earlier [IIRC].  And Time::Local
comes with the Perl install too.  What do you get when you
type 'perl -v' at a command prompt?  If you don't have
5.005 or later, go ahead and upgrade now.  5.005_03 [build
519 at ActiveState] is the current stable version.

>                                  I believe that there is a separate
> build of Perl for NT which is different from the build for Win '95.
> Is this true?  If so, where can I get the NT version?

Not true.  www.activestate.com has a version which runs
on all the win32 systems.
 
> Is active Perl necessary to run this procedure?

If you have something other than ActiveState's Perl or a
Perl you downloaded from CPAN and built yourself, then you
need to go to www.activestate.com and get a modern Perl.
 
> If anyone can give me any advice on how to make this program run,
> please let me know.

[1] Follow my above instructions and get build 519;
[2] Read the HTML docs on the PPM program;
[3] Use ppm to snag Mail::Mailer or Mail::Sender ;
[4] Go back to the HTML docs and browse through the FAQ,
    the ActivePerl FAQ, the docs, the module docs, etc.
    to get an idea of what info is available on your hard
    drive.

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


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

Date: Wed, 29 Sep 1999 12:06:46 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Sequential Debugging ? - Problems
Message-Id: <37F26346.9222DDC@mail.cor.epa.gov>

ynot353539@aol.com wrote:
> 
> My program is getting a little complex.
> 
> I am using CGI.pm and myownDate.pm
> For the latter I had to add a BEGIN block to push the dir on @INC

Have you tried the 'use lib' pragma instead of the BEGIN block
push technique?

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


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

Date: Wed, 29 Sep 1999 15:07:55 -0400
From: Bill Feduska <feduskabm@msx.upmc.edu>
Subject: Split() on vertical bar |
Message-Id: <37F2638B.A9826D7A@msx.upmc.edu>

Any ideas on how to split() a line on a vertical bar (hash mark) | ?
Thanks.



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

Date: Wed, 29 Sep 1999 19:17:36 GMT
From: Vincent Murphy <vincent.murphy@cybertrust.gte.com>
Subject: Re: Split() on vertical bar |
Message-Id: <xjgln9pmss0.fsf@gamora.ndhm.gtegsc.com>

>>>>> "Bill" == Bill Feduska <feduskabm@msx.upmc.edu> writes:

    Bill> Any ideas on how to split() a line on a vertical bar (hash mark) | ?
    Bill> Thanks.

split(/\|/ , $_ );


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

Date: 29 Sep 1999 18:41:11 GMT
From: cuncua@hotbot.com
Subject: test
Message-Id: <7stmg7$lr4$1@news.netmar.com>

ignore




     -----  Posted via NewsOne.Net: Free Usenet News via the Web  -----
     -----  http://newsone.net/ --  Discussions on every subject. -----
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net


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

Date: Wed, 29 Sep 1999 11:27:48 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: time
Message-Id: <37F25A24.146CE260@mail.cor.epa.gov>

Matilda Dahlqvist wrote:
> 
> Is there any way how I can measure time in a program other than seconds, I
> need milliseconds at least.
> I have tried using benchmarks but the result is always in seconds.
> 
>         Matilda

As Abigail so subtly hinted, the answer to your question is
already available.  If you look in the FAQ, you'll find this
question:

"How can I measure time under a second?"

I found it by typing:

perldoc -q "\btime\b"

since 'perldoc -q time' turned up some extra matches.

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


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

Date: Wed, 29 Sep 1999 19:39:15 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: UNIX (Solaris 2.6) to NT ACCESS DB?
Message-Id: <DVtI3.140$QE1.6115@newshog.newsread.com>

Jonathan Stowe (gellyfish@gellyfish.com) wrote:

> The question about the format of ms-access files on the group 
> comp.databases.ms-access is much like then question about validating
> mail addresses here - I FAQ with no positive answer...

Even MS's own description of their file formats uses the COM storage as a
basis for how they define the file format (at least for Word and Excel,
the two file formats whose structure I've seen the documentation for),
so even if you had the official MS spec it wouldn't help you with the
MDB file itself if you wanted to use it on another platform.

You'd have to reverse engineer the structure of the COM storage format
itself, which has never been documented that I have ever seen. Even
shortcuts have no file format documentation, because they are tiny
storages. Microsoft's apps division uses the storage as-is without trying
to use the raw file.

A COM storage doesn't have to be even in the (disk) filesystem. It could
be in a database or something. They don't document it because it is an
abstraction whose implementation could change -- at one time, the entire
NT filesystem was under contemplation to be a big COM storage, but that
changed (when they realized how slow it would be :)). The storage could
be in-core, in a database, or on another machine with DCOM.

If you thought they'd never change the storage structure, you could
hex dump it and reverse engineer it, and build a COM storage clone
yourself. Then you could examine an MDB file and see what was in it.

Scott


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

Date: Wed, 29 Sep 1999 11:53:56 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Wow! cgi.pm is great!
Message-Id: <37F26044.8A2F8C15@mail.cor.epa.gov>

Campos wrote:
> 
> Thanks to all who recommended it over cgi-lib.pl.  I have seen the light!

Amen, brothers and sisters!  Can I have an 'Amen'?

> Still have a few formatting issues, though.  Is Stein's book any good?

It is thorough and free of embarrassing bugs in code.  But one
guy to whom I recommended Stein's book found it slow going, 
and rather dry.  Some like it a lot.  But YMMV.

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


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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


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