[11841] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5441 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 21 14:07:37 1999

Date: Wed, 21 Apr 99 11:00:23 -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           Wed, 21 Apr 1999     Volume: 8 Number: 5441

Today's topics:
    Re: Any visual editor for Perl: Win32? <tripix@tdi-net.freeserve.co.uk>
        Arrays problem <greg2@surfaid.org>
    Re: can't glob in Linux (Dan Wilga)
    Re: CGI programmer wanted <cassell@mail.cor.epa.gov>
    Re: CGI programmer wanted <cassell@mail.cor.epa.gov>
    Re: CGI programmer wanted (Randal L. Schwartz)
        elegant way of assembling array of arrays? <burton.not.spam@lucent.com>
    Re: ERROR: Read on closed filehandle <_GEN_0> (help!) <cassell@mail.cor.epa.gov>
    Re: Help! CGI::Cookie script works fine, but problem wh <gellyfish@gellyfish.com>
        Help!! (EXCHANGE:RICH4:T221)
    Re: Help!! (Abigail)
    Re: Help!! (Daniel Beckham)
    Re: How can I execute non cgi PERL script under NT? <tripix@tdi-net.freeserve.co.uk>
    Re: How can I execute non cgi PERL script under NT? swanson@my-dejanews.com
    Re: How can I execute non cgi PERL script under NT? (Bart Lateur)
        How to change an array to a list? yong321@yahoo.com
    Re: How to determine if a specified disk drive exists (Matthew Bafford)
    Re: How to determine if a specified disk drive exists (Larry Rosler)
    Re: HTTP_REFERRER <cassell@mail.cor.epa.gov>
    Re: Is it REALLY impossible to install Perl on Windoze? (Tom Mornini)
    Re: Monitoring the state of a serial port HELLLPPPPP <tripix@tdi-net.freeserve.co.uk>
    Re: Monitoring the state of a serial port HELLLPPPPP <tripix@tdi-net.freeserve.co.uk>
    Re: Net::Ping problem <cassell@mail.cor.epa.gov>
    Re: Perl vs. OTHER scripting languages ? When/Why to us bbense+comp.lang.perl.moderated.comp.lang.perl.misc.Apr.15.99@telemark.stanford.edu
    Re: Problem with writing to file. <cassell@mail.cor.epa.gov>
    Re: Problem with writing to file. (Tad McClellan)
    Re: Q: perl process won't go away (Daniel Beckham)
    Re: Risk for zombies in Randal's WebTechniques Columns  (Randal L. Schwartz)
    Re: search msoffice documents <cassell@mail.cor.epa.gov>
        Server Push (HP Ow Yong)
    Re: Starting program via perl! <cassell@mail.cor.epa.gov>
    Re: Suggestions and oneliners for Perl-talk? (Tad McClellan)
    Re: Suggestions and oneliners for Perl-talk? <cassell@mail.cor.epa.gov>
        The question about debug and design <carfield@polyu.hknet.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 21 Apr 1999 17:09:31 +0100
From: "Wayne Keenan" <tripix@tdi-net.freeserve.co.uk>
Subject: Re: Any visual editor for Perl: Win32?
Message-Id: <7fkuce$qek$1@news6.svr.pol.co.uk>


If your sure you dont want a kinesthetic or auditory editor, and you are
going on
about a dialog/window/yada its all the same,  type affair then you should be
looking for   SpecTCL  from Sun  (funnily enough the perl one is SpecPerl)





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

Date: Wed, 21 Apr 1999 18:09:34 +0100
From: Greg Griffiths <greg2@surfaid.org>
Subject: Arrays problem
Message-Id: <371E064E.7E7A8309@surfaid.org>

Dear All,
	I've just been forced into a corner over the use of the mailserver for
my project, i.e. I must use the Unix SendMail command for my project due
to server security issues, however my system using the Windows ODBC.pm
package. So I am going to call the send mail routine on teh server from
a Windows server, to do this I need help.

Firstly I will need to place each 'real name' and 'email address' in an
array and pass that over to this script and then sort through them on
the other side and do a send cycle for each. The array will be passed
along with other strings for the subject and the message, so could you
indicate how I'd get more than one argument sorted. I'll need to send
them as parameters from a submitted form, to avoid other security
problems.

Any help getting the array interaction to work appreciated.


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

Date: Wed, 21 Apr 1999 12:06:37 -0400
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: can't glob in Linux
Message-Id: <dwilgaREMOVE-2104991206370001@wilga.mtholyoke.edu>

In article <7fj1t6$ll2$1@nnrp1.dejanews.com>, John Busco
<jbusco@my-dejanews.com> wrote:

> Some more information for anyone interested in the problem described below,
> which is to do a "chdir, glob, print filenames" under RedHat Linux 5.0

There is a known problem with the error codes returned by bash. Since you
have tcsh, you can recompile Perl using this. Change 'd_csh' in config.sh
to point to it.

You can also set d_csh to 'undef' and set anything else that refers to a
shell (like 'full_csh') to blank.

When done, run `./Configure -S`.

Dan Wilga          dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply  **


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

Date: Wed, 21 Apr 1999 10:03:47 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: CGI programmer wanted
Message-Id: <371E04F3.78842687@mail.cor.epa.gov>

Tad McClellan wrote:
> 
> David Cassell (cassell@mail.cor.epa.gov) wrote:
> [snip down to highlight]
> 
> : Of course, we all know that CGI == Perl.
>                               ^^^^^^^^^^^
> 
>    I'm sure you meant:        CGI eq Perl
> 
>    == is for testing numeric equality.
> 
>    eq is for testing (bare word) string equality.  heh, heh.

I just thought it would be more entertaining if I stuck to the
bad syntax of the other thread's poster.  I guess that line needed
a smiley.

> : We learned that just this
> : week in another thread.
> 
>    We are taught that CGI is indistinguishable from Perl
>    several times a month, but we just don't get it.
> 
>    I fear we are just a bunch of slow learners...

Is there no hope for us?  Based on some postings, perhaps
a good lobotomy would do the trick.  :-)

> [more snips]
>
> : Actually, there was a lot more, but the MIME-encoded nude pictures
> : of Alyssa Milano and Pamela Anderson-Lee
> 
>    I liked them ...
> 
>    ... my wife didn't.

Well, I forward a lot of material to my wife, but I draw the line at...

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Wed, 21 Apr 1999 10:05:47 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: CGI programmer wanted
Message-Id: <371E056B.F48CDFAA@mail.cor.epa.gov>

Jerome O'Neil wrote:
> 
> David Cassell wrote:
> 
> > Actually, there was a lot more, but the MIME-encoded nude pictures
> > of Alyssa Milano and Pamela Anderson-Lee probably didn't show up
> > on your newsreader.  Although why he superimposed the Camel book into
> > those pics is beyond me...
> 
> I'd wager beer that if Alyssa and Pam replaced Mr. Camel on the cover,
> the book would be a best seller in a week.

Of course I deliberately picked those two names, since they are perhaps 
the two people who have had the most to say about naked pictures of 
themselves appearing on the net.  I saw Alyssa Milano testifying on
CSPAN about it last year.

-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 21 Apr 1999 10:24:53 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: CGI programmer wanted
Message-Id: <m1pv4xeviy.fsf@halfdome.holdit.com>

>>>>> "David" == David Cassell <cassell@mail.cor.epa.gov> writes:

David> Of course I deliberately picked those two names, since they are perhaps 
David> the two people who have had the most to say about naked pictures of 
David> themselves appearing on the net.  I saw Alyssa Milano testifying on
David> CSPAN about it last year.

But not in the CPAN. :)

<ducking>

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 21 Apr 1999 12:27:41 -0500
From: Burton Kent <burton.not.spam@lucent.com>
Subject: elegant way of assembling array of arrays?
Message-Id: <371E0A8D.4127D82D@lucent.com>

I have a list of strings, such as:
  @stringlist = [ "one two three", "eleven twelve thirteen", "twentyone"];
which I would like to convert to a list of lists such as:
  @stringlistlist [ ["one", "two", "three"], ["eleven", "twelve", "thirteen"],
["twentyone"] ];

(Note that the use of numbers is arbitrary, has nothing 
to do with the actual problem)

What's a good way to do this?  I'm trying to create something
like the Schwartzian transform.

Burton


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

Date: Wed, 21 Apr 1999 09:48:27 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: ERROR: Read on closed filehandle <_GEN_0> (help!)
Message-Id: <371E015B.6231EB1E@mail.cor.epa.gov>

Tracy wrote:
> 
> I am a new PERL programmer (:-) and could use some help with an error...

Okay.  BTW, is that the [ridiculously picky] error above?  
'PERL' ^= 'Perl'
A minor point, but if you think about it you'll see that capitalization
matters for every programming language.  c?  JAVA?  Basic?  see?

> I am in a while loop wherein I repeatedly glob a variable to fill an array
> with matching files... however, no files are matching (even though I am
> SURE there is a match to be made) and I get this error (from perl -w):

#!perl -w .  Very good.  Always use -w.  And 'use strict' is a good
thing
too.

> Read on closed filehandle <_GEN_0> at \\xxxxx.xxxx.com\sharename\fh.pl line
> 43.

Okay, did oyu know that you can find every Perl error message - with
explanation - in the perldiag manpage?  Type 'perldoc perldiag' and
you can scan for it.  Here's what the docs say:

| Read on closed filehandle <%s>
|         (W) The filehandle you're reading from got itself closed
|         sometime before now.  Check your logic flow.

Fairly explanatory, I'd say.
 
> Here is the actual code:

Well, possibly not all of it.  Where's the first line with the shebang?

> MAIN: while ($keepgoing) {
>                                         # build array full of files that are ready to be processed
>      @readyfiles = glob($filemask);

Okay, here's an important point to consider.  You're on a Win32 network.
I can divine that from here, just as I can see.. hmm.. that you.. or
someone you know.. will soon be on.. or near.. let's see.. a large body
of water...

Pardon me.  My point was that globbing is broken on Win32.  glob()
has the OS shell do the wildcard expansion.  And Win32's shell doesn't
manage.  Try this instead:

    use File::DosGlob 'glob';    #overrides glob in current package
    @readyfiles = glob($filemask);

>                                         #loop at resulting array to perform actions on each filename
> found
>      foreach (@readyfiles) {
>         handle_file ($_);
>      }
>                                         # sleep for awhile before looking again for new files
>      sleep($sleepsec);
> 
> }

HTH,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 21 Apr 1999 17:15:53 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help! CGI::Cookie script works fine, but problem when using SSI's
Message-Id: <371df9b9@newsread3.dircon.co.uk>

Jack Schlotthauer <jacks@cybersource.com> wrote:
> Why not <!--#exec cgi="/cgi-bin/test.cgi" -->
> 

Because thats nothing to do with Perl

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Wed, 21 Apr 1999 10:40:08 -0500
From: "Do, Bruce (EXCHANGE:RICH4:T221)" <brucedo@americasm01.nt.com>
Subject: Help!!
Message-Id: <371DF157.9AFBE729@americasm01.nt.com>

I am generating data files with 4 million entries but i want to write
out to a file at intervals of 20000. Right now the script will generate
one file with 4 million entries. Try reading a file of that size. Not
pleasant. So i want to generate 200 files with 20,000 entries. Any
suggestions greatly appreciated.
thanks in advance,
Bruce.



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

Date: 21 Apr 1999 17:36:52 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Help!!
Message-Id: <7fl2bk$51l$1@client2.news.psi.net>

Bruce (EXCHANGE:RICH4:T221) (brucedo@americasm01.nt.com) wrote on MMLIX
September MCMXCIII in <URL:news:371DF157.9AFBE729@americasm01.nt.com>:
^^ I am generating data files with 4 million entries but i want to write
^^ out to a file at intervals of 20000. Right now the script will generate
^^ one file with 4 million entries. Try reading a file of that size. Not
^^ pleasant. So i want to generate 200 files with 20,000 entries. Any
^^ suggestions greatly appreciated.


Uhm, use a counter? Add one to the counter each time you write a record,
and when the counter reaches a multiple of 20000, you close the current
file, and open another?

Or would that be too simple?

Here's alternative. Open 200 files. Put the handles in a circular
list. For each record, write the record to the current handle, and
advance to the next handle.

The first alternative gives you 20k record per file, while the second
one gives you 200 files.


Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


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

Date: Wed, 21 Apr 1999 13:51:39 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: Help!!
Message-Id: <MPG.1187da36f27bda1e9896b8@news.idt.net>

Well, what have you come up with so far?  Are you experienced with the 
for(;;) or while() statements?  Have you considered keeping count of 
lines you have read and storing them appropriately?

In article <371DF157.9AFBE729@americasm01.nt.com>, 
brucedo@americasm01.nt.com says...
> I am generating data files with 4 million entries but i want to write
> out to a file at intervals of 20000. Right now the script will generate
> one file with 4 million entries. Try reading a file of that size. Not
> pleasant. So i want to generate 200 files with 20,000 entries. Any
> suggestions greatly appreciated.
> thanks in advance,
> Bruce.
> 
> 


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

Date: Wed, 21 Apr 1999 17:20:18 +0100
From: "Wayne Keenan" <tripix@tdi-net.freeserve.co.uk>
Subject: Re: How can I execute non cgi PERL script under NT?
Message-Id: <7fkucg$qek$2@news6.svr.pol.co.uk>


Alejandro Eluchans wrote in message <371CDFB8.7503D706@umb.edu>...
>I got Perl Builder for NT and it works great.
>
>Now, I need to run my PERL scripts (under Win NT) independently of any
>web server or PERL utility.
are you slaying PERL as a util?  ouch

>Maybe using DOS line command (like UNIX) or maybe double clicking on a
>(.exe) icon?

c:\> line
bad command or filename
(definately not)

>How do I get the PERL interpreter to "compile" my script?

you dont, and it does anyway, but not in the way you are vaguely on about.

To answer your question:
perl2exe.exe
(double click on it!)






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

Date: Wed, 21 Apr 1999 16:52:01 GMT
From: swanson@my-dejanews.com
Subject: Re: How can I execute non cgi PERL script under NT?
Message-Id: <7fkvne$c8d$1@nnrp1.dejanews.com>

In article <slrn7hqm3b.ji.efflandt@efflandt.xnet.com>,
  efflandt@xnet.com wrote:
> On Tue, 20 Apr 1999 15:12:40 -0500, Alejandro Eluchans
> <alejandro.eluchans@umb.edu> wrote:
> >I got Perl Builder for NT and it works great.
> >
> >Now, I need to run my PERL scripts (under Win NT) independently of any
> >web server or PERL utility.
> >Maybe using DOS line command (like UNIX) or maybe double clicking on a
> >(.exe) icon?
> >How do I get the PERL interpreter to "compile" my script?
>
> I never used NT, but in Win95 is is as simple as associating the '.pl'
> file extension with perl.exe.  Then you simply double click on the file in
> Explorer (the file thing, not MSIE) and perl runs it.  Of course you
> cannot enter any parameters that way, but you can get input from STDIN.
>
> But I gave up on that long ago and run it in Linux instead, where
> everything works as intended.
>
> >Thanks,
> >
> >Alejandro
>
> --
> David Efflandt    efflandt@xnet.com
> http://www.xnet.com/~efflandt/
>

If you are a DOS or Windows profressional programer MKS Toolkit is the one
you should & MUST have.  I have used it since 1983.

Vincent Tsang

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 21 Apr 1999 17:34:58 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How can I execute non cgi PERL script under NT?
Message-Id: <371e0a7c.603680@news.skynet.be>

Alejandro Eluchans wrote:

>How do I get the PERL interpreter to "compile" my script?

In my previous post, I forgot to add this. I'll do that now.

There's a little utility included with the Activestate port that wraps a
".pl" file into a ".bat" file. It's called "pl2bat.bat" and resides in
Perl's bin directory. It uses Perl's built-in -x option to distill the
script out of the bat file again. Drop a ".pl" file on it, and you get
the equivalent ".bat" file.

	Bart.


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

Date: Wed, 21 Apr 1999 17:33:03 GMT
From: yong321@yahoo.com
Subject: How to change an array to a list?
Message-Id: <7fl24f$eip$1@nnrp1.dejanews.com>

I have a strange question. I want to change @ary which contains "a", "b"
elements to an "a", "b" list. Let me explain. I'm using the SMTP module. If
the user enters the string "a@b.com c@d.com" which is passed in as $email, I
want this:

      if ($email =~ / /)
       { @email = split / /,$email;
         $smtp->to(@email);	#doesn't seem to work
       }
      else
       { $smtp->to($email);
       }

I know $smtp->to("a\@b.com", "c\@d.com") works, but $smtp->to
("a\@b.com,c\@d.com") does not. Please help. Thanks.

Yong
Email:yong321@yahoo.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 21 Apr 1999 16:06:08 GMT
From: dragons@dragons.duesouth.net (Matthew Bafford)
Subject: Re: How to determine if a specified disk drive exists
Message-Id: <slrn7hrq7a.269.dragons@dragons.duesouth.net>

On Wed, 21 Apr 1999 15:21:25 +0200, Vincent Vanbiervliet <vvb@ibm.net>
lucked upon a computer, and thus typed in the following:
: 1 $mydrive="h";                 #drive letter to test
: 2 $bool=testdrive($mydrive);    #$bool is true (well: 1) or false (0)
: 3 $text=$bool?"Drive $mydrive exists.":"Drive $mydrive doesn't exist.";
: 4 print "$text\n";
: 
: 5 sub testdrive {
: 6         $drive=shift;
: 7         $dir="$drive:/";
: 8         opendir DIR, $dir or return "0";        # in theory you should do
: a 'or die...' Perl Guru's: please tell us if this is 'dangerous' or not...
: 9         return "1";
: 10         close DIR;
: 11 }

Hmm, people use the 'or die' syntax so much not because it's the only way
to handle an error, but because it's easy.  Plus, a large number of Perl
programs are written such that the 'or die' is all the error handling
that is needed.  It's just a convenient idiom.

Your program does have a couple of problems, though.

1) You're assuming that just because the opendir failed the disk doesn't
   exist.  Although in Win[93]x this may be true, in NT there are
   probably various other reasons it can fail (due to permissions).

2) Your DIR handle isn't closed when you think it is.

: Vincent

--Matthew


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

Date: Wed, 21 Apr 1999 10:50:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to determine if a specified disk drive exists
Message-Id: <MPG.1187afafb44cba89898f7@nntp.hpl.hp.com>

In article <slrn7hrq7a.269.dragons@dragons.duesouth.net> on Wed, 21 Apr 
1999 16:06:08 GMT, Matthew Bafford <dragons@dragons.duesouth.net> 
says...
> On Wed, 21 Apr 1999 15:21:25 +0200, Vincent Vanbiervliet <vvb@ibm.net>
> lucked upon a computer, and thus typed in the following:
 ...
> : 5 sub testdrive {
> : 6         $drive=shift;
> : 7         $dir="$drive:/";
> : 8         opendir DIR, $dir or return "0";        # in theory you should do
> : a 'or die...' Perl Guru's: please tell us if this is 'dangerous' or not...
> : 9         return "1";
> : 10         close DIR;
> : 11 }
 ...
> 1) You're assuming that just because the opendir failed the disk doesn't
>    exist.  Although in Win[93]x this may be true, in NT there are
>    probably various other reasons it can fail (due to permissions).

It is an 'existential' definition of 'exists'.  In essence, the drive 
exists if it can be read by the program that is executing.

> 2) Your DIR handle isn't closed when you think it is.

Ah!  I looked at that function, thought "Good -- he's keeping control 
upon success to close the filehandle." and failed to note that the 
statements were out of order.  :-(  (If it were written in C, 'lint' 
would report "Statement not reached."  I'll bet there's enough flow-
control information in the perl parser to do that too.  Sigh...)

Which leads to the following, much neater redaction of the function, 
relying on the automatic closing of a local filehandle:

      sub testdrive {
              local *DIR;
              opendir DIR, "$_[0]:/"
      }

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


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

Date: Wed, 21 Apr 1999 09:06:54 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: HTTP_REFERRER
Message-Id: <371DF79E.CDFF460@mail.cor.epa.gov>

Jonathan Stowe wrote:
> 
> On Sun, 18 Apr 1999 19:39:26 +0300 Juho Cederstrom wrote:
> >
> > Well, you could use $ref in the if line too, but I can't
> > get tilde out of my keyboard so I can't show how :(
> >
> 
> What ? I havent the faintest idea what a keyboard in your neck of the woods
> looks like but how can do Perl, Unix Shell, vi, Spanish without one ...

I couldn't figure that one out either.

But in fairness I might point out that there are languages (such as the
4GL SAS) which *assume* some people don't have certain keyboard
characters,
and `~' is one of those.  SAS provides an alternative character to do
the same function.  So maybe...

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Wed, 21 Apr 1999 16:38:07 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: Is it REALLY impossible to install Perl on Windoze???
Message-Id: <tmorniniFAJsvK.Gur@netcom.com>

mjw@bahnhof.se wrote:

: I am getting really mad. 

Who are you getting mad at?

Yourself, for not being able to figure it out, or for making the
choice to use a substand OS?

Microsoft, for making a substandard OS?

People on this newlist, who don't owe you anything, for not being
able to help?

The people who gave you the gift of Perl for free?

The person who wrote the docs and gave them to you for free?

God for putting you on this planet without all the answers at
your fingertips?

Get frustrated. You have NOTHING to be mad about as far as Perl
is concerned.

-- Tom Mornini
-- InfoMania


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

Date: Wed, 21 Apr 1999 17:45:14 +0100
From: "Wayne Keenan" <tripix@tdi-net.freeserve.co.uk>
Subject: Re: Monitoring the state of a serial port HELLLPPPPP
Message-Id: <7fkvop$r77$1@news6.svr.pol.co.uk>

This is shite, but it works.
It shite because: its a 'muddled' module , there are areas in this module
that a logically higher than that of a basic gab serail port and set it up
type affair.
There are bits unused or extra to the fact (lock file and activity flag
respectively)
Its is also shite because I havent used 'suidperl' and therefore effective
user IDs aren't used
or dropped.(BAD!!!)

There is simple prompt stuff handling.

Notes:
This was developed on a 5.1 Redhat linux box.
This needs Expect, which in turn needs IO::Pty, IO::Stty

## Com.pm - Generic Serial port set-up and basic communication with twiddly
bits
## Written by Wayne Keenan, 23-03-99


#Background

#After setting up the com port a few Expect like functions are available


#Member Functions

#new    (port, baud rate, bit size, parity, stop bits, handshake )  returns
a Com object


#prompt_is(string)        set a string that is used to identify a prompt
(return current if no parameter given)
#prompt_timeout(secs)     time to wait for receiving the prompt string
(return current if no parameter given)
#prompt_aquire            try to obtain the 'prompt', times out if fails;
(return current if no parameter given)

#timeout(seconds)         give up 'expecting' after this timeout)
(defualt=10 seconds)
#timesend(seconds)        time between sending characters      (uses expect
send_slow)  (default=1 second)


#utilization

#send(string, [timeout])          send characters with a delay between each
send.
#send_fast(string)                send characters without a delay between
each send.

#Expect functionality (see Expects.pm documentation)

#expect(string,[timeout])         expect string in the output
#before()                         returns text before the lasts 'expect'
match
#after()                          returns text after the lasts 'expect'
match
#clear()                          clears the accumulation buffer (returns
previous contents)

#[timeout]  if specified will overide the default timeout period, useful for
the odd command which
#           will cause the remote device to be held up processing the
request, and the default time out it too short

package Com;





use Expect;
use strict;

sub new
{
  my ($pkg)=shift;
  my ($device,$baud,$bit,$parity,$stop,$handshake) = @_;
  my ($oldMode,$exp,$fh);

  my $baudList={"0"   => 1,
  "50"  => 1,
  "75"  => 1,
  "110" => 1,
  "134" => 1,
  "134.5"=> 1,
  "150"  => 1,
  "200"  => 1,
  "300"  => 1,
  "600"  => 1,
  "1200" => 1,
  "1800" => 1,
  "2400" => 1,
  "4800" => 1,
  "9600" => 1,
  "19200"=> 1,
  "38400"=> 1,
  "exta" => 1,
  "extb" => 1,
       };


  my @defaultList   = qw(clocal cread -cstopb hupcl -parenb -parodd
cs8 -echo -echoe -echok
    -echonl -icanon -isig -noflsh -tostop -iexten -opost -brkint -ignbrk
    -ignpar -parmrk -inpck -istrip -inlcr -icrnl -ixon -ixoff);

  my $bitSizeList   = { "5"  => ["cs5"],
   "6"  => ["cs6"],
   "7"  => ["cs7"],
   "8"  => ["cs8"],
        };

  my $handshakeList = { "HW" => ["-ixon", "-ixoff" ],
   "SW" => ["ixon", "ixoff"],
        };

  my $parityList    = { "N"  => ["-parenb"],
   "O"  => ["parenb", "parodd"],
   "E"  => ["parenb", "-parodd"],   #NOTE:stty docs are wrong
        };

  my $stopBitList   = { "1"  => ["-cstopb"],
   "2"  => ["cstopb"],
        };

  my $element;


  #Do some validity checks
  die "Device requested ($device) does not exist."                  unless
(-r $device);
  die "Bit size request ($bit) is not supported."                   unless
($bitSizeList->{$bit});
  die "Baud rate requested ($baud) is not supported."               unless
($baudList->{$baud} );
  die "Parity reqested ($parity) is not supported."                 unless
($parityList->{$parity});
  die "Stop bit requested ($stop) is not supported."                unless
($stopBitList->{$stop});
  die "Handshaking method requested ($handshake) is not supported." unless
($handshakeList->{$handshake});

  open(Com::DEVICE,"+>$device") || die "Com:Couldn't open $device, $!\n";

  $oldMode=IO::Stty::stty(*Com::DEVICE,"-g");
  $exp=Expect->exp_init(\*Com::DEVICE);   #does some stty, careful, the
defaults may change in the future;

  #set up the Terminal characteristics

  IO::Stty::stty(\*Com::DEVICE, 'cs'.$bit);      #set the bit size

  for $element (@defaultList)
 IO::Stty::stty(\*Com::DEVICE,  $element)} ;
  for $element ($bitSizeList  -> {$bit})
 IO::Stty::stty(\*Com::DEVICE, @$element)} ;
  for $element ($parityList   -> {$parity})
 IO::Stty::stty(\*Com::DEVICE, @$element)} ;
  for $element ($stopBitList  -> {$stop})
 IO::Stty::stty(\*Com::DEVICE, @$element)} ;
  for $element ($handshakeList-> {$handshake})
 IO::Stty::stty(\*Com::DEVICE, @$element)} ;

  my $config = bless {
    # port settings
    "active"  => 1,                  # activity flag
    "stty"    => IO::Stty::stty(*Com::DEVICE,"-g"),    #current tty settings
    "device"  => $device,            # location of device on the FS
    "fhandle" => $fh,                # file handle of device
    "dhandle" => \*Com::DEVICE,  # tty handle
    "sttyOld" => $oldMode,           # previous tty settings
    "hasLock" => "no",               # Lock file

    # expect settings
    "expect"  => $exp,               # expect object
    "timeout" => "5",                # timeout used for 'expect's  (seconds)
    "slowTime"=> "1",                # time between char sends     (seconds)
(preferably whole, linux can do <1.0)

    # remote terminal settings
    "prompt"  => "",                 # what the remote prompt is expected to
look like
    "promptPoke" => "",              # command string to send to poke the
device intogiving prompt
    "promptTimeout" => "10",         # how long to wait before receiving the
prompt.
  }, $pkg;

  return($config);
}

# remote terminal settings

#set or gets the remote interfaces prompt characters
sub prompt_is
{
  my $self =shift;
  @_  ? $self->{"prompt"}=shift       # set
      : $self->{"prompt"};            # get
}

sub prompt_poke_is
{
  my $self =shift;
  @_  ? $self->{"promptPoke"}=shift       # set
      : $self->{"promptPoke"};            # get
}



sub prompt_poke
{
  my ($self)   =shift;
  my ($overide)=shift;

  $overide ?  return ($self->{"expect"}->send_slow($overide,
         $self->{"promptPoke"}))
           #  use objects default setting:
           :  return ($self->{"expect"}->send_slow($self->{"slowTime"},
         $self->{"promptPoke"}));

}



# get the remote device to a prompt
sub prompt_accuire
{
  my $self =shift;
  return
($self->{"expect"}->expect($self->prompt_timeout(),$self->prompt_is()))
      || die "prompt_accuire:Could not get prompt";
}



sub prompt_timeout
{
  my $self =shift;
  @_  ? $self->{"promptTimeout"}=shift       # set
      : $self->{"promptTimeout"};            # get
}












## Expect related stoof follows

sub timeout
{
  my $self =shift;
  @_  ? $self->{"timeout"}=shift       # set
      : $self->{"timeout"};            # get
}

sub timesend
{
  my $self =shift;
  @_  ? $self->{"slowTime"}=shift       # set
      : $self->{"slowTime"};            # get
}






# send a string to the device
sub send
{
  my ($self)   =shift;
  my ($string) =shift;
  my ($overide)=shift;

  $overide ?  return ($self->{"expect"}->send_slow($overide, $string))
           :  return ($self->{"expect"}->send_slow($self->{"slowTime"},
$string));
}

sub send_fast
{
  my ($self)  =shift;
  my ($string)=shift;
  print $self->{"expect"},  $string;
  return;
}

sub expect
{
  my ($self)   =shift;
  my ($string) =shift;
  my ($overide)=shift;
  $overide ?  return ($self->{"expect"}->expect($overide, $string))
           :  return ($self->{"expect"}->expect($self->{"timeout"},
$string));
}

sub after
{
    my ($self)  =shift;
    return ($self->{"expect"}->exp_after());
}

sub before
{
    my ($self)  =shift;
    return ($self->{"expect"}->exp_before());
}

sub clear
{
    my ($self)  =shift;
    return ($self->{"expect"}->clear_accum());
}

sub matched
{
    my ($self)  =shift;
    return ($self->{"expect"}->exp_match());
}

sub listeners
{
    my ($self)  =shift;
    my (@group) =@_;
    return ($self->{"expect"}->set_group(@group));
}


#####################


sub DESTROY
{
  my ($self)=shift;
  #print STDERR "Com.DESTROY:$self->{\"device\"} \n";

  $self->{"active"}=0;
  IO::Stty::stty($self->{"dhandle"},$self->{"sttyOld"}); # restore previous
settings
  close($self->{"dhandle"});
  $self->{"expect"}->hard_close();
}
# could and an END to be sure things are deleted

sub AUTOLOAD
{
  my ($obj)=$_[0];
  warn "Com::$obj does not exist as a member function";
#  return if $AUTOLOAD =~ /::DESTROY$/;   #never proporgate a DESTROY call.
}


1;








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

Date: Wed, 21 Apr 1999 17:50:52 +0100
From: "Wayne Keenan" <tripix@tdi-net.freeserve.co.uk>
Subject: Re: Monitoring the state of a serial port HELLLPPPPP
Message-Id: <7fl023$rdi$1@news6.svr.pol.co.uk>

Wayne Keenan missed something out in message
<7fkvop$r77$1@news6.svr.pol.co.uk>...
>This is shite, but it works.  AS ROOT!!!  (BAD!!!)






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

Date: Wed, 21 Apr 1999 10:30:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Net::Ping problem
Message-Id: <371E0B2B.1A9A50CB@mail.cor.epa.gov>

Andre L. Belem wrote:
> 
> Hi Perl friends,
> 
> I'm using the module Net::Ping to test hosts, doing exactly what the
> Perl Cookbook recommend, but it's not working.
> Look my script:
> #!/bios4/user1/LWperl5/bin/perl -w

Very good.  Always use `-w'.

> use strict;

Also very good.  This will help keep your code clean.

> use Net::Ping;
> 
> # <---------------- here test if SeaWiFS and WWW-AWI are alive
> 
> $alive = Net::Ping->new("tcp");  # not root! use tcp

Oh.  If you say 'use strict', you have to take care of your variables.
'use strict', among other things, restricts unsafe use of variable 
names.  You'll want all variables to be declared with `my', unless
they're fully qualified or imported.  Add the word `my' in front
of the variable $alive in the line above.  That's it.

> (defined $alive)
>         or die "Something wrong with Net::Ping procedure: $!\n";
> 
> if ($alive->ping("www.awi-bremerhaven.de")) {
>         print "AWI-WWW is alive\n";
> } else {
>         print "AWI-WWW may be down\n";
> }
> $alive->close;
> 
> Here is the response when I try to execute it:
> 
> [bios4] /home/bios1/abelem/www-bios4 :just.pl
> Global symbol "$alive" requires explicit package name at just.pl line 8.
> Execution of just.pl aborted due to compilation errors.

See?  You're being warned that $alive hasn't been declared using `my',
so it requires an explicit package name.
 
> So...I'm a beginner and I don't understand what means "explicit package
> name !".

In general, any time you get a confusing error message, go to the
perldiag manpage and look up the error to get an explanation.
just type `perldoc perldiag' at a command prompt, and then search for
your error.
 
> Could someone help me ??
> Thanks in advance

You're welcome.
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 15 Apr 1999 14:46:23 GMT
From: bbense+comp.lang.perl.moderated.comp.lang.perl.misc.Apr.15.99@telemark.stanford.edu
Subject: Re: Perl vs. OTHER scripting languages ? When/Why to use it ?
Message-Id: <7f4u3v$5qe$1@nntp.Stanford.EDU>



In article <3714AC6C.967940A5@slpmbo.ed.ray.com>,
Michael Genovese  <mikeg@slpmbo.ed.ray.com> wrote:
>Hello:
>
>I've been asked by my manager to come up with reasons, arguments,
>and/or guidelines for choosing one scripting language over another.
>
>Our group is a modest-sized TOOLS group in a large company.
>We have scripts in the following :
>
>        * AWK (and NAWK)
>        * C SHELL
>        * KORN SHELL
>        * PERL
>        * TCL
>
>I'm a PERL fan.
>I know C SHELL a bit, but find PERL much easier to handle.
>
>My manager is definately a C SHELL fan, doesn't know PERL and doesn't
>really have the time to learn it.  In point of fact, he's a C SHELL expert.
>
>He recently decided that we WILL do our scripts in C-SHELL & AWK/NAWK,
>but is now willing to modify his position if I can come up with
>compelling arguments to do otherwise.

- - GACK!! ACK!! PHUT!!! 

- - Look on the web for the classic 

	"CSH Programming Considered Harmful." 

- - http://language.perl.com/versus/index.html is a good place to start.

- - You will never write a portable maintainable tool with C-SHELL. 
Awk is acceptable, but it has a pretty narrow focus ( pattern
matching ) and can become horribly complex after a while. 

- - If you must write in a shell KORN is okay, but if you 
delve too far into it's features you'll end up with 
unportable stuff. If I were going to write in a shell, I'd
pick some subset of /bin/sh to use. 

- - I've learned all this the hard way, I went along way down 
the C-SHELL/AWK path before I picked up perl. Even perl3 is 
a better solution that this. 

- - If your boss won't budge on this I think it's time to 
consider getting a new boss. Anyone still recommending CSH
programming in this day and age is going to go down in flames
sooner or later, best not to be on board when it happens. 

- - Booker C. Bense 
 


Version: 2.6.2

iQCVAwUBNxX7uwD83u1ILnWNAQG39gP/XLA2YGtLfM0rYp6WL3UmtFyl2zWN8g36VcRceK2zkLwlbsUL4KFLbepSTK86tL4k0sz8yk+I5T6VlFwuViG
Dz8tjzg51bo=
=3R26
-----END PGP SIGNATURE-----

--MAO07078.924365245/renoir.op.net--


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

Date: Wed, 21 Apr 1999 09:19:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Problem with writing to file.
Message-Id: <371DFA9B.4A0F4E@mail.cor.epa.gov>

smnayeem@my-dejanews.com wrote:
> 
> In article <lm1jf7.jv4.ln@magna.metronet.com>,
>   tadmc@metronet.com (Tad McClellan) wrote:
> > scraig@my-dejanews.com wrote:
> >
> > : It is also
> > : possible to turn off the output buffering.
> >
> >    How do you do that?
> >
> >    (enabling auto-flush does not "turn off" buffering)
> u need to use the $| system variable to turn off buffering.

I think you missed Tad's point.  $| doesn't `turn off' the
buffering.  It (if set to nonzero) forces a flush right away, and
after every write or print on the selected output channel.
There is a difference.

But it is probably not germane to your problem.

HTH,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Wed, 21 Apr 1999 06:54:27 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Problem with writing to file.
Message-Id: <3pakf7.fm5.ln@magna.metronet.com>

smnayeem@my-dejanews.com wrote:
: In article <lm1jf7.jv4.ln@magna.metronet.com>,
:   tadmc@metronet.com (Tad McClellan) wrote:
: > scraig@my-dejanews.com wrote:
: >
: > : It is also
: > : possible to turn off the output buffering.
: >
: >    How do you do that?
: >
: >    (enabling auto-flush does not "turn off" buffering)


: u need to use the $| system variable to turn off buffering.


   That is auto-flush.

   That is not turning off buffering.

   That was my whole point.

   $| does not turn off buffering. It turns on auto-flush (which
   makes it "look like" it is unbuffered when it is still in fact
   buffered).


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 21 Apr 1999 13:47:58 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: Q: perl process won't go away
Message-Id: <MPG.1187d959f28277849896b7@news.idt.net>

In article <MPG.1187a5ea6d78924d9896b6@news.idt.net>, danbeck@scott.net 
says...
> what hung, not perl.  I could release the process, NT kept telling me 
                          ^^^^^^
Umm, sorry, I meant I _could not_ release the process...


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

Date: 21 Apr 1999 08:59:47 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Risk for zombies in Randal's WebTechniques Columns forking code?
Message-Id: <m14smaezgs.fsf@halfdome.holdit.com>

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

Bart> In Randal's (excellent) WebTechniques columns (URL:
Bart> http://www.stonehenge.com/merlyn/WebTechniques/), here's one version of
Bart> a trick he's used a few times so far (columns 11, 20, 23 and 24):

Bart> 	defined(my $pid = fork) or die "Cannot fork: $!";
Bart> 	exit 0 if $pid;                 # I am the parent
Bart> 	#child continues here...
Bart> 	close(STDOUT);

Bart> The question is, plain and simple: doesn't this generate zombie
Bart> processes? If not, why not? If too, is it possible to avoid zombies
Bart> without loosing the original functionality?

A "zombie" is a process that has been forked but not waited on.  In
the examples I wrote, I'm creating "orphans" instead...  a process
whose parent process disappears before it does (in this case, the
parent is returning a status code rather quickly to the web server).
Orphans are immediately adopted by process 1 (init), and when the
process dies, it's immediately reapted by init.

So, no, this doesn't create zombies, except for a millisecond or so.
Thanks for asking.

print "Just another Perl column hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 21 Apr 1999 09:21:56 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: search msoffice documents
Message-Id: <371DFB24.51370532@mail.cor.epa.gov>

Alastair wrote:
> 
> ombiasan@hotmail.com <ombiasan@hotmail.com> wrote:
> >
> >
> >hello everybody,
> >
> >i need to know if there are any possibilities to search msoffice documents
> >(95/97) for a certain content (e.g. string)
> 
> Well, I'm not speaking from experience. I'd just treat the 'msoffice' files as
> normal and read them as binary (see 'binmode'). Maybe as fixed blocks ('read'
> perhaps). Look to match your 'string' using a regular expression ('perldoc
> perlre').

That won't work in the general case.  Too many `special' character used
in too many places.  You may not be able to find the given string
without some decoding.

And by that, I mean `special' in the sense of `special ed'.  :-)

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Wed, 21 Apr 1999 18:32:07 +0100 (BST)
From: een7hpo@electeng.leeds.ac.uk (HP Ow Yong)
Subject: Server Push
Message-Id: <1999Apr21.173208.20262@leeds.ac.uk>

I am having trouble with server push utility for CGI.pm module. Even though I 
copy paste the example found on the documentation, I don't seem to be able to 
run the script over the browser. However if I run it via command line (eq perl 
somefile.pl) It works perfectly fine. Any advice?

Anyway I am using WIN95 with Apache and the latest ActivePerl.. and IE3. Thank 
you


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

Date: Wed, 21 Apr 1999 10:56:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: unix244@ai.fh-nuernberg.de
Subject: Re: Starting program via perl!
Message-Id: <371E114C.67817363@mail.cor.epa.gov>

Will wrote:
> 
> Hello perl freaks,

I prefer to think of myself as a Perlite.  Earthy, useful, ...

> I need your help! I wanna start a program (binary) out of a perl script.
> Is there any command I can use for doing this. I have written a perl
> script which is checking a text file and depending on files contents it
> has to start the appropriate program.

Use the perldoc program and look up the following:
system()
exec()
qx//
``  [those are called backticks]
open()

Depending on what you want the program to do, and how you want to
handle the program's output and error codes, one of these will
suffice.

But you might not need to run some of those programs.  Have you
checked that Perl doesn't have a buit-in to do the same thing?

HTH,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Wed, 21 Apr 1999 07:16:37 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Suggestions and oneliners for Perl-talk?
Message-Id: <l2ckf7.fm5.ln@magna.metronet.com>

Thorbjoern Ravn Andersen (Thunderbear@bigfoot.com) wrote:
: I have the pleasure to talk in our local Linux user group on Tuesday
: about Perl.

: Since this is an excellent opportunity to show the possibilities with
: Perl, I would like some ideas for what I should tell and demonstrate in
: the 2-3 hours I have available (expected audience is people who do know
: how to program but does not know perl), and I am intending to mention
: the following:

: o	regular expressions
: o	dynamic arrays
: o	hashes


o   linguistic bias to Perl's design rather than compiler theory bias.
    (I think there is a link to 'natural.html' at www.wall.org somewhere)

o   a bazillion pre-invented wheels ready to "plug in" (modules)

o   comprehensive documentation in an electronically searchable
    format (about 1100 pages)

o   thousands of other Perl programmers for tech support for
    those few problems that are not answered in the PODs

o   gluing: using Perl to translate output format of one program into
            an input format acceptable to another program.

o   5-10 times less code/time than doing the same thing in C.
    (come up with a couple of examples)

o   more modular, faster, and more secure (taint checking) than sh scripts

o   portability across OSes and OS "flavors"



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 21 Apr 1999 10:42:32 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Suggestions and oneliners for Perl-talk?
Message-Id: <371E0E08.C605D454@mail.cor.epa.gov>

Thorbjoern Ravn Andersen wrote:
> 
> I have the pleasure to talk in our local Linux user group on Tuesday
> about Perl.
> 
> Since this is an excellent opportunity to show the possibilities with
> Perl, I would like some ideas for what I should tell and demonstrate in
> the 2-3 hours I have available (expected audience is people who do know
> how to program but does not know perl), and I am intending to mention
> the following:
> 
> o       regular expressions

Something simple: find all the words in the dictionary which have
a,e,i,o,u in order.
   perl -ne 'print if /a.*e.*i.*o.*u/' /usr/dict/words

Then ask something harder.  How do you parse HTML tags, to handle
all the things that can be there?  Start out with the easy [but wrong]
answer, and work your way up as in the FAQ.  Then wrap up by
showing how it's done in HTML::Parser .

> o       dynamic arrays
> o       hashes
> 
> but there must be additional "power tools" within perl which would be
> suitable for the uninitiated.
> 
> I would also like some one-liners to spice up the show :-)  I am looking
> for stuff for everyday use (like convert all filenames to lowercase) but
> also show-offs like "Crack in one line of Perl".
> 
> Any good suggestions?

Two good one-liners can be found at the TPJ website, showing
previous results of the Obfuscated Perl Contests.  While the two
on-liners I recall aren't particularly obfuscated, they are
powerful.  One finds the first unused uid [nice sysadmin tool],
the other converts newlines for Mac & Win/DOS files to Unix newlines.
The second is a good example of regexes in action.

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Thu, 22 Apr 1999 00:00:44 +0800
From: Carfield Yim <carfield@polyu.hknet.com>
Subject: The question about debug and design
Message-Id: <371DF62C.B4E352C4@polyu.hknet.com>

I am a starter of programming,
I find I always have no idea how to design and I always debug by "try
and error"

How can I train my design and debug skill?



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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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