[8242] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1859 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 11 13:15:22 1998

Date: Wed, 11 Feb 98 10:00:25 -0800
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, 11 Feb 1998     Volume: 8 Number: 1859

Today's topics:
    Re: base64 -> GIF image ?? <tchrist@mox.perl.com>
        cal (was: Year 2000 Compliance: Lawyers, Liars, and Per (Mike Stok)
        FAQless Forays (was: Code Example Needed) <tchrist@mox.perl.com>
    Re: FAQless Forays (was: Code Example Needed) (Steve Linberg)
        Finding the last line in a list? (Burt Lewis)
    Re: Hashes Usage <SNIPhsommer@micro.ti.comSNIP>
    Re: Hashes Usage (Steve Linberg)
        how to properly interpret a '-?' command line option <hughw@sr.hp.com>
    Re: How to receive the output of a file upload form? <sbekman@iil.intel.com>
    Re: HTTP::Request -- Using POST to cgi forms <y-pisan@nwu.edu>
    Re: keyboard input in BLIND MODE <tchrist@mox.perl.com>
        Perl 32 5.003_07 and NT 4.0 Server Problem <davidraw@bigfoot.com>
    Re: Perl 32 5.003_07 and NT 4.0 Server Problem (Steve Linberg)
    Re: Perl HTML output in Win 95 <camerond@mail.uca.edu>
    Re: perl5.003 and now CGI won't work <tmh@possibility.com>
        Redirecting output with back-ticks from tar <henke@students.uiuc.edu>
    Re: Redirecting output with back-ticks from tar <tchrist@mox.perl.com>
    Re: Redirecting output with back-ticks from tar <henke@students.uiuc.edu>
    Re: RFC about ``Matt's Script Archive'' <joneil@cks.ssd.k12.wa.us>
        Sending formatted mail with NET::SMTP  ???? <yosefy@iil.intel.com>
    Re: Sending formatted mail with NET:SMTP  ????? <yosefy@iil.intel.com>
    Re: Sending formatted mail with NET:SMTP  ????? <jdporter@min.net>
        Site Map <curbano@ccg.uc.pt>
    Re: Site Map <tchrist@mox.perl.com>
    Re: substitution/expression (Quentin  Fennessy)
    Re: substitution/expression <tchrist@mox.perl.com>
    Re: syntax error <tchrist@mox.perl.com>
        Tainting behavior from 5.004 to 5.004_04 <lee@mbtuk.demon.co.uk>
        Text parsing brian.russo@nextel.com
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Bart Lateur)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Bart Lateur)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 11 Feb 1998 16:08:35 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: base64 -> GIF image ??
Message-Id: <6bsie3$26i$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Thomas Kowall <tkowall@edicom.ch> writes:
:is there anyone out there who knows how to reconstruct in PERL
:a GIF image from its base64 encoded file ?

You mean besides:

    % man perlfaq9
	...
	How do I decode a MIME/BASE64 string?

No, probably not.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

The only way to get rid of a temptation is to yield to it.
                -- Oscar Wilde


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

Date: 11 Feb 1998 16:24:03 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: cal (was: Year 2000 Compliance: Lawyers, Liars, and Perl)
Message-Id: <6bsjb3$ihd@news-central.tiac.net>

In article <34e3c523.9361032@news.tornado.be>,

>Is "cal" and related utilies even usable for that far back in time?
>There was a period of about 15 days skipped somewhere in the 1500's. 

[mike@stok mike]$ cal 9 1752
   September 1752
Su Mo Tu We Th Fr Sa 
       1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

>
>As far as friendly: giving a correct answer to a probably incorrect
>request isn't my idea of friendly.
>
>You could make "cal" only accept years in 4 (or more) digits, so that 98
>must be entered as 0098.

The man page on linux says:

     A single parameter specifies the year (1 - 9999) to be displayed; note
     the year must be fully specified: ``cal 89'' will not display a calendar
     for 1989.  Two parameters denote the month (1 - 12) and year.  If no pa-
     rameters are specified, the current month's calendar is displayed.

which seems reasonable.  Forcing people to enter 4 digits to specify a
single digit year is antisocial - this is a user tool designed to work
from the year 1 onwards so single digit years are reasonable input.

Internally cal sees to do the right thing with dates, externally it seems
to have a reasonable interface (and the interface is documented.)

(not much perl content there, sorry...)

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 11 Feb 1998 15:57:49 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: FAQless Forays (was: Code Example Needed)
Message-Id: <6bshpt$26i$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, mystra@torilmud.com (Eileen Kortright) writes:
:If the above sounds a little defensive, yah, it is, but as I stated, I
:just read 217 messages in this newsgroup -- most of which had, IMHO,
:very rude replies from Mr. Christiansen.

I can see how, read all in one sitting, those sixty-seven messages I
posted yesterday might have been perceived as such.  Permit me, if you
would, to explain the circumstances of their composition.

Recently, with little prior analysis beyond intuition, I tossed out
the flippant comment that this newsgroup would be a much more legible
place if we simply killfiled all postings coming from a PC (meaning Mac
or Windows).  After being challenged on this, I decide to analyse the
situation; I went back and read the leading posts (not the followups)
to most of the nonexpired threads on this group.

What you have read is the results of that futile foray.  The uncontended
winner for the most common sort of posting is without doubt those that
asked QUESTIONS ALREADY ANSWERED in the standard Perl FAQ.  The next most
common, somewhat down the list but still getting in the way, were those
postings unrelated to Perl, pertaining instead strictly to matters CGI.
Further investigation revealed a depressing but indisputable correlation:
nearly all such postings were written by someone using a PC (meaning Mac
or Windows) system, more often than not using a web browser with a lame,
patched-together USENET interface rather than a dedicated newsreader tool.

I'll tell you what: *you* go read a few hundred such repeated questions
from lazy and clueless people who refuse to avail themselves of the
hundreds of pages of free documentation included with every single Perl
distribution, work that you have personally devoted untold months of
your life to, and then then tell me whether you don't find yourself on
the brusque side.  I'll bet you would.

Most of the FAQ questions came from Prisoners of $Bill, and most of
the PoB postings were FAQs.  This is a culture clash in the extreme.
PC users are *not* exempt from doing their homework.  They are *not*
exempt from looking up the answers in the standard manpages and FAQs.
They are *not* exempt from writing a message whose formatting permits it
to be painlessly read.  They are *not* exempt from trimming down quoted
text.  They are *not* exempt from posting to the appropriate group.
In short, just because they're the victims of a technically challenged
system doesn't doesn't mean they can dispense with NETIQUETTE.

Let none who has not first searched the standard documentation (that
means the 5.004 release, whose complete manpages contain the complete
Perl FAQ, broken up in to nine distinct topic areas) post their question.

In short, the following killfile entries are entirely justified.

    /X-Newsreader:.*Win/h:j
    /X-Mailer:.*Win/h:j
    /X-Mailer:.*Microsoft/h:j
    /X-Newsreader:.*Microsoft/h:j
    /X-Newsreader:.*Agent/h:j

If they weren't so darned expensive, I'd use them.  Maybe I will anyway.

Then there's the matter of, "I'm not a programmer, but I need to program
this web page".  If you're not a programmer, don't try to program.
If you're not a surgeon, don't try to operate.  In both cases, you should
hire someone with the professional skillset and experience necessary for
the job.  If you won't do that, then you *are* a programmer whether for
income you pilot aircraft or sweep floors, and you will be held to the
same rigorous technical standards as any other programmer.

I have two secrets for you: the first is that programming is not as hard
as it's made out to be -- especially with Perl on your side.  The second,
however, is that it *is* a lot harder than it's made out to be.  You avoid
learning the ramifications of exponential algorithms at your own peril.
Or understanding why you can't write a program that can decide whether
another program will complete within a particular length of time --
or at all.  You cannot avoid issues of transactional integrity in a
multiprocessing system.  You must understand the difference between your
program, the standard library, and the kernel.  You must understand the
difference between an application and the operating system.  The four
or so layers of buffering -- both input and output, which are entirely
different -- will drive you mad until you learn them.  In Perl, implicit
context depedency and operator precedence are things you just have
to learn.  You cannot program without a good command of complex data
structures, or common algorithms.  And many, many, many other things.

Programming isn't nuclear physics, but neither is it basket weaving.
It's not for everyone.  Just because anyone can write a mail message in
one way implies that anyone can write a program, and anyone who said
otherwise has lied.  The notion of "internet == web == cgi == perl ==
easy enough for nonprogrammers" is a dangerous miscarriage of truth.
Become a programmer first.  Then do CGI.  Not the other way around.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    /* now make a new head in the exact same spot */
            --Larry Wall in cons.c from the perl source code


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

Date: Wed, 11 Feb 1998 12:09:02 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <linberg-1102981209020001@projdirc.literacy.upenn.edu>

In article <6bshpt$26i$1@csnews.cs.colorado.edu>, tchrist@mox.perl.com
(Tom Christiansen) wrote:

> Recently, with little prior analysis beyond intuition, I tossed out
> the flippant comment that this newsgroup would be a much more legible
> place if we simply killfiled all postings coming from a PC (meaning Mac
> or Windows).

First off, let me just say that I would regret very much being kf'd by you
(Tom) and the other luminaries on this group -- with whom I have enjoyed
challenging and enlightening communication -- simply because I'm composing
this note on my mac at work.  I would love to set up a linux box here, and
I'm working on it politically, but various Powers That Be are skeptical
for the moment.

Although I suspect many of the clueless in this ng (and elsewhere) are
micro PC users, there are exceptions.  And if you yourself happen to be
sitting at a mac someday (you never know) and drop a pearl of wisdom into
the group, I'd hate to miss it because I kf'd mac newsreaders!

> The uncontended
> winner for the most common sort of posting is without doubt those that
> asked QUESTIONS ALREADY ANSWERED in the standard Perl FAQ.

Yep, and this annoys everybody.  I understand your aggravation as the
author of much of it.

>  The next most
> common, somewhat down the list but still getting in the way, were those
> postings unrelated to Perl, pertaining instead strictly to matters CGI.

This is even worse, and I share your opinion that the whole "CGI in 21
days" approach is misleading and dangerous.  I've been programming for
almost 20 years, and I'm still learning about CGI.  Pretty comfortable
with the basics, but still learning cautiously.

> Further investigation revealed a depressing but indisputable correlation:
> nearly all such postings were written by someone using a PC (meaning Mac
> or Windows) system, more often than not using a web browser with a lame,
> patched-together USENET interface rather than a dedicated newsreader tool.

Well, this is depressing.  I wish it were otherwise, but I can't say I'm
entirely surprised.

> Then there's the matter of, "I'm not a programmer, but I need to program
> this web page".  If you're not a programmer, don't try to program.
> If you're not a surgeon, don't try to operate.  In both cases, you should
> hire someone with the professional skillset and experience necessary for
> the job.  If you won't do that, then you *are* a programmer whether for
> income you pilot aircraft or sweep floors, and you will be held to the
> same rigorous technical standards as any other programmer.

Here's where I slow down and fret a little.  Yes, I absolutely believe in
high and formal standards, and that people need to read more first and
resist the lazy way of tossing a FAQ into a busy newsgroup and hoping for
someone to solve their problem for them.

However, you also say:

> I have two secrets for you: the first is that programming is not as hard
> as it's made out to be -- especially with Perl on your side.  The second,
> however, is that it *is* a lot harder than it's made out to be.

I absolutely agree, with both points, but especially the second. 
Programming -- especially programming *well* -- is very difficult and not
learned quickly.  People learn in different ways.  I regret lacking some
of the formal academic programming background that many people in this
have, but I wouldn't give up for a second all those years of writing 6502
assembly language on Apple //s.  Or grappling with crufty Apple // C
compilers that took 20 minutes to compile a 7-line program (I'm not
exaggerating).  People get their learning in different ways, and I've
dealt with many university-trained programmers who knew their Knuth and
could pseudocode 8 different sorting algorithms off the top of their head,
but who were helpless when their compiler broke or the tools didn't work
or the server went down.

One of the main ways people learn is via Usenet, and we unfortunately have
the bootstrap problem of people being informed in newsgroups -- often by
short-tempered people, myself included, who grit their teeth at the 300th
FAQ of the day -- that there is a FAQ to read at all.  They don't know
there is one until they come in and get flamed for not reading it.

This problem is not going to go away anytime soon, I think.  Perhaps the
internet should never have been opened to commercial traffic, but there it
is.  We can't go back.

Here's a half-serious question: would there be any point to any of the
following:

comp.lang.perl.newbies
comp.lang.perl.CGI
comp.lang.perl.advanced

(that last, or something suitably scary-looking, as a place where, for
want of a better term, a "higher-level" FAQ-free discussion of Perl issues
could take place?)

I think it is a real problem that this ng is littered with so many FAQs
from misinformed or underinformed people.  I also think that all questions
are legitimite and deserve a forum.  If there were some way to tease them
apart, then I could Do The Right Thing by first venturing altruistically
into comp.lang.perl.newbies, answering a few FAQs (which don't make me mad
since I expect them there), then tune into comp.lang.perl.greybeards :)
and catch up on my own learning.

Kind regards,

Steve Linberg
NCAL Tech Monkey

P.S. I learn something new every day in this group.  I'm not kidding.  I
value it immensely.

-- 
Steve Linberg                  |    National Center on Adult Literacy
Systems Programmer etc.        |           University of Pennsylvania
linberg@literacy.upenn.edu     |        http://www.literacyonline.org


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

Date: 11 Feb 1998 16:59:06 GMT
From: burt@ici.net (Burt Lewis)
Subject: Finding the last line in a list?
Message-Id: <6bslcq$q0g$1@bashir.ici.net>

Hi,

Appreciate any help with this.

This is probably simple but I can't get it.

I have a text file that might look something like this:

1:apples:pears:peaches
2:pears:peaches:pears
3:peaches:apples:plums


I need to always be able to read the last line and grab the first field, in 
this case the 3.

tried this and many variations many times without luck:

open(READFILE, "/files/WWW/vhtdocs/eastonmass/database2/data.txt");
while (<READFILE>)
{
chop;
@fields = (split(/:/,$_,4));
}
$last = "$fields[0]";
$next = ++$last;
print "the last number is:$last";
print "the next number is:$next";
close(READFILE);

Burt Lewis



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

Date: Wed, 11 Feb 1998 10:49:29 -0600
From: Holly Sommer <SNIPhsommer@micro.ti.comSNIP>
Subject: Re: Hashes Usage
Message-Id: <34E1D699.5C2AEA4A@micro.ti.comSNIP>

Steve Linberg wrote:

: Well, just use the same structures, but substitute your variables for 
: the constants in the examples, right?  So instead of:

This works, AFAICS, if you are populating the hashes inside the code.
I'm still twisting my brain around how to read in the data from a file
which is going to be changed, external to the perl - how to dynamically
populate/expand a hash.

: The question is, do you really want a hash-of-hash structure?  If your
: records are of a regular structure, you probably want an array-of-hash
: structure, which is explained on p. 268-9.  I use these a lot when 
: dealing with SQL databases.

Hmm... this might be better suited. I'll have to fiddle with it to see.
Working directly with/around dBs is new to me too, at this level, so
it's sort of a matter of properly chewing up everything I've bitten off
so far :)

: I doubt anyone can give a clearer explanation of these data structures
: than you'll find in the book.  Type the examples in yourself and play 
: with them.  You'll get it.

Yup, I know how that goes - stare stare stare, fiddle fiddle fiddle...
eureka! :) 

I appreciate the feedback - hopefully it can serve as a catalyst, and
help me put the vernacular and concepts into "bytecode" which is native 
to my brain ;)

-Holly
--
My opinions do not necessarily reflect those of my employers.


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

Date: Wed, 11 Feb 1998 12:42:07 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Hashes Usage
Message-Id: <linberg-1102981242070001@projdirc.literacy.upenn.edu>

In article <34E1D699.5C2AEA4A@micro.ti.comSNIP>, Holly Sommer
<SNIPhsommer@micro.ti.comSNIP> wrote:

> Steve Linberg wrote:
> 
> : Well, just use the same structures, but substitute your variables for 
> : the constants in the examples, right?  So instead of:
> 
> This works, AFAICS, if you are populating the hashes inside the code.
> I'm still twisting my brain around how to read in the data from a file
> which is going to be changed, external to the perl - how to dynamically
> populate/expand a hash.

Well, you have to figure out how to get the data from your external
source, but once you do, the actual construction of the hash is easy. 
Saying:

$hsh{$key} = "foo!";

creates a new entry in %hsh with the key $key and the value "foo!".  So
that part is extremely simple.  Hope that's clear.

Oh, and be careful with arrays, if you're using them: saying $arr[10000] =
"blah" creates and allocates a 10,001 element array with "blah" as the
last element. 

> I appreciate the feedback - hopefully it can serve as a catalyst, and
> help me put the vernacular and concepts into "bytecode" which is native 
> to my brain ;)

That's how it goes.  Have fun.  :)

-- 
Steve Linberg                  |    National Center on Adult Literacy
Systems Programmer etc.        |           University of Pennsylvania
linberg@literacy.upenn.edu     |        http://www.literacyonline.org


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

Date: Wed, 11 Feb 1998 09:27:26 -0800
From: Hugh Williams <hughw@sr.hp.com>
Subject: how to properly interpret a '-?' command line option
Message-Id: <34E1DF7E.5407@sr.hp.com>

Hi;

I am using the Getopt::Std module to grab a number of command line
options; I'd like to be able to allow the user to type

	progname -?

and then return them a usage message.  I have tried a number of
different quoting mechanisms around the variable that Getopts:Std says
it creates:

	$opt_?
	$opt_\?
	${opt_?}
	'$opt_?'
	"$opt_?"

but I always get compilation errors.

What is a correct way to enable this module (and the whole script) to
accept and process a '-?' line option?

Thanks,

hugh

-- 

 Hugh Williams		"Without music, life would be a mistake."
 hughw@sr.hp.com		- Neitzsche
 Hewlett Packard Co.	"Research is what I'm doing when I don't
 Santa Rosa M2S-K 	  know what I'm doing."
 (707)-577-4941			- Wernher von Braun


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

Date: Wed, 11 Feb 1998 10:52:39 +0200
From: Bekman Stanislav <sbekman@iil.intel.com>
Subject: Re: How to receive the output of a file upload form?
Message-Id: <34E166D7.15FB@iil.intel.com>

> You know that INPUT TYPE=file. What is the quickest and simplest way
> to manage the output with a perl script?

use CGI.pm module 
perldoc CGI

<QUOTE>
    When the form is processed, you can retrieve the entered
          filename by calling param().
                 $filename = $query->param('uploaded_file');
  # Copy a binary file to somewhere safe
                  open (OUTFILE,">>/usr/local/web/users/feedback");
                  while ($bytesread=read($filename,$buffer,1024)) {
                     print OUTFILE $buffer;
                  }


</QUOTE>


______________________________________________________________________
Stas Bekman     mailto:sbekman@iil.intel.com [just another webmaster]
Home Page:      http://www.eprotect.com/stas
A must visit: 	http://www.eprotect.com/stas/TULARC (Java,CGI,PC,Linux)
Linux-il Home:  http://www.linux.org.il/


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

Date: 11 Feb 1998 09:27:54 -0600
From: Yusuf Pisan <y-pisan@nwu.edu>
Subject: Re: HTTP::Request -- Using POST to cgi forms
Message-Id: <wkhg66b1qd.fsf@nwu.edu>




martin@RADIOGAGA.HARZ.DE (Martin Vorlaender) writes:

> Shall we read the POD? Shall we?
> ...
> Have a look at the LWP cookbook, lwpcook.pod, on how to POST.
> ...
>   Martin

Thank you for redirecting me to lwpcook which had the right example so
I could fix my program.

The corrected version is as follows (for those other souls who might
also be digging through the wrong set of documentation)

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

#!/usr/local/bin/perl5
 
# Dejanews message-id search form is at http://www.dejanews.com/forms/mid.shtml
# The form gets posted to http://search.dejanews.com/msgid.xp
 
$post = 'http://search.dejanews.com/msgid.xp';
$message_id = '<199801302242.QAA04201@relay.acns.nwu.edu>';
 
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
 
$ua = new LWP::UserAgent;
 
my $req = POST $post,
    [ MID  => $message_id,
     ST => '',
     AH => '1'
     ];
 
 
print $ua->request($req)->as_string;


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

Date: 11 Feb 1998 16:07:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: keyboard input in BLIND MODE
Message-Id: <6bsibt$26i$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Pascal AMRAM <pascal_amram@ml.com> writes:
:I would like into a command prompt window under NT enter a password but
:i don't want to see my password on the screen !

What's a "command prompt window"?  How does this differ from processing
STDIN and STDOUT normally?  Did you read what perlfaq8 says regarding
echo-free keyboard input under POSIX?  Do you have a POSIX system?
Did you read the POSIX manpage?  Did you read the standard Perl FAQ?
Did you read the Perl Win32 FAQ?  Do you know how to do what you're
asking at the C level?  Do you know the ioctls involved?  Do you know
what an ioctl is?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
When I was a boy I was told that anybody could become President.  Now
I'm beginning to believe it.
                --Clarence Darrow


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

Date: Wed, 11 Feb 1998 17:11:01 +0000
From: David Rawle <davidraw@bigfoot.com>
Subject: Perl 32 5.003_07 and NT 4.0 Server Problem
Message-Id: <34E1DBA5.90055DC7@bigfoot.com>

I have Perl 32 5.003_07, NT 4.0 Server (SP3), Netscape Enterprise Server
v.3, Netscape Navigator 4.04.

I have inherited a Perl script and I need it to run on my server.  It
produces the following error message...

[11/Feb/1998:16:41:41] failure: for host 200.0.0.10 trying to POST
/shell-cgi/file-upload.pl, cgi-parse-output reports: the CGI program
C:\PERL\bin\perl.exe did not produce a valid header (program terminated
without a valid CGI header (check for core dump or other abnormal
termination)

I have no idea what this means. Nothing core dumps or abnormally
terminates (as far as NT is aware).  Simple cgi scripts work okay.  The
cgi script that gives the message is used to upload files to the server.



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

Date: Wed, 11 Feb 1998 12:29:44 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Perl 32 5.003_07 and NT 4.0 Server Problem
Message-Id: <linberg-1102981229440001@projdirc.literacy.upenn.edu>

In article <34E1DBA5.90055DC7@bigfoot.com>, David Rawle
<davidraw@bigfoot.com> wrote:

> I have Perl 32 5.003_07, NT 4.0 Server (SP3), Netscape Enterprise Server
> v.3, Netscape Navigator 4.04.
> 
> I have inherited a Perl script and I need it to run on my server.  It
> produces the following error message...
> 
> [11/Feb/1998:16:41:41] failure: for host 200.0.0.10 trying to POST
> /shell-cgi/file-upload.pl, cgi-parse-output reports: the CGI program
> C:\PERL\bin\perl.exe did not produce a valid header (program terminated
> without a valid CGI header (check for core dump or other abnormal
> termination)

Others will point out that this is a CGI question, not (necessarily) Perl.

> I have no idea what this means. Nothing core dumps or abnormally
> terminates (as far as NT is aware).  Simple cgi scripts work okay.  The
> cgi script that gives the message is used to upload files to the server.

You'll have to post source if you want specific help, but in my experience
it's usually one of the following:

1) A syntax error in your script, or something else that causes
compilation to stop.  Are you using strict?  -w?

2) You forgot to output "Content-type: text/html\n\n" (assuming this is
what you intend) so the web server knows it's a web page that's being
hurled at it.

-- 
Steve Linberg                  |    National Center on Adult Literacy
Systems Programmer etc.        |           University of Pennsylvania
linberg@literacy.upenn.edu     |        http://www.literacyonline.org


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

Date: Wed, 11 Feb 1998 11:37:34 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: intervisors@nospam.intervisors.nl
Subject: Re: Perl HTML output in Win 95
Message-Id: <34E1E1DE.42821B23@mail.uca.edu>

This is not a perl question. You have not configured your server
correctly for CGI using perl (or at all). 

BTW, cute email address, interesting tactic, trying to foil the spammers
by putting in a fake anti-spam message.

Cameron Dorey
camerond@mail.uca.edu

InterVisors <intervisors@nospam.intervisors.nl> wrote:
> 
> Hi there,
> 
> Perl works fine from a dos prompt.
> 
> Unfortunatly when I run a local perl script from a local html page the
> HTML source code flashes by in a dos box but doesnt get ported to
> Netscape, the browser from which the perl script was launched in the
> first place.


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

Date: Wed, 11 Feb 1998 07:45:26 -0800
From: Todd Hoff <tmh@possibility.com>
Subject: Re: perl5.003 and now CGI won't work
Message-Id: <34E1C796.47DF83D7@possibility.com>

Chipmunk wrote:
> 
> Rod Bush wrote:
> >
> > I just installed the latest version of wwwstat on my Linux based Apache
> > web server. An upgrade to perl5.003 came with it. Now none of my cgi
> > scripts are working.
> 
> How are they not working?  Try
> 
> perl -cw script.cgi
> 
> from the command line and see what useful error messages you get.
> 
> Chipmunk

Good idea. It could be a new warning message is being printed
before the content header is going out.

------------------------------------------------------------------
      tmh@possibility.com   http://www.possibility.com/Tmh
I have no interest in any ship that does not sail fast, for I 
plan to go in harm's way. -- J.P. Jones


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

Date: 11 Feb 1998 16:18:19 GMT
From: david alan henke <henke@students.uiuc.edu>
Subject: Redirecting output with back-ticks from tar
Message-Id: <6bsj0b$khq$1@vixen.cso.uiuc.edu>

When executing the following command:

     $output=qx{ rsh hostname 'tar cfz hostname:/foo/bar/file.tar.gz
                 /foo2/bar2' 2>&1 };

the following error occurs:

     sh: unexpected EOF while looking for ``'
     sh: -c: line 12: syntax error

I believe this is because the output of the tar command includes:

     tar: Removing leading `/' from absolute path names in the archive

I believe the shell is getting confused because of the single back-tick.
I get this error whenever I try to redirect STDERR and STDOUT to either
a file or to a string.  If I use a relative path instead of absolute
path for the directory to be tar'd, then everything proceeds fine since
I don't get the above message.  However, I don't like this solution,
since the files in the archive then have relative path names
(i.e. '../../foo2/bar2').

Does anyone have any suggestions as to how to capture any messages which
include a single back-tick?

David Henke


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

Date: 11 Feb 1998 17:05:49 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Redirecting output with back-ticks from tar
Message-Id: <6bslpd$5hs$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, david alan henke <henke@students.uiuc.edu> writes:
:When executing the following command:
:     $output=qx{ rsh hostname 'tar cfz hostname:/foo/bar/file.tar.gz
:                 /foo2/bar2' 2>&1 };
:
:the following error occurs:
:     sh: unexpected EOF while looking for ``'
:     sh: -c: line 12: syntax error
:
:I believe this is because the output of the tar command includes:
:     tar: Removing leading `/' from absolute path names in the archive

Actually, my guess is instead that it's the newline in the remote
command string.  What happens when you put this all on the same line?

$output=qx{ rsh hostname 'tar cfz hostname:/foo/bar/file.tar.gz /foo2/bar2' 2>&1 };

Also, did you know that $? won't be set to the tar status when launched
via rsh?  If that's a problem, use ersh, or a more recent version if
Maartin has one.

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1998-02-11 10:04 MST by <tchrist@jhereg.perl.com>.
# Source directory was `/home/tchrist/scripts'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
# This format requires very little intelligence at unshar time.
# "if test", "echo", "mkdir", and "sed" may be needed.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   1056 -rwxr-xr-x ersh
#
echo=echo
if mkdir _sh22651; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= ersh ==============
if test -f 'ersh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'ersh' '(file already exists)'
else
shar: Saving ersh (text)
  $echo 'x -' extracting 'ersh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'ersh' &&
X#!/bin/sh
X# @(#)ersh 2.4 91/01/30 Maarten Litmaath
X# This rsh front-end returns the exit status of the remote command.
X# It works OK with sh/csh-compatible shells on the remote (!) side.
X# If there is no remote command present, /usr/ucb/rlogin is invoked.
X# Usage: see rsh(1).
X
X#unset hostname lflag nflag user
X# convex is too dumb to know unset
Xhostname= 
Xlflag=
Xnflag=
Xuser=
X
Xcase $1 in
X-l)
X	;;
X*)
X	hostname=$1
X	shift
Xesac
X
Xcase $1 in
X-l)
X	lflag=-l
X	user=$2
X	shift 2
Xesac
X
Xcase $1 in
X-n)
X	nflag=-n
X	shift
Xesac
X
Xcase $hostname in
X'')
X	hostname=$1
X	shift
Xesac
X
Xcase $# in
X0)
X	exec /usr/ucb/rlogin $lflag ${user+"$user"} "$hostname"
Xesac
X
XAWK='
X	NR > 1 {
X		print prev;
X		prev = $0;
X		prev1 = $1;
X		prev2 = $2;
X	}
X	NR == 1 {
X		prev = $0;
X		prev1 = $1;
X		prev2 = $2;
X	}
X	END {
X		if (prev1 ~ /[0-9]*[0-9]0/)
X			exit(prev1 / 10);
X		if (prev1 == "0")
X			exit(prev2);
X		print prev;
X		exit(1);
X	}
X'
X
Xexec 3>&1
X
X/usr/ucb/rsh "$hostname" $lflag ${user+"$user"} $nflag \
X	"(${*-:}); sh -c '"'echo "$0 $1" >&2'\'' $?0 "$status"' \
X	2>&1 >&3 3>&- | awk "$AWK" >&2 3>&-
SHAR_EOF
  : || $echo 'restore of' 'ersh' 'failed'
fi
rm -fr _sh22651
exit 0

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    I don't believe it's written in Perl, though it probably
    ought to have been.  :-)
	--Larry Wall in <1995Feb21.180249.25507@netlabs.com>


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

Date: 11 Feb 1998 17:23:09 GMT
From: david alan henke <henke@students.uiuc.edu>
Subject: Re: Redirecting output with back-ticks from tar
Message-Id: <6bsmpt$np4$1@vixen.cso.uiuc.edu>

Tom Christiansen <tchrist@mox.perl.com> wrote:
:  [courtesy cc of this posting sent to cited author via email]

: In comp.lang.perl.misc, david alan henke <henke@students.uiuc.edu> writes:
: :When executing the following command:
: :     $output=qx{ rsh hostname 'tar cfz hostname:/foo/bar/file.tar.gz
: :                 /foo2/bar2' 2>&1 };
: :
: :the following error occurs:
: :     sh: unexpected EOF while looking for ``'
: :     sh: -c: line 12: syntax error
: :
: :I believe this is because the output of the tar command includes:
: :     tar: Removing leading `/' from absolute path names in the archive

: Actually, my guess is instead that it's the newline in the remote
: command string.  What happens when you put this all on the same line?

: $output=qx{ rsh hostname 'tar cfz hostname:/foo/bar/file.tar.gz /foo2/bar2' 2>&1 };

This is exactly what the command actually looks like.  There is no newline
in the actual command.  I just broke it up in my post so it would format
nicely.  My mistake.

: Also, did you know that $? won't be set to the tar status when launched
: via rsh?  If that's a problem, use ersh, or a more recent version if
: Maartin has one.

I was not aware of that.  That is good information to know.  Thanks for the
advice.

David Henke


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

Date: Wed, 11 Feb 1998 08:44:57 -0800
From: Jerome O'Neil <joneil@cks.ssd.k12.wa.us>
To: Bart Lateur <bart.mediamind@tornado.be>
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <34E1D589.1953792B@cks.ssd.k12.wa.us>

Bart Lateur wrote:

> Tom Christiansen <tchrist@mox.perl.com> wrote:
>
> >In comp.lang.perl.misc, palincss@nicom.com writes:
> > Why, oh why has Matt not done that yet?
> >
> >Bad programmer, or evil.  Take your pick.
>
> Bad? No. Somebody who can build a project like this, all on his own,
> isn't a bad programmer. Merely a sloppy one.

I think he's just a kid.  Mahaps a sloppy, evil, bad programmer kid?

Jerome "The Follies Of Youth" O'Neil



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

Date: Wed, 11 Feb 1998 11:14:34 +0200
From: yuval yosef <yosefy@iil.intel.com>
Subject: Sending formatted mail with NET::SMTP  ????
Message-Id: <34E16BFA.63B94BBF@iil.intel.com>

Perli's Hello!

Is some here has know if the next code is valid, I'd like to use it as
SENDMAIL on WinNT


    format MAILFORMAT =
                             Mail Request Form

    Last:          @<<<<<<<<<<<<<<<<<<<First: ^<<<<<<<<<<<<<
                   $FORM{'LastName'},        $FORM{'FirstName'}
    Email Address: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                       $FORM{'Email'},
    .

    $~ = "MAILFORMAT" ;

    $mailhost = "mail.host.name" ;
    use Net::SMTP;
    $smtp = Net::SMTP->new($mailhost ) ;
    print "SMTP RETURN VAL: $smtp\n" ;
    #print "HOSTNAME: $mailhost\n" ;
    $smtp->help ;
    $smtp->mail('$Email');  #Sender address
    $smtp->to('$address@actil.com');
    $smtp->data();
    $smtp->datasend(write);   #write the formatted text
    $smtp->dataend();
    $smtp->quit;

Thanks,

                    Yuval



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

Date: Wed, 11 Feb 1998 11:16:40 +0200
From: yuval yosef <yosefy@iil.intel.com>
To: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: Sending formatted mail with NET:SMTP  ?????
Message-Id: <34E16C77.1B076C2E@iil.intel.com>

My apologize, in future only plain text!!

                    Yuval

Martien Verbruggen wrote:

> [Newsgroups: comp.lang.perl.misc,yosefy@iil.intel.com]
>
> Since when is your email addrss a newsgroup? And your newsreader and
> news server let you get away with this?
>
> In article <34E092AC.7EF2AEC9@iil.intel.com>,
>         yuval yosef <yosefy@iil.intel.com> writes:
>
> > --------------8B8B137A5E0292487F2175C2
> > Content-Type: text/html; charset=us-ascii
> > Content-Transfer-Encoding: 7bit
> >
> > <HTML>
>
> Don't do this, please. Usenet is a plain text medium, HTML is for the
> web. Reconfigure your excuse for a newsreader, please.
>
> Martien
> --
> Martien Verbruggen                  |
> Webmaster www.tradingpost.com.au    | For heaven's sake, don't TRY to be
> Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
> NSW, Australia                      | cynical.





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

Date: Wed, 11 Feb 1998 11:56:14 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Sending formatted mail with NET:SMTP  ?????
Message-Id: <34E1D82E.4787@min.net>

yuval yosef wrote:
> 
>     format MAILFORMAT =
>                              Mail Request Form
> 
>     Last:          @<<<<<<<<<<<<<<<<<<<First: ^<<<<<<<<<<<<<
>                    $FORM{'LastName'},        $FORM{'FirstName'}
>     Email Address: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>                        $FORM{'Email'},
>     .
> 
>     $~ = "MAILFORMAT" ;
> 
>     $mailhost = "mail.host.name" ;
>     use Net::SMTP;
>     $smtp = Net::SMTP->new($mailhost ) ;
>     print "SMTP RETURN VAL: $smtp\n" ;
>     #print "HOSTNAME: $mailhost\n" ;

>     $smtp->help ;

You may as well delete this line; you don't do anything with it.


>     $smtp->mail('$Email');  #Sender address
>     $smtp->to('$address@actil.com');

These single-quotes are way wrong!  Try this:

	$smtp->mail( $Email );  #Sender address
	$smtp->to( $address . '@actil.com' );

>     $smtp->data();
>     $smtp->datasend( write );  #write the formatted text
>     $smtp->dataend();
>     $smtp->quit;

This use of write won't work.
Also, you don't need to use both data() and datasend().

Try this:

$formline1 = <<'LINE1';
    Last:          @<<<<<<<<<<<<<<<<<<<First: ^<<<<<<<<<<<<<
LINE1
$formline2 = <<'LINE2';
    Email Address: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
LINE2

$smtp->data( join( "\n\n",
  '                             Mail Request Form',
  swrite( $formline1, $FORM{'LastName'}, $FORM{'FirstName'} ),
  swrite( $formline2, $FORM{'Email'} )
) );
$smtp->quit;

You must supply swrite(), as in the Camel book, p.127:

sub swrite {
  $^A = '';
  formline( @_ );
  $^A;
}

But as always in per, TIMTOWTDI.

hth,
John Porter


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

Date: Wed, 11 Feb 1998 16:24:45 +0000
From: Carlos Urbano <curbano@ccg.uc.pt>
Subject: Site Map
Message-Id: <34E1D0CC.EBF109E9@ccg.uc.pt>

Hi!

Do you know any script or module that construct a SITE MAP?

TIA

Urbano




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

Date: 11 Feb 1998 17:12:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Site Map
Message-Id: <6bsm6g$5hs$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Carlos Urbano <curbano@ccg.uc.pt> writes:
:Do you know any script or module that construct a SITE MAP?

Interesting question, and in fact, one I am myself curious about.
BTW, you might try these other newsgroups, which are more directed
toward that topic area:

    comp.infosystems.www
	The World Wide Web information system.
    comp.infosystems.www.advocacy
	Comments and arguments over the best and worst.
    comp.infosystems.www.announce
	World-Wide Web announcements. 
    comp.infosystems.www.authoring.cgi
	Writing CGI scripts for the Web.
    comp.infosystems.www.authoring.html
	Writing HTML for the Web.
    comp.infosystems.www.authoring.images
	Using images, imagemaps on the Web.
    comp.infosystems.www.authoring.misc
	Miscellaneous Web authoring issues.
    comp.infosystems.www.browsers.mac
	Web browsers for the Macintosh platform.
    comp.infosystems.www.browsers.misc
	Web browsers for other platforms.
    comp.infosystems.www.browsers.ms-windows
	Web browsers for MS Windows.
    comp.infosystems.www.browsers.x
	Web browsers for the X-Window system.
    comp.infosystems.www.misc
	Miscellaneous World Wide Web discussion.
    comp.infosystems.www.providers
	WWW provider issues (info providers).
    comp.infosystems.www.servers.mac
	Web servers for the Macintosh platform.
    comp.infosystems.www.servers.misc
	Web servers for other platforms.
    comp.infosystems.www.servers.ms-windows
	Web servers for MS Windows and NT.
    comp.infosystems.www.servers.unix
	Web servers for UNIX platforms.
    comp.infosystems.www.users
	WWW user issues (Mosaic, Lynx, etc).

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
     "... an initial underscore already conveys strong feelings of
      magicalness to a C programmer."
	--Larry Wall in <1992Nov9.195250.23584@netlabs.com>


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

Date: 11 Feb 1998 16:19:41 GMT
From: quentin@remington.amd.com (Quentin  Fennessy)
Subject: Re: substitution/expression
Message-Id: <6bsj2t$7mr$1@amdint2.amd.com>
Keywords: perl compile time performance

Tom Christiansen <tchrist@mox.perl.com> writes:
[...]
> 
> "time make clean test" took about 90 seconds last time I tried. :-)

OK - A silly challenge -- So I tried a 'time make clean test' on a
SunOS 5.5.1 UltraSPARC 2/300 system, building on local disk.  Gcc came
from an NFS mounted file system.  I had already run Configure 
(sh Configure -des -Dcc=gcc).

And here is what I got (at the end):

    [...]
    All tests successful.
    u=0.28  s=0.37  cu=16.5  cs=7.9  scripts=153  tests=4857

    real    3m28.550s
    user    1m33.680s
    sys     0m23.120s

On what system can you build perl in 90 seconds?

Perl build time is not important for me -- but system performance is.
What is your secret?

-- 
Quentin Fennessy			AMD, Austin Texas


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

Date: 11 Feb 1998 16:56:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: substitution/expression
Message-Id: <6bsl7d$5hs$1@csnews.cs.colorado.edu>
Keywords: perl compile time performance

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, quentin@remington.amd.com (Quentin  Fennessy) writes:
:    u=0.28  s=0.37  cu=16.5  cs=7.9  scripts=153  tests=4857
:
:    real    3m28.550s
:    user    1m33.680s
:    sys     0m23.120s
:
:On what system can you build perl in 90 seconds?

On mine. :-)  Here's "time make test", after a make test.

    u=0.26  s=0.18  cu=17.46  cs=5.24  scripts=152  tests=4839
    103.190u 12.610s 2:11.76 87.8%  0+0k 0+0io 250305pf+0w

Specs follow:

	Chip: 	  Pentium-II
	Speed:	  300 Mhz
	Memory:   128Mb fast RAM
	Cache: 	  512k 
	Kernel:   Linux 2.0.33
	Compiler: gcc 2.7.2.3
	Perl: 	  5.004_04

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    The computing field is always in need of new cliches.  -- Alan Perlis


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

Date: 11 Feb 1998 16:13:02 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: syntax error
Message-Id: <6bsime$26i$4@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

Hiding behind an obfuscated address herein decrypted for all the world
to grep and spam, gbraden@visi.net (G Braden) used WinVN 0.99.9 (Released
Version) (x86 32bit) to write in comp.lang.perl.misc:

:'ash: syntax error near unexpected token `"POST")
:'ash: ./phoneb.cgi: line 18: `if ($ENV{'REQUEST_METHOD'} eq "POST")

That's a shell error.  Not a perl error.

:if ($ENV{'REQUEST_METHOD'} eq "POST")
:{
:	read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

This code is wrong.  wrong wrong wrong wrong wrong wrong wrong.
Stop coding it by hand.  You've done it wrong.  Find whoever told you
to code that, and kill them.  Use CGI.pm.

    The Idiot's Guide to solving Perl/CGI problems 
        http://www.perl.com/perl/faq/idiots-guide.html

    Perl FAQs
        http://www.perl.com/CPAN/doc/FAQs/

    Perl Manpages (old)
        http://www.perl.com/CPAN/doc/manual/html/

    CGI FAQ
        http://www.webthing.com/page.cgi/cgifaq

    WWW Security FAQ
        www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html

    Web FAQ
        http://www.boutell.com/faq/

    HTTP Spec
        http://www.w3.org/pub/WWW/Protocols/HTTP/

    HTML Spec
        http://www.w3.org/pub/WWW/MarkUp/

    CGI Spec
        http://hoohoo.ncsa.uiuc.edu/cgi/interface.html

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

	    Finally, which rhymes with enough --
	    Though, through, plough, or dough, or cough?


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

Date: Wed, 11 Feb 1998 17:18:35 +0000
From: Lee Shakespeare <lee@mbtuk.demon.co.uk>
Subject: Tainting behavior from 5.004 to 5.004_04
Message-Id: <34E1DD6B.4C803293@mbtuk.demon.co.uk>

Hi Folks.

I've just encountered a tainting problem when moving a set of scripts
from machine to another.  The code to untaint the variable would run
fine on the one machine, running Perl 5.004, but failed on the other
machine running 5.004_04.  I've checked the change log and haven't
spotted anything which would have caused the behavior.

The offending code and regular expression : 

            if ($var =~ /^([-\@\w.]+)$/) {
                $var = $1;
            }

Both machines were Linux boxes, one running kernel 2.0.29, the other
2.0.33.  To solve the problem I down-graded the Perl version on the
second machine.  Am I doing anything wrong here?  

Regards,
 Lee.


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

Date: Wed, 11 Feb 1998 11:02:37 -0600
From: brian.russo@nextel.com
Subject: Text parsing
Message-Id: <887215449.44433418@dejanews.com>

Hello. I am attempting to write a perl script to read a log file (from
a Nortel Switch) and parse out a couple different pieces of data. The
log file is formatted in such a way that the headers and the data are
seperated. For example:

C7SCCP	C7RTFALL  C7RTFNTN  C7RTFNTA  C7RTFNWF	C7RTFNWC  C7RTFSS 
C7RTFSSC  C7RTFUEQ  C7UDTTX  C7UDTTX2  C7UDTRX	C7UDTRX  C7UDTSTX 
C7UDTSRX  C7MSGHDL  C7MSGHD2  C7MSGGT  C7MSGGT	C7CLS0TX  C7CLS0T2 
C7CLS0RX  C7CLS0R2  C7CLS1TX  C7CLS1T  C7CLS1RX  C7CLS1R2  C7SYNERR 
C7RTBKSS  C7LOCSS  C7LOCSS

    0
	       24          0          2          0          0         2
               0           0       6531          0       2101         0
               1451        0      53540          0       1407         0
               5928        0        669          0        603         0
               1432        0          0          0      45532         0

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

So, my problem is, how can I parse the file and search for the begining
of these stats and then save the numeric data in an array? These values
exist in the log file 48 (every 30 minutes for 24 hours) seperate times
and I would like to print out the results.

Any help would be greatly appreciated,

-Brian

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Wed, 11 Feb 1998 15:48:47 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34e3c523.9361032@news.tornado.be>

Derek Balling <dballing@speedchoice.com> wrote:

>Bart Lateur wrote:
>
>> My solution would be to make the software less tolerant. For instance,
>> "cal" could simply reject a two digit year.
>
>That's not very friendly. What would be more friendly is to display the
>year
>using printf "%4d",$year, so that it shows as "February 0098" to
>emphasize to the user that they're looking far in the past. It's
>entirely possible someone would WANT to see a calendar from that far
>back, so its best to allow them to do so.

Is "cal" and related utilies even usable for that far back in time?
There was a period of about 15 days skipped somewhere in the 1500's. 

As far as friendly: giving a correct answer to a probably incorrect
request isn't my idea of friendly.

You could make "cal" only accept years in 4 (or more) digits, so that 98
must be entered as 0098.

    Bart.
-
        'D*mn!', said Carrot, a difficult linguistic feat.
           -- Terry Pratchett, "Feet of Clay"


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

Date: Wed, 11 Feb 1998 15:48:51 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34e4c613.9600835@news.tornado.be>

phenix@interpath.com (John Moreno) wrote:

>In comp.lang.perl.misc Bart Lateur <bart.mediamind@tornado.be> wrote:

>> Whenever one of your programs gets some
>> user input that is supposed to be a year, in a GUI, and it consists of
>> just two digits, then pop up a messagebox:
>> 
>>   Excuse me, is that 1915 or 2015?
>> 
>> Doubts resolved.

>Why?  It's a convient short hand that people can understand perfectly
>well and that computers (with a little work) can understand reasonably.
>Accept a 2 or 4 digit input and if it's a 2 digit and then use some
>logic to try to figure it out - 99.99% of the time it's going to be in
>the same decade at least, hell at least half the time it's probably
>going to be THIS year.  Computers should be able to handle this without
>excessive user input.

That's just what Tom wrote about. People can figure it out most of the
time, but a it depends on the context. Computers are poor at
interpreting context.

When there is sufficient doubt whether a guess is correct, the computer
SHOULD ask if it is correct, especially if people's pensions depend on
it. Having to click a button (or press <enter>) for confirmation isn't
that bad, compared to the hassle people would have to go through to let
the government correct such a "computer mistake".

	Bart.


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1859
**************************************

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