[16149] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3561 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 10 16:12:50 2000

Date: Mon, 10 Jul 2000 13:12:37 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963259957-v9-i3561@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 10 Jul 2000     Volume: 9 Number: 3561

Today's topics:
        Delayed HTML Output in PERL marc@bookmarc.com
    Re: Delayed HTML Output in PERL (Jerome O'Neil)
    Re: Delayed HTML Output in PERL (Scott Roberts)
    Re: Delayed HTML Output in PERL (Abigail)
    Re: Delayed HTML Output in PERL <s0218327@unix1.cc.ysu.edu>
    Re: Delayed HTML Output in PERL (Malcolm Dew-Jones)
    Re: Delayed HTML Output in PERL (Randal L. Schwartz)
    Re: Delayed HTML Output in PERL (Malcolm Dew-Jones)
    Re: Delayed HTML Output in PERL <todd@mrnoitall.com>
    Re: Delayed HTML Output in PERL (Michel Dalle)
    Re: Delayed HTML Output in PERL (Peter J Scott)
    Re: Delayed HTML Output in PERL (Malcolm Dew-Jones)
    Re: Delayed HTML Output in PERL <sariq@texas.net>
    Re: Delayed HTML Output in PERL (brian d foy)
    Re: Delayed HTML Output in PERL <flavell@mail.cern.ch>
    Re: Delayed HTML Output in PERL (Peter J Scott)
    Re: Delayed HTML Output in PERL <flavell@mail.cern.ch>
    Re: delete array (M.J.T. Guy)
    Re: delete array (M.J.T. Guy)
        Deleting lines that match a pattern anuragmenon@my-deja.com
    Re: Deleting lines that match a pattern <bwalton@rochester.rr.com>
    Re: Deleting lines that match a pattern (Tad McClellan)
        Deleting records form database <Treku@w.pl>
    Re: Deleting records form database <bwalton@rochester.rr.com>
    Re: Deleting records form database <alan@rose-it.co.uk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 03 Jul 2000 19:01:09 -0700
From: marc@bookmarc.com
Subject: Delayed HTML Output in PERL
Message-Id: <39614564.8A25B068@bookmarc.com>


I have a PERL  program that I wrote which is slow to output a html data
file to the screen.  I would like to print a warning that it may take
time so the user does not give up on the output and surf the web
elsewhere..  However, The html page does not print until it has the
entire output in the buffer.  So the user does not see the gentle
warning that he/she may have to wait a couple of minutes before the
output is delivered to his browser.

Does anyone have a straight forward trick to printing out part of a page
to an html browser before the entire output is ready to be printed?

-Marc



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

Date: Tue, 04 Jul 2000 02:17:44 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <cPb85.495$_x3.295796@news.uswest.net>

marc@bookmarc.com elucidates:

> Does anyone have a straight forward trick to printing out part of a page
> to an html browser before the entire output is ready to be printed?

There is no %100 guaranteed way to do this.  You can turn on autoflushing
for Perl ($| = 1),  but if your web server buffers the output,  you'll have
to read the docs on your webserver to figure out how to turn it off.

Good Luck!


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

Date: Tue, 04 Jul 2000 02:11:54 GMT
From: scottr@mindspring.com (Scott Roberts)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <3961433e.13008094@news.mindspring.com>

Hi.  Newbie here. Can't 
BEGIN {  print "Content-type:text/html\n\n <html>blah blah";  } 
be used ?
How can I get warnings printed to the browser?
Why do books not show us
use CGI::Carp qw( fatalsToBrowser carpout);
somewhere early in the game?  You wouldn't believe how much time I
wasted not knowing that one. My host provider (olm.net) wouldn't  tell
me where the error logs are.   Otherwise they're great.  




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

Date: 04 Jul 2000 00:10:34 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <slrn8m2pvg.59a.abigail@alexandra.delanet.com>

marc@bookmarc.com (marc@bookmarc.com) wrote on MMCDXCIX September
MCMXCIII in <URL:news:39614564.8A25B068@bookmarc.com>:
^^ 
^^ I have a PERL  program that I wrote which is slow to output a html data
^^ file to the screen.  I would like to print a warning that it may take
^^ time so the user does not give up on the output and surf the web
^^ elsewhere..  However, The html page does not print until it has the
^^ entire output in the buffer.  So the user does not see the gentle
^^ warning that he/she may have to wait a couple of minutes before the
^^ output is delivered to his browser.
^^ 
^^ Does anyone have a straight forward trick to printing out part of a page
^^ to an html browser before the entire output is ready to be printed?

Yes, there's one trick and that's to take the user, drag him or her over
and actually read the file to them.

There are many points in the chain from your program to the users browser
that all can do their own buffering. You can turn off buffering of
STDOUT in your program (see man perlvar), but then there's the server
than can do buffering, the outgoing proxy, the users incoming proxy,
the users filter, and last, but not least, the users browser.  They can
all buffer. You cannot stop it.

BTW, the language is called Perl. Just one capital. Not four.


Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
Just another Perl Hacker
EOT


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

Date: Thu, 6 Jul 2000 01:57:44 -0400
From: NagaPutih <s0218327@unix1.cc.ysu.edu>
Subject: Re: Delayed HTML Output in PERL
Message-Id: <Pine.A41.4.20.0007060121470.24822-100000@unix1.cc.ysu.edu>

On Mon, 3 Jul 2000 marc@bookmarc.com wrote:
> I have a PERL  program that I wrote which is slow to output a html data
> file to the screen.  I would like to print a warning that it may take
> time so the user does not give up on the output and surf the web
> elsewhere..  However, The html page does not print until it has the
> entire output in the buffer.  So the user does not see the gentle
> warning that he/she may have to wait a couple of minutes before the
> output is delivered to his browser.
> 
> Does anyone have a straight forward trick to printing out part of a page
> to an html browser before the entire output is ready to be printed?

true that this isn't a perl question, but let me try to answer.

1) taking advantage of tables that tend to display their contents only
when the whole contents are loaded, put the desired output inside a simple
table and put your warning message *outside and before* the table.

but this doesn't always work, and it rather depends on the connection
and the browser, too.


2) this idea assumes that you're using a 2-row frameset consisting of
frames (let's call them TOP and MAIN).

provide a javascript function to display your warning message
(document.write() function). when you're submitting input to or
calling the script, execute the function above (into TOP frame)
and direct your script output into MAIN frame.

the last step is removing the earlier warning message. this is done by
your script output. provide it with a javascript function similar to the
one i mentioned above but with the another content/message (may be your
website header?), and execute it onLoad.

note: make sure the javascript functions return true


3) server push, may be? try it.


let me know how they work out for you.
-NagaPutih



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

Date: 6 Jul 2000 12:18:44 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <3964db94@news.victoria.tc.ca>

NagaPutih (s0218327@unix1.cc.ysu.edu) wrote:
: On Mon, 3 Jul 2000 marc@bookmarc.com wrote:
: > I have a PERL  program that I wrote which is slow to output a html data
: > file to the screen.  I would like to print a warning that it may take
: > time so the user does not give up on the output and surf the web
: > elsewhere..  However, The html page does not print until it has the
: > entire output in the buffer.  So the user does not see the gentle
: > warning that he/she may have to wait a couple of minutes before the
: > output is delivered to his browser.
: > 
: > Does anyone have a straight forward trick to printing out part of a page
: > to an html browser before the entire output is ready to be printed?

Send the user a different page with a link to the actual file you are
producing.  Tell them the "real" page will be ready "soon" and ask them to
select the link to go see the page.

As well as producing the above page, produce a temporary destination for
the link.  The temporary destination has a message such as "this page is
being generated, please try again in a few moments", and a link back to
itself.

Now produce the real results in another temporary file.  Once the file is
finished then replace the temporary version with this real version.

Now when the user follows the link they get the real file.

You can use javascript to make this better.  Javascript can reload a page
every once in a while.  Eventually the "real" page is loaded.  There are
of course numerous variations on this general technique.

You will also need to find a way to clean up the tmeporary files if you
use this technique.  One way is for the script that generates them to
delete any other temporary files if they get too old (a day, and hour,
whatever works).



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

Date: 06 Jul 2000 13:26:47 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <m1itujknso.fsf@halfdome.holdit.com>

>>>>> "Malcolm" == Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> writes:

Malcolm> Send the user a different page with a link to the actual file
Malcolm> you are producing.  Tell them the "real" page will be ready
Malcolm> "soon" and ask them to select the link to go see the page.

Malcolm> As well as producing the above page, produce a temporary
Malcolm> destination for the link.  The temporary destination has a
Malcolm> message such as "this page is being generated, please try
Malcolm> again in a few moments", and a link back to itself.

Malcolm> Now produce the real results in another temporary file.  Once
Malcolm> the file is finished then replace the temporary version with
Malcolm> this real version.

Malcolm> Now when the user follows the link they get the real file.

Oh, just like <http://www.stonehenge.com/merlyn/WebTechniques/col20.html>?

:-)

Glad you liked my idea.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 6 Jul 2000 14:36:31 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <3964fbdf@news.victoria.tc.ca>

Randal L. Schwartz (merlyn@stonehenge.com) wrote:
: >>>>> "Malcolm" == Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> writes:

: Malcolm> Send the user a different page with a link to the actual file
: Malcolm> you are producing.  Tell them the "real" page will be ready
: Malcolm> "soon" and ask them to select the link to go see the page.

: Malcolm> As well as producing the above page, produce a temporary
: Malcolm> destination for the link.  The temporary destination has a
: Malcolm> message such as "this page is being generated, please try
: Malcolm> again in a few moments", and a link back to itself.

: Malcolm> Now produce the real results in another temporary file.  Once
: Malcolm> the file is finished then replace the temporary version with
: Malcolm> this real version.

: Malcolm> Now when the user follows the link they get the real file.

: Oh, just like <http://www.stonehenge.com/merlyn/WebTechniques/col20.html>?

: :-)

: Glad you liked my idea.

I've never read your web site, I've suggested this on various occasions in
the past.

I'm glad you liked my idea.



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

Date: Thu, 06 Jul 2000 18:45:19 -0600
From: Todd Anderson <todd@mrnoitall.com>
Subject: Re: Delayed HTML Output in PERL
Message-Id: <3965281D.4B239A8A@mrnoitall.com>



NagaPutih wrote:

> On Mon, 3 Jul 2000 marc@bookmarc.com wrote:
> > I have a PERL  program that I wrote which is slow to output a html data
> > file to the screen.  I would like to print a warning that it may take
> > time so the user does not give up on the output and surf the web
> > elsewhere..  However, The html page does not print until it has the
> > entire output in the buffer.  So the user does not see the gentle
> > warning that he/she may have to wait a couple of minutes before the
> > output is delivered to his browser.
> >
> > Does anyone have a straight forward trick to printing out part of a page
> > to an html browser before the entire output is ready to be printed?
>
> true that this isn't a perl question, but let me try to answer.
>
> 1) taking advantage of tables that tend to display their contents only
> when the whole contents are loaded, put the desired output inside a simple
> table and put your warning message *outside and before* the table.
>
> but this doesn't always work, and it rather depends on the connection
> and the browser, too.
>
> 2) this idea assumes that you're using a 2-row frameset consisting of
> frames (let's call them TOP and MAIN).
>
> provide a javascript function to display your warning message
> (document.write() function). when you're submitting input to or
> calling the script, execute the function above (into TOP frame)
> and direct your script output into MAIN frame.
>
> the last step is removing the earlier warning message. this is done by
> your script output. provide it with a javascript function similar to the
> one i mentioned above but with the another content/message (may be your
> website header?), and execute it onLoad.
>
> note: make sure the javascript functions return true
>
> 3) server push, may be? try it.
>
> let me know how they work out for you.
> -NagaPutih

Issue a sub routine (&hold_on;) command at the beginning of the routine. The
sub prints a simple one line "Hold On". The rest of the page will print below
this line when it's done.



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

Date: Fri, 07 Jul 2000 09:49:20 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <8k498p$q5u$1@news.mch.sbs.de>

In article <3964fbdf@news.victoria.tc.ca>, yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
>Randal L. Schwartz (merlyn@stonehenge.com) wrote:
[snip]
>: Glad you liked my idea.
[snip]
>I'm glad you liked my idea.

It's always nice to see glad people around here. But actually,
this technique was first discovered by John Dows in 1723.
Full credits should go to him. :)

Michel.


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

Date: Fri, 07 Jul 2000 17:50:40 GMT
From: peter@PSDT.com (Peter J Scott)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <QLo95.23361$Zq.668478@news1.gvcl1.bc.home.com>

NagaPutih (s0218327@unix1.cc.ysu.edu) wrote:
: On Mon, 3 Jul 2000 marc@bookmarc.com wrote:
: > I have a PERL  program that I wrote which is slow to output a html data
: > file to the screen.  I would like to print a warning that it may take
: > time so the user does not give up on the output and surf the web
: > elsewhere..  However, The html page does not print until it has the
: > entire output in the buffer.  So the user does not see the gentle
: > warning that he/she may have to wait a couple of minutes before the
: > output is delivered to his browser.
: > 
: > Does anyone have a straight forward trick to printing out part of a page
: > to an html browser before the entire output is ready to be printed?

You can use non-parsed headers; on the server I use you prefix the script name with 'nph-'
and make sure $| != 0, then output will go straight to the browser, so you can output
the first part of the page, the user will see it, then you can output more at your
leisure.  You have to output the "HTTP/1.0 200 OK" yourself.

There is a cool way to *replace* the contents of the page with later output using
what appears to be an open standard; you use a content type of 'multipart/x-mixed-replace'
and then define MIME boundaries between the parts that are going to replace each other.
Unfortunately, Netscape is the only browser AFAIK that supports it :-(

-- 
Peter Scott


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

Date: 7 Jul 2000 11:48:59 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <3966261b@news.victoria.tc.ca>

Michel Dalle (michel.dalle@usa.net) wrote:
: In article <3964fbdf@news.victoria.tc.ca>, 
  yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
: >Randal L. Schwartz (merlyn@stonehenge.com) wrote:
: [snip]
: >: Glad you liked my idea.
: [snip]
: >I'm glad you liked my idea.

: It's always nice to see glad people around here. But actually,
: this technique was first discovered by John Dows in 1723.
: Full credits should go to him. :)

Off subject but I am truely curious about John Dows, and where you would
have picked up this piece of info (assuming you are serious).

Please don't think I claim to have invented anything here.  I was
introduced to the technique (though not using HTML pages of course) when I
first worked with VAXen in early 80's.  I assume its a standard technique
on all online batch oriented systems. 

o User choses a report.

o They get immediate response telling them the report will be ready later
  and what file it will turn up in.

o The file is created before the report is ready but just contains a
  message that says "the report is still running, please try later".  

o Eventually the temporary "report" file is replaced with the real report
  file.



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

Date: Fri, 07 Jul 2000 14:01:48 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Delayed HTML Output in PERL
Message-Id: <3966291C.F0A1FB9F@texas.net>

Malcolm Dew-Jones wrote:
> 
> Michel Dalle (michel.dalle@usa.net) wrote:
> : In article <3964fbdf@news.victoria.tc.ca>,
>   yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
> : >Randal L. Schwartz (merlyn@stonehenge.com) wrote:
> : [snip]
> : >: Glad you liked my idea.
> : [snip]
> : >I'm glad you liked my idea.
> 
> : It's always nice to see glad people around here. But actually,
> : this technique was first discovered by John Dows in 1723.
> : Full credits should go to him. :)
> 
> Off subject but I am truely curious about John Dows, and where you would
> have picked up this piece of info (assuming you are serious).

I believe that John Dows was the head engineer for a group of
Benedictine monks who were transcribing biblical scripture and other
ancient texts.  When a monk would request a text that was not yet
complete, Dows would hand him a pre-scribed parchment that read:

"This text is not yet complete.  Please carry this parchment daily to
the scribing shop.  If the text is complete, we will exchange it for
this parchment.

"Thank you for using Benedictine Scribes, Ltd."

He also was the inventor of the 'Dowsing' rod.

:-)

- Tom


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

Date: Fri, 07 Jul 2000 18:09:36 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <brian-ya02408000R0707001809360001@news.panix.com>

In article <QLo95.23361$Zq.668478@news1.gvcl1.bc.home.com>, Peter@PSDT.com posted:

> You can use non-parsed headers; on the server I use you prefix the script name with 'nph-'
> and make sure $| != 0,

[snip]

that is, $| should be a true value.  it also cannot be undef or the empty
string.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Fri, 7 Jul 2000 23:43:43 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Delayed HTML Output in PERL
Message-Id: <Pine.GHP.4.21.0007072334090.11437-100000@hpplus03.cern.ch>

On Fri, 7 Jul 2000, Peter J Scott wrote:

> NagaPutih (s0218327@unix1.cc.ysu.edu) wrote:

> : > Does anyone have a straight forward trick to printing out part of a page
> : > to an html browser before the entire output is ready to be printed?

(reformatted to usenet conventions)

> You can use non-parsed headers;

You _can_, certainly, but it might not be necessary on the server that
you use.  That issue is not relevant to c.l.p.misc, so check the
documentation of the server that you use.

> on the server I use you prefix the
> script name with 'nph-' 

This is indeed a common convention, inherited from the first NCSA
spec.

> and make sure $| != 0, then output will go
> straight to the browser, so you can output the first part of the
> page, the user will see it, then you can output more at your
> leisure.  You have to output the "HTTP/1.0 200 OK" yourself.

More than that: for nph scripts the specification puts the onus on you
to send a full and accurate set of HTTP headers for your response.

Which makes the use of nph scripts rather less attractive unless they
are really needed.  You could of course allow CGI.pm to do the
business on your behalf.

> There is a cool way to *replace* the contents of the page with
> later output 

"cool" unfortunately usually means "non-standard"

> using what appears to be an open standard;

Do you have an RFC or W3C recommendation to cite?

> you use a
> content type of 'multipart/x-mixed-replace' and then define MIME
> boundaries between the parts that are going to replace each other.
> Unfortunately, Netscape is the only browser AFAIK that supports it

quel surprise.

I've found that many inexperienced WWW authors are trying to put out
their dynamic content in a TABLE (in the misguided belief that this is
the WWW way of achieving visual formatting) and haven't realised that
whatever else they do, the browser will decline to display the
contents until it sees the TABLE closed.  But again this has nothing
to do with c.l.p.misc.  If only people would pose their questions in
an appropriate group.

-- 

        "Mir ist es ein Rätsel wie man mit minimalem Verstand so einen 
         Unfug fabrizieren kann."   - Adrian Knoth




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

Date: Sat, 08 Jul 2000 13:43:53 GMT
From: peter@PSDT.com (Peter J Scott)
Subject: Re: Delayed HTML Output in PERL
Message-Id: <teG95.25923$Zq.696505@news1.gvcl1.bc.home.com>

In article <Pine.GHP.4.21.0007072334090.11437-100000@hpplus03.cern.ch>,
 "Alan J. Flavell" <flavell@mail.cern.ch> writes:
>On Fri, 7 Jul 2000, Peter J Scott wrote:
>> There is a cool way to *replace* the contents of the page with
>> later output 
>
>"cool" unfortunately usually means "non-standard"
>
>> using what appears to be an open standard;
>
>Do you have an RFC or W3C recommendation to cite?

Unfortunately not.  I first read about it in the O'Reilly HTML guide, which
omitted to mention that it is an experimental MIME type introduced by Netscape.
It seems to have never gotten its 'x-' removed, probably because people tend
not to use server push these days.

>> you use a
>> content type of 'multipart/x-mixed-replace' and then define MIME
>> boundaries between the parts that are going to replace each other.
>> Unfortunately, Netscape is the only browser AFAIK that supports it
>
>quel surprise.

Actually I found a column of Randal's that says it works on IE:

http://w3.stonehenge.com/merlyn/WebTechniques/col17.html

It didn't the last time I tried, but that was some years ago.  Apparently there's
also something called Jigsaw that supports it.

-- 
Peter Scott




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

Date: Sat, 8 Jul 2000 17:01:34 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Delayed HTML Output in PERL
Message-Id: <Pine.GHP.4.21.0007081640330.11485-100000@hpplus03.cern.ch>

On Sat, 8 Jul 2000, Peter J Scott wrote:

> >> you use a
> >> content type of 'multipart/x-mixed-replace' and then define MIME
> >> boundaries between the parts that are going to replace each other.
> >> Unfortunately, Netscape is the only browser AFAIK that supports it

> Actually I found a column of Randal's that says it works on IE:
> 
> http://w3.stonehenge.com/merlyn/WebTechniques/col17.html

It does seem to say that, doesn't it?  I'd dare to suggest that if
Randal meant to say that, then he was mistaken. 

> It didn't the last time I tried, but that was some years ago.

Well, a web search produced quite a few of tutorials, but mostly
dating back to soon after the feature had been introduced by NS. (I
can't help feeling that the relative lack of recent material suggests
that the technique fell into disfavour quite soon; unlike "client
pull", which is used quite a lot, sometimes even to the user's benefit
;-)

OK, I set up a fairly trivial Perl script which appeared in one of
those tutorials.  Seeing that the script came from "Selena Sol", I
immediately applied -wT and use strict; to it, and corrected the
resulting warnings before proceeding, including fixing a couple of
unwanted linewraps.  Actually the script was harmless, but I'm a
cynical kind of guy, especially where security of a web server is
involved.

Source: http://wdvl.com/Authoring/Scripting/Tutorial/nph.html
(I used the larger of the two sample scripts)

I then tested it on NS4.7 -> worked

And on Win MSIE5 -> didn't work (it displayed the complete stream of
MIME-ified data as if it had been plain text).

>  Apparently there's
> also something called Jigsaw that supports it.

The Jigsaw that's known to me is the W3C's portable web server,
implemented in Java.  http://www.w3.org/Jigsaw/

In that sense, Apache and, I suppose, pretty much any web server
"supports" this technique.  It's the browsers which matter, though.

cheers



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

Date: 7 Jul 2000 15:44:25 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: delete array
Message-Id: <8k4tsp$jet$1@pegasus.csx.cam.ac.uk>

Tad McClellan <tadmc@metronet.com> wrote:
>On Sun, 02 Jul 2000 19:57:51 GMT, James Fisher <jfisher@epotec.com> wrote:
>
>>To delete an array....
>>
>>@myArray = ();
>
>
>That does not delete an array (but it does allow perl to reuse
>most of the memory it had).
>
>A "deleted" array and an "empty" array are not the same thing.
>
>
>The Right Way to delete an array is to arrange for it to
>go out of scope.

TMTOWTDI.   The array doesn't necessarily have an appropriate scope.

   undef @myArray;

is always suitable.


Mike Guy


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

Date: 7 Jul 2000 15:46:01 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: delete array
Message-Id: <8k4tvp$jge$1@pegasus.csx.cam.ac.uk>

Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
>Clemens Hermann (haribeau@gmx.net) wrote:
>: Hi,
>
>: within a script I need some very large arrays. How can I delete an
>: array complete after it is no longer nesessary to free the memory it
>: used?
>
>@arrary = (lots of values);
>
>@arrary = ();	# set array back to empty array
>undef @array;	# remove the arrary variable
>$#array = -1;	# reset last element of array, toss all other elements
>
>...etc.

But note that of these, only   undef @array;   frees all the used
memory.    Don't use the other forms.


Mike Guy


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

Date: Sun, 09 Jul 2000 03:14:34 GMT
From: anuragmenon@my-deja.com
Subject: Deleting lines that match a pattern
Message-Id: <8k8qmm$64n$1@nnrp1.deja.com>

Hi guys..

I have a log file from which I want to do one of two things. Each
"record" is one line in a text file and has different "fields" that are
space delimited.

this is what I want to do.

1. Run a script to delete all the records that have a particular pattern
in one of the fields.

2. Run a script to copy all the records that have a particular pattern
in one of the fields to another file.

Anyone have any suggestions - its probably trivial, but I am perl newbie
 and I am finding it a bit difficult to understand things. Any
suggestions? pseudocode? scripts?

ANy kind of help will be deeply appreciated!!

Vinod.


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


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

Date: Sun, 09 Jul 2000 03:42:50 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Deleting lines that match a pattern
Message-Id: <3967F4FC.44994F42@rochester.rr.com>

anuragmenon@my-deja.com wrote:
> 
> Hi guys..
> 
> I have a log file from which I want to do one of two things. Each
> "record" is one line in a text file and has different "fields" that are
> space delimited.
> 
> this is what I want to do.
> 
> 1. Run a script to delete all the records that have a particular pattern
> in one of the fields.

   while(<>){
      @fields=split;
      print unless $fields[2]=~/pattern/;
   }

> 
> 2. Run a script to copy all the records that have a particular pattern
> in one of the fields to another file.

   while(<>){
      @fields=split;
      print if $fields[3]=~/pattern/;
   }

 ... 
> Vinod.
 ...
-- 
Bob Walton


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

Date: Sat, 8 Jul 2000 23:17:19 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Deleting lines that match a pattern
Message-Id: <slrn8mfrlv.qlg.tadmc@magna.metronet.com>

On Sun, 09 Jul 2000 03:42:50 GMT, Bob Walton <bwalton@rochester.rr.com> wrote:
>anuragmenon@my-deja.com wrote:
>> 
>> 1. Run a script to delete all the records that have a particular pattern
>> in one of the fields.
>
>   while(<>){
>      @fields=split;
>      print unless $fields[2]=~/pattern/;
>   }


Also as a one liner (add -i to update file):

   perl -ne 'print unless (split)[2] =~ /pattern/' file 


>> 2. Run a script to copy all the records that have a particular pattern
>> in one of the fields to another file.
>
>   while(<>){
>      @fields=split;
>      print if $fields[3]=~/pattern/;
>   }


   perl -ne 'print if (split)[3] =~ /pattern/' file 


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


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

Date: Wed, 05 Jul 2000 10:47:02 GMT
From: "Treku" <Treku@w.pl>
Subject: Deleting records form database
Message-Id: <GmE85.17992$Qw1.427489@news.tpnet.pl>

Hi

i use dbf files (XBase).
i need to delete a record from database.

i didn't find in (perldoc XBase) any informations about that.


thx for help

bye
treku@w.pl
treku@poczta.onet.pl






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

Date: Wed, 05 Jul 2000 21:15:12 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Deleting records form database
Message-Id: <3963A5B5.A1BE494A@rochester.rr.com>

Treku wrote:
 ...
> i use dbf files (XBase).
> i need to delete a record from database.
> 
> i didn't find in (perldoc XBase) any informations about that.
 ...
> treku@w.pl
> treku@poczta.onet.pl

   use DBI;  

You can run any SQL statement using that.  You'll probably have to
install the XBase DBD driver (and maybe DBI too).
-- 
Bob Walton


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

Date: Sat, 8 Jul 2000 11:42:06 +0100
From: "news@btinternet.com" <alan@rose-it.co.uk>
Subject: Re: Deleting records form database
Message-Id: <8k70ik$bi$1@uranium.btinternet.com>

Use the Perl DBI and install the xbase drive

then

my $dbh = DBI->connect($database,$db_user,$db_password)
            or die "Err: $DBI::errstr\n";

  my $sth = $dbh->prepare("DELETE*
      FROM tablename
      WHERE  premise
       ")
            or die "Unable to prepare SQL statement: $DBI::errstr\n";





Treku wrote in message ...
>Hi
>
>i use dbf files (XBase).
>i need to delete a record from database.
>
>i didn't find in (perldoc XBase) any informations about that.
>
>
>thx for help
>
>bye
>treku@w.pl
>treku@poczta.onet.pl
>
>
>
>




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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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


------------------------------
End of Perl-Users Digest V9 Issue 3561
**************************************


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