[12353] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5953 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 10 19:07:17 1999

Date: Thu, 10 Jun 99 16:00:20 -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           Thu, 10 Jun 1999     Volume: 8 Number: 5953

Today's topics:
    Re: "System" function delays output (Andrew Allen)
    Re: Acess databse access from unix with perl? <gellyfish@gellyfish.com>
    Re: Apache Authenticate and CGI (Jerome O'Neil)
    Re: Backticks waits for all processes to complete <rootbeer@redcat.com>
    Re: Binary File Uploading - Part 2 <gellyfish@gellyfish.com>
    Re: can't run a java App with my perl script using apac <rootbeer@redcat.com>
    Re: DBI & ODBC <gellyfish@gellyfish.com>
        Documentation Writing was [Re: Perldoc and Perlfaq] birgitt@my-deja.com
    Re: E-mail a file as an attachment. <rootbeer@redcat.com>
        ENV Question doug_brough@my-deja.com
    Re: hash table question <jdporter@min.net>
    Re: holding shell output in perl <gellyfish@gellyfish.com>
    Re: HOWTO: Compiling Modules (Bob Trieger)
        newbie question: Perl for sorting/generating html <lschwabe@msiprod.com>
        Odd/Even Numbers? <brent.s@ihug.co.nz>
    Re: OLE reference <gellyfish@gellyfish.com>
    Re: Perl on win32 <gellyfish@gellyfish.com>
        Please Help!! coneliberation@my-deja.com
    Re: Requesting help in optimizing (Larry Rosler)
    Re: Require "No NT commands"  on UNIX (Larry Rosler)
        Retrieving email <neil.prater@ype.gmpt.gmeds.com>
    Re: Sockets problem: solution and question <rootbeer@redcat.com>
        Taking a Poll..... rkidd@luc.edu
    Re: Taking a Poll..... (Darren Greer)
    Re: Thanks to everyone who's helped <gellyfish@gellyfish.com>
    Re: What's the "halting problem"? <jdporter@min.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 10 Jun 1999 22:07:28 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: "System" function delays output
Message-Id: <7jpcv0$go5$2@fcnews.fc.hp.com>

Thomas/Shurflo (thomas@shurflo.com) wrote:
: I'm using the system function to collect data from files. I'd like to
: display dynamic data after each file is processed, but for some reason
: the "system" function delays STDOUT until the script is completed.
: Anyone have any ideas why?

Can you do:

print scalar(`command`);

That will guarantee to be "in order" with your other perl code. Set
autoflush if needed. If you need a return code, you'll need to use
piped opens (and closes).

Andrew


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

Date: 10 Jun 1999 22:12:27 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Acess databse access from unix with perl?
Message-Id: <7jpd8b$rk$1@gellyfish.btinternet.com>

On 10 Jun 1999 17:40:46 GMT Scott McMahan wrote:
> (BXTC) (bxtc@forfree.at) wrote:
>> Is there any EASY
>> way I can use the Access DB in unix and for a web site?
> 
> Absolutely not. I just posted a long article on why not, very
> recently. News archives ought to have it. Search deja news.
> Basically, Access is NOT up to being a web backend database.
> 

Agreed.  Also it might be worthing looking on Dejanews in the group
comp.database.ms-access for reasons that .MDB are unlikely to be
supported on any other than a Microsoft platform.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 10 Jun 1999 22:47:34 GMT
From: jeromeo@atrieva.com (Jerome O'Neil)
To: brian@pm.org (brian d foy)
Subject: Re: Apache Authenticate and CGI
Message-Id: <7jpfa6$g09$1@brokaw.wa.com>

[Posted and mailed]

>> I have written a module to control Apache style acl and group lists. 
>> I'm considering posting it to CPAN, but I don't think it's quite ready
>> for that, yet, even though it's useable.  Let me know if you'd like it,
>> and I'll send you a copy.
> 
> is this different than HTTPD::UserAdmin?

Similar in function, but more lightwieght, and much less full 
featured.  Mine only handles basic ACL and group files (no DBM 
or SQL), and only requires core modules for support.  Mine is 
also not designed to run as CGI out of the box, although it 
could be used in that type of implementation.

Its a smaller wheel.


-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Thu, 10 Jun 1999 15:00:12 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Backticks waits for all processes to complete
Message-Id: <Pine.GSO.4.02A.9906101457490.26349-100000@user2.teleport.com>

On Thu, 10 Jun 1999 mclaren_aml@my-deja.com wrote:

> It appears that when backticks are used, Perl is keeping track of
> every process triggered as a result of this command, and waiting until
> all complete before returning.

Close. Perl starts only one process, and waits for that one to complete.
But if that one is a shell which starts more than one (which I think is
happening in your case), _it_ waits for them all, and perl waits for it.

> How can we prevent this - is it enough for the server
> to exec itself to break the parent connection?

See what perlfaq8 says about starting a process in the background. Good
luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 10 Jun 1999 21:25:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Binary File Uploading - Part 2
Message-Id: <7jpags$o9$1@gellyfish.btinternet.com>

On Thu, 10 Jun 1999 17:00:29 GMT I.J. Garlick wrote:
> In article <01beb326$79e91480$fe31a2d1@ryano-ke>,
> "Ryan" <dfs@thegrid.net> writes:
>> 
>> sub print_results{
>>      open (NEWPIC,">../submits/$newname") || 		#open existing or create the
> 
> For starters Ryan never die in a CGI script, doesn't help at all (some of
> the Gurus can probably get away with it but I as one of the lesser mortals
> here don't know how to do it).
> 
<snip>
> 
> However the FatalsToBrowser should take care of that I think and why Eric
> has a valid point in suspecting it's a compile error.
> 

You answered it yourself - try it out:

use CGI qw(:standard);

use CGI::Carp qw(fatalsToBrowser);

die "Bye bye";

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 10 Jun 1999 15:19:06 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: can't run a java App with my perl script using apache
Message-Id: <Pine.GSO.4.02A.9906101518530.26349-100000@user2.teleport.com>

On Thu, 10 Jun 1999 nicolased@my-deja.com wrote:

> perl code alone run fine but when I put it in the cgi-bin of an apache
> Win 98 server.It don't work.

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 10 Jun 1999 22:15:33 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DBI & ODBC
Message-Id: <7jpde5$rn$1@gellyfish.btinternet.com>

On Thu, 10 Jun 1999 15:49:50 GMT Rick Dasilva wrote:
> Hello,
> I have written a simple perl script to access a .dbf file through ODBC. The
> script works perfectly on my local machine but when I try it on a NT 3.51
> server running website 1.0, I get the following message:
> 
> Cannot connect to server: [Microsoft][ODBC dBase Driver] Could not find
> installable ISAM. (SQL-S1000)(DBD: db_login/SQLConnect err=-1)
> 

You should really ask in comp.database.ms-access or check the Microsoft
web site for information on this - you either have a missing or an
incompatible .dll (which eludes me right now.)

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 10 Jun 1999 20:39:24 GMT
From: birgitt@my-deja.com
Subject: Documentation Writing was [Re: Perldoc and Perlfaq]
Message-Id: <7jp7pq$sdp$1@nnrp1.deja.com>

In article <375fdb63@cs.colorado.edu>,
  tchrist@mox.perl.com (Tom Christiansen) wrote:
>      [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
>     R.Joseph <streaking_pyro@my-deja.com> writes:
> :I know this may sound stupid but I just got my hands on a copy of
> :Slackware Linux, and I keep hearing much about "perldoc" and
"perlfaq"
>
> perldoc is an embarrassing mistake and misunderstanding.
>
> The problem with perldoc is that it is not generalizable or extensible
> to any docset.  It only works for the perl distribution, and then
> only idiosyncratically.  It was not designed.  It tries to do many
> different unrelated things.  It was kludged as one hulking brute of an
> application.  I believe that the wrong set of primitives were chosen.
> Actually, primitives weren't chosen, but special hacks added.  That's
> the problem.  It should be several separate interchangeable tools.
With
> interchangeability, comes power.  This is not a power tool.  It's a
hack,
> one that grew beyond its purpose into something that should not live.
>
[snip]

I would be interested in learning how the documentation project of Perl
started out. When did someone and who did start to write the first .pod
files (if it was in fact ONLY you, do you think several authors could
have worked on it together)? If you could redo everything you did
concerning your involvement with Perl, what would you do differently
 today ? How would you structure a documentation this size ? Have you
honestly seen people working together on one consistent piece of
documentation - online - long distance ? Or was it in fact basically one
person who did 98% of all the work ? If yes, could there have been a
team ? I mean would it work in reality ? If not, why not ?

Do you think that it is a good idea to divide the documentation writing
from the code writing between the author of the code and (an)other
author/s for the documentation.

Is in general the author of a large software project the only person who
really can document it (being the master guru) and is it just lucky
coincidence if the author finds other minimaster gurus who dedicate
everything they got to write a good documentation (and bad luck
if he doesn't find such persons)?

How often do you think authors don't want to write documentation because
 they are burned out from code writing, and how often because they want
to keep more control and power over it ? *

birgitt

* I am asking this only because as an outsider to the IT world, I had
the opportunity to be an intern in the IT department of my families
insurance brokerage company, in which a large application was developed
in the eighties over a period of four years by three people. The package
was successfully used by our company and sold several times in the
industry to other brokers and did serve its purpose very well. As it
turns out today the package can't be used more than three to four more
years longer before something similar in function has to be completely
rewritten. This package contained an huge amount of "intelligence"
of this particular "industry". But the package is so poorly documented,
if at all, that only two persons (and each of them only half of the
package) in the company could rescue the company if there would be a
major hardware crash, nor can this "knowledge" be taken over into the
package which has to be developed in the near future. The company can't
afford a down-time of their system of more than five days. Seeing the
livelyhood of a company and with it some 700 people, which exists over
125 years to be dependent on ONE person, I was inclined to ask the (new
incoming) deputy chief of the IT department what he thinks about this
situation. His flat answer: "That is (in German: "Herrschaftswissen")
Knowledge of the people in power".
I just wondered what the heck my brothers, cousins, fathers and uncles
were thinking when they allowed that to happen. Who is in power of whom
and what ? Why is it that documentation is very often neglected ? Is it
lack of money, lack of the detailed insider knowledge of a software
package by people other than the developers themselves or is it "on
purpose" ? - Just shaking my head in disbelieve - . And I hear stories
similar to that one from other companies...






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


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

Date: Thu, 10 Jun 1999 15:39:24 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: E-mail a file as an attachment.
Message-Id: <Pine.GSO.4.02A.9906101534590.26349-100000@user2.teleport.com>

On Thu, 10 Jun 1999, Jon C. Morey wrote:

> I am using the SENDMAIL program to send a message via perl.  It was
> quite easy to print the lines and get a file sent.  I would like to
> send a file as an attachment.  Can I do this via SENDMAIL or do I need
> a mime package?

If you want to know what sendmail can do, the docs, FAQs, and newsgroups
about sendmail should be able to help. If you want to know about what
modules are available to use with Perl, check the Module List on CPAN.
Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 10 Jun 1999 20:26:50 GMT
From: doug_brough@my-deja.com
Subject: ENV Question
Message-Id: <7jp71u$s59$1@nnrp1.deja.com>

I'm trying to set some ENV variables in a script.  What am I doing
wrong:


#!/home/orca/rfadba/perl5/bin/perl
BEGIN {
$ENV{LD_LIBRARY_PATH}="/usr/openwin/lib:/home/orca/rfadba/oracle7.3.4/lib";
$ENV{ORACLE_HOME}="/home/orca/rfadba/oracle7.3.4";
}
eval 'use Oraperl; 1' || print "error with Oraperl $@ $]\n";


The above gives all sorts of errors about not being able to find
"libclntcsh".  Setting the environment BEFORE I call the script works
fine.

Any light anyone could shed would be GREATLY appreciated.  Thanks!

Doug Brough
brough@shellus.com


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


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

Date: Thu, 10 Jun 1999 20:49:19 GMT
From: John Porter <jdporter@min.net>
Subject: Re: hash table question
Message-Id: <7jp8cb$sl2$1@nnrp1.deja.com>

In article <375FEF4C.3488F558@email.sps.mot.com>,
  alainch <alain_chiorboli@email.sps.mot.com> wrote:
>
> sub update_record {
>     # Get input data
>     local (*input_table) = pop(@_);
>     dbmopen(%MAIN_TABLE, $DBM_name, 0660);

Someone could probably figure this out; but in the mean time,
why don't you try using MLDBM, with something like Data::Dumper;
that will do what you want to do.  May as well leverage all the
work that people have already done, solving common needs like this.
Please perldoc -f dbmopen.
Also, passing things by typeglob is considered passe.

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


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


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

Date: 10 Jun 1999 22:22:17 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: holding shell output in perl
Message-Id: <7jpdqp$t1$1@gellyfish.btinternet.com>

On Thu, 10 Jun 1999 18:49:18 GMT Steve . wrote:
> I have a perl script that calls rdist to do a system copy.  RDIST
> outputs things as it goes along to the screen.  I want that output to
> be caught by the perl script before it hits the screen and modified
> per my instructions.  How do you catch the output being displayed by a
> system call?  Thanks.
> 

You should look for:

  `STRING`

or

  qx/STRING/

in the perlop manpage.

/J\

-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 10 Jun 1999 22:49:49 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: HOWTO: Compiling Modules
Message-Id: <7jpdbc$r1t$1@holly.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
rfrink@infinet.com wrote:

>  Can anybody make a suggestion about how to get perl scripts that use modules
>to compile ?

I use modules in virtually all of my perl programs and they compile just 
fine.



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

Date: 10 Jun 1999 15:13:03 PDT
From: Lee Schwabe <lschwabe@msiprod.com>
Subject: newbie question: Perl for sorting/generating html
Message-Id: <376037F6.50C1EDAB@msiprod.com>

Hello,

Newbie question here.  I read through the faqs and think that learning
Perl will be the best way to do the following (but would like some
reassurance/suggestions):

Say I have a directory of html pages with similar content that is ever
growing.  (Typically, the page consists of a jpg at the top, a headline,
body text, another pic at the bottom, plus the usual navigation stuff.)
I want to have a page generated on the fly that is like a
thumbnail/browser thing for the directory. My thinking is to write a
script that will look at each html page in the directory then, pull out
the thumbnail jpg, one or two heading lines, possibly a couple lines of
text from the article and generate the thumbnail page.  I'm thinking
this is similar to the "photo gallery" type of things that I've seen
Perl do, but just more involved.

Looking for the best way to do this, somebody suggested Perl.  (I'm no
programmer, but did o.k. in my BASIC class years ago...)

Any info/suggestions appreciated.

Regards,
Lee Schwabe


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

Date: Fri, 11 Jun 1999 10:28:06 +1200
From: Brent Singers <brent.s@ihug.co.nz>
Subject: Odd/Even Numbers?
Message-Id: <Pine.LNX.4.10.9906111025220.1564-100000@brent.ihug.co.nz>

Is there any way of Perl telling if a number is odd or even?  I have a
script where I need do do one thing if a numerical result is even, and
something if it is odd...

Thanks for any help :)

Brent

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  /"\
  When looking for a reason why things go        \ / ASCII RIBBON CAMPAIGN
  wrong, never rule out sheer stupidity.          X  AGAINST HTML EMAIL
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  / \




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

Date: 10 Jun 1999 20:46:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: OLE reference
Message-Id: <7jp86s$nu$1@gellyfish.btinternet.com>

On Thu, 10 Jun 1999 10:55:03 -0700 David Cassell wrote:
> Jonathan Stowe wrote:
>> 
>> john kelly <johnt.kelly@worldnet.att.net> wrote:
>> > Can anyone please point me to some examples of how to use OLE objects
>> > for word.  The doc makes references to looking up the objects in VB or
>> > C manuals but I don't have any. Other  then  snip its of code examples
>> > here or there, thats all I can find.
>  <http://msdn.microsoft.com/officedev/preview/technical/articles/word.asp
> 
> Oops.  M$ has re-organized its site, and this page is kaput.

Are you sure - I cut and paste right there and then and I dont use a 
cache or a proxy ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 10 Jun 1999 21:08:49 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl on win32
Message-Id: <7jp9h1$o6$1@gellyfish.btinternet.com>

On 10 Jun 1999 11:29:14 GMT Steffen Beyer wrote:
> In article <7jmm53$tm$1@gellyfish.btinternet.com>, Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> 
>> > Is there another way, apart from a "$dummy = <STDIN>;" statement at
>> > the end of the script, to avoid the automatic closing of the MSDOS window
>> > after the script terminated (on Windows NT 4.0)?
> 
>> If you make your script into a batch file using pl2bat then you will be
>> able to change the 'Close on exit' property in the properties item of
>> the right mouse menu.  You can only do this with DOS programs and batch
>> files - Activeperl doesnt count as DOS program.
> 
> This only works if the script takes sufficiently long for you to change
> the properties in the meantime (at least I haven't found a way to change
> the properties of the .bat file itself in this respect).
> 
> This doesn't work if the script takes too short a time to complete.
> 

I believe that you can right click on the icon for the actual bat file
and change the properties without starting it - it will create another
icon (which is the one you should use ).

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 10 Jun 1999 20:20:27 GMT
From: coneliberation@my-deja.com
Subject: Please Help!!
Message-Id: <7jp6m0$s0u$1@nnrp1.deja.com>

The cone liberation society needs your help. We are an international
organisation dedicated to liberating traffic cones, an we're updating
our
webpages. This is where we need someones help.

We need to have a page where people can fill in details on a form so
that
they can join our organisation. We'd then like the form the details e-
mailed
to us. Unfortunately we don't have much experience in CGI scripts etc
and
need help.

If you think you can help please e-mail us.

Thanks

The Cone Liberation Society
cone.liberation@webtribe.net




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


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

Date: Thu, 10 Jun 1999 15:16:15 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Requesting help in optimizing
Message-Id: <MPG.11c9d90ec84e4052989bb7@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <37620f2f.73501531@news.supernews.com> on Thu, 10 Jun 1999 
19:22:03 GMT, Alan Young <alany@2021.com> says...
> I need some help in optimizing a bit of code.

You've come to the right place!  :-)
 
> I have a file with the following format:

<SNIP> of data reproduced below.

> The format is not under my control, but lines 1, 2 and 3 are (assumed)
> always the same type and are to be placed in specific variables.  I
> have come up with the following code, but I'm sure I can do this in
> less space.
> 
> Can anyone help me?

Oh, yes.  I LOVE to do things in less space.  :-)
 
> Code follows:

<SNIP of code processing one line at a time, with good style but 
considerable code repetition.>

I think the best approach to this kind of problem is to deal not with 
one line at a time (which requires managing several flags to tell you 
where you are), but with one 'record' at a time, where in this case the 
record separator is the "\n[" that demarcates each of your 'sections'.

The following code grabs a 'section' at a time, then processes it all 
out of $_.  No repetitive code, no flags, no fuss, no muss, no bother.



#!/usr/local/bin/perl -w
use strict;

use vars qw($line1 $line2 $line3);

{ local $/ = "\n[";

while (<DATA>) {
  chomp;              # Strip section-beginning marker
  s/^\s*(#.*)?\n//gm; # Strip blank lines and comment lines
  s/^\s+//gm;         # Trim leading space on each line
  s/\s+$//gm;         # Trim trailing space on each line
  next unless length; # Just getting started

  s/(.+)]\n// or die "$_: No section name after '['.\n";
  my $secname = lc $1; # Save the section name
  print "=================\n$secname\n";

  # Grab the next three lines
  s/(.+)\n(.+)\n(.+)\n// or die "$_: No initial three lines.\n";
  ($line1, $line2, $line3) = ($1, $2, $3);
  print "$line1\nline2\n$line3\n";

  # Process the remaining lines of the section
  print;
 }

}
__END__

# first hash on line is a comment and will be ignored
     # ignored, also blank lines will be ignored

[section]
line1
   line2
line3
additional

lines
here

[another section]
line1
line2
line3
 .
 .
 .

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


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

Date: Thu, 10 Jun 1999 15:47:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Require "No NT commands"  on UNIX
Message-Id: <MPG.11c9e077fced33e1989bb8@nntp.hpl.hp.com>

In article <slrn7m0d8p.5i.alastair@calliope.demon.co.uk> on Thu, 10 Jun 
1999 20:56:58 GMT, Alastair <alastair@calliope.demon.co.uk> says...
> Ashish Kadakia <anonymous@web.remarq.com> wrote:
> >I have following setup.
> >
> >Web Server running on NT
> 
> >How I can setup in CGI scripts or Perl Enviornment so that
> >it will not go to NT for commands and read UNIX commands as
> >I want to try several commands which are on UNIX and not on
> >NT.
> 
> The easiest way is to install unix and run a unix web server. I'd install Linux
> on it (but (just as) free alternatives exist). 

That avoids the issue of using NT at all.

One can create a quite capable Unix/POSIX environment on NT using 
commercial tools such as the MKS Toolkit, or free tools such as the Perl 
Power Tools <URL:http://language.perl.com/ppt/>.  Practically every 
command that is not OS-specific is available.

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


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

Date: Thu, 10 Jun 1999 14:16:39 -0800
From: Neil Prater <neil.prater@ype.gmpt.gmeds.com>
Subject: Retrieving email
Message-Id: <929053001.21407@www.remarq.com>

I am writing a perl script to retrieve email and do specific
things with it according to subject. I am current using
Mail:POP3Client module and all is fine except when I go to
use the Retrieve function. It returns both the head and body
as expected, but it looses the formating of the message.
Everything is then dumped into one line.. Some direction is
certainly apprectiated.



**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****


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

Date: Thu, 10 Jun 1999 15:32:57 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Sockets problem: solution and question
Message-Id: <Pine.GSO.4.02A.9906101519280.26349-100000@user2.teleport.com>

On Thu, 10 Jun 1999, Charlene Abrams wrote:

> My question now concerns sysread and syswrite. In the camel book, it
> says "You should be prepared to handle the problems (like interrupted
> system calls) that standard I/O normally handles for you". What
> exactly does this mean/imply?

When perl does the I/O for you (effectively, calling sysread and syswrite
itself) it takes care of the things that can go wrong. For example,
sysread calls read(2), and that manpage (which see) says that if an
interrupt occurs while trying to read, the read may return with no data. 

If there's an error like that Perl's sysread returns undef, and $! will be
set to an appropriate value. See the Errno module to find out what they
look like on your system.

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 10 Jun 1999 17:00:31 -0500
From: rkidd@luc.edu
Subject: Taking a Poll.....
Message-Id: <3760357F.BA16B0BC@luc.edu>

and I need your assistance. I plan on teaching myself Perl but I don't
know which book to use. If you have and suggestions please email me at
rkidd@luc.edu. Thank you. By the way I am a CS major with a background
in C++.


matt



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

Date: Thu, 10 Jun 1999 22:10:03 GMT
From: drgreer@qtiworld.com (Darren Greer)
Subject: Re: Taking a Poll.....
Message-Id: <376037a6.1308745156@news.qgraph.com>

www.oreilly.com

And buy Learning Perl (Second Edition).

Darren


On Thu, 10 Jun 1999 17:00:31 -0500, rkidd@luc.edu wrote:

-->and I need your assistance. I plan on teaching myself Perl but I don't
-->know which book to use. If you have and suggestions please email me at
-->rkidd@luc.edu. Thank you. By the way I am a CS major with a background
-->in C++.
-->
-->
-->matt
-->



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

Date: 10 Jun 1999 22:17:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Thanks to everyone who's helped
Message-Id: <7jpdhe$rq$1@gellyfish.btinternet.com>

On Thu, 10 Jun 1999 15:53:01 GMT Jared Hecker wrote:
> I just wanted to say "Thank you" to all and sundry who have been kind
> enough to offer their help and assorted wisdom as I have stumbled up the
> learning curve of perl and oraperl these last few weeks.  This newsgroup
> is a remembrance of what the net (and the profession) used to be.  All the
> knowledgeable people in this group should give themselves a pat on the
> back for bringing along those of us new to the speed and benefits of perl.
> 

Shh dont say that - everyone will want some ;-}

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 10 Jun 1999 20:41:01 GMT
From: John Porter <jdporter@min.net>
Subject: Re: What's the "halting problem"?
Message-Id: <7jp7sq$sg1$1@nnrp1.deja.com>

In article <7joshb$nen$1@pegasus.csx.cam.ac.uk>,
  mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
>          my_complcated_function() ? "19$year" : 1900+$year;
>
> Determining whether that has a Y2K bug is clearly equivalent to the
> halting problem.

Yes; and

         my_truly_random_function() ? "19$year" : 1900+$year;

is equivalent to Schroedinger's famous thought-experiment.
:-)

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


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


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

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

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