[10458] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4050 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 22 22:03:58 1998

Date: Thu, 22 Oct 98 19:00:21 -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, 22 Oct 1998     Volume: 8 Number: 4050

Today's topics:
    Re: "Document Contains no data"? <rootbeer@teleport.com>
        .gz extention?????? (Mattjm82)
    Re: about ssi and <img src... (David Alan Black)
    Re: automatic garbage collection and memory leak DISAPP (David Formosa)
    Re: Help - dynamic images <tupshin@tupshin.com>
    Re: Help - dynamic images <rootbeer@teleport.com>
    Re: help shorten one-liner (Michael J Gebis)
        Help with 5.005 compiler <chad@anlon.com>
    Re: Help with Perl5.005 (Martien Verbruggen)
    Re: Help:Tried installing PERL under WIN3.11, it simply (Martien Verbruggen)
    Re: How to print portion of file <rick.delaney@shaw.wave.ca>
        Locking files under windows 98 <eunpingc@ucsd.edu>
        Marrying S-Lang and Perl -- boon or blasphemy? <ljz@asfast.com>
        Newbie tries to create time-limited form! jbutler@express-news.net
        PERL & simple flat file database??? <mph@pcola.gulf.net>
    Re: PERL & simple flat file database??? (Martien Verbruggen)
    Re: Perl & Y2K - booby trap code (Larry Rosler)
    Re: Perl & Y2K - booby trap code <rootbeer@teleport.com>
    Re: Perl & Y2K - booby trap code <rra@stanford.edu>
    Re: Perl Y2K copmliance <brian@Emma.COM>
    Re: postscript to acrobat in perl (Gregory Tod)
    Re: Repost from Data (Sam Holden)
    Re: Sambar help piercew@netscape.net
    Re: Searching for long lines in a huge text file. (Shane Brown)
    Re: Still confused with pattern matching (Martien Verbruggen)
    Re: Updating Record Structures? (Charles DeRykus)
    Re: web baseed email <rootbeer@teleport.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 23 Oct 1998 01:42:59 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: "Document Contains no data"?
Message-Id: <Pine.GSO.4.02A.9810221842450.5534-100000@user2.teleport.com>

On Thu, 22 Oct 1998 piercew@netscape.net wrote:

> Subject: "Document Contains no data"?

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: 23 Oct 1998 01:23:22 GMT
From: mattjm82@aol.com (Mattjm82)
Subject: .gz extention??????
Message-Id: <19981022212322.26029.00001268@ng-fb2.aol.com>

How do I use a file with the extention of .gz? Is there a spetial program to
unzip it can I just run it?

Matthew J. Meyer
Future PERL user.


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

Date: 22 Oct 1998 20:43:02 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: about ssi and <img src...
Message-Id: <70ojem$qq9$1@pilot.njin.net>

danbeck@eudoramail.com (Daniel Beckham) writes:

>Any out there want to correct my errors?

The only error I noticed was that you posted this to clpm instead
of emailing it privately to the original poster.


David Black
dblack@pilot.njin.net


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

Date: 23 Oct 1998 11:33:12 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: automatic garbage collection and memory leak DISAPPEARED
Message-Id: <70omco$ai6$1@godzilla.zeta.org.au>

In <lj67dc1mxl.fsf_-_@gargoyle.cs.uchicago.edu> Gulriz Aytekin Kurban <gulriz@cs.uchicago.edu> writes:


>Well,

>I'm learning Perl from the book by Larry Wall, etc. (O'Reilly). I
>could not find any information on how the garbage collection is done
>except the following on page 299.

>	A Note on Garbage Collection

>	High-level languages ... For most purposes, Perl uses a fast and
>	simple, reference-based garbage collection system.

Every thingy in perl has a "refrenece count" that measures how meany things 
are refurning to it.  When this gose to zero the memory related to that 
thingy is freed.  However if something refers to itself then the score will
never drop below 1 and hence never be cleaned up.  So C<$x=\$x;> is a 
memory leek.

This dosn't even have to be a direct loop, if you have say a doubly linked
list structure then it will cause problems. [...]

>This tells me that Perl does reclaim storage for objects, and other "my"
>variables. However, what this particular class had, and others did not,
>was the saving of the file handles inside the objects by the following
>simple set of statements: 

>sub open{...open(FILE, $name);  $self->{handle} = \*FILE; ...} 
>sub close{ ...     close($self->{handle})}

This shouldn't stop the object from being reclamed.

-- 
Please excuse my spelling as I suffer from agraphia. See the URL in my
header to find out more.



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

Date: 22 Oct 1998 17:18:33 PDT
From: "Tupshin Harper" <tupshin@tupshin.com>
Subject: Re: Help - dynamic images
Message-Id: <newscache$xi791f$zib@debian>

You can do this by having your CGI script by called from the IMG SRC= tag,
and make sure that it returns the proper mime/type for the image that you
are generating on the fly.  This is not a Perl specific question, and
additional queries should go to comp.infosystems.www.authoring.cgi.

-Tupshin Harper
-Programmer/Network Administrator
-Studio Verso

Dale Sutcliffe wrote in message ...
>I need to create graph images on the fly.  For instance one web page may
>contain 20 different images that were created on the fly. I have used
gd.pm,
>but I believe that I would have to create, save, and then display the
image.
>How can I display multiple images in a web page without the image existing
>as a gif or jpeg file on the server?
>
>




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

Date: Fri, 23 Oct 1998 01:28:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help - dynamic images
Message-Id: <Pine.GSO.4.02A.9810221823350.5534-100000@user2.teleport.com>

On Thu, 22 Oct 1998, Dale Sutcliffe wrote:

> I have used gd.pm, 

Do you mean GD.pm?

> but I believe that I would have to create, save, and then display the
> image.

By "save" do you mean "save to a file"? That's not required. Who told you
it was? :-)

> How can I display multiple images in a web page without the image
> existing as a gif or jpeg file on the server?

If I see what you're asking, you should simply not save the image to a
file. 

But if you're not sure how to make a program return an image to a browser,
or something similar, that's the same whether you're programming in Perl
or in any other language. The docs, FAQs, and newsgroups about CGI
programming and related topics should be useful.

Hope this helps!

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



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

Date: 23 Oct 1998 00:27:33 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: help shorten one-liner
Message-Id: <70oihl$n3g@mozo.cc.purdue.edu>

mjd@op.net (Mark-Jason Dominus) writes:

}In article <70nhrg$vsc$1@nnrp1.dejanews.com>,  <jkane@my-dejanews.com> wrote:
}>> #!/usr/bin/perl -w
}>> print "Something ";
}>> =for nobody
}>> Here is some POD style commenting, which
}>> can throw your whole concept of commenting way over...
}>> =cut
}>> print "under the bed is drooling.";
}>> __END__
}>>
}>I didn't realize you could comment in the middle of a statement.  

}You can't.  That's not in the middle of a statement.

Sure it is.  It's in the middle of a statement about the monster under
the bed. ;)

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Thu, 22 Oct 1998 18:57:10 -0500
From: Chad Moston <chad@anlon.com>
Subject: Help with 5.005 compiler
Message-Id: <362FC656.5C29F6AB@anlon.com>

What is the deal with the compiler in 5.005?  I
consulted this news group earlier and was told
that the free version of 5.00502 did not come with
a compiler and that it must be downloaded
seperately in order to get it.  This file is
called perl2exe.exe and I did go and get it.
However, I'm not sure if it is a 'real compiler'.
For one, it increases the file size of a .pl file
to an .exe file TREMENDOUSLY.  I am assuming this
is happening because it must carry the intrepreter
with it.  Second, it still makes an .exe when
there is a compiler error, which shouldn't
happen.  Third, when you run the exe, it is being
compiled again.  These reasons lead me to believe
that this compiler is not a normal compiler.

Can anybody help me with this problem? Is there
another compiler for 5.005 that I can get that
acts as a normal one would?

Thanks for the help,

Chad Moston



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

Date: Fri, 23 Oct 1998 00:46:52 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help with Perl5.005
Message-Id: <0mQX1.31$Jy4.151781@nsw.nnrp.telstra.net>

In article <70nv8u$e5f$1@nnrp1.dejanews.com>,
	lsrobert@my-dejanews.com writes:
> Chad,
> 
> Perl is an interpreted language.  The interpreter reads the source, also known
> as a "script", and executes it.

<pedantry>
perl does actually compile the code, and run that.
</pedantry>

Addition: 
perlcc is a rudimentary compiler of sorts. It translates perl into c,
and compiles that. It's sort of experimental, but it's there for
people who want to work with it and improve on it.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Fri, 23 Oct 1998 00:52:45 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help:Tried installing PERL under WIN3.11, it simply gave me an error 2 on bat. installation
Message-Id: <xrQX1.32$Jy4.151781@nsw.nnrp.telstra.net>

In article <70o73a$itu$1@bunyip.cc.uq.edu.au>,
	"G. North" <aufempen@dyson.brisnet.org.au> writes:
> Hi Charon
> 
> I have checked the webpage of perl.com.
> But I still do not know where to find "perl" for win3.11
> or MSDOS.

You posted the same message to clp.modules. I sent an answer there.
You can get a dos port from CPAN/ports.

> May I suggest you read http://wwww.perl.com

If you have been there, I am terribly surprised that you couldn't find
it.

http://www.perl.com
link: Download Software
(third header 'Alien Ports')
link: /CPAN/ports

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Fri, 23 Oct 1998 00:48:28 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: How to print portion of file
Message-Id: <362FD3FA.BB2D9FF7@shaw.wave.ca>

[posted & mailed]

Brand Hilton wrote:
> 
> Read about it in the perlvar man page (perldoc perlvar on
> Windows systems).

Since perldoc comes with perl, I expect it works on most OS's that perl
runs on.  In particular, it works under Unix, so you might want to save
yourself typing that little qualification.

    perldoc perldoc :-)

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Thu, 22 Oct 1998 18:05:30 -0700
From: E Unpingco <eunpingc@ucsd.edu>
Subject: Locking files under windows 98
Message-Id: <362FD65A.94981C08@ucsd.edu>

Has anyone figured out how to lock files under windows 98?


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

Date: 22 Oct 1998 19:57:41 -400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Marrying S-Lang and Perl -- boon or blasphemy?
Message-Id: <ltd87ki1ze.fsf@asfast.com>

I've been toying with an idea for a while that I'd like some feedback
on.  My idea involves building an environment that combines S-Lang and
Perl, and so I'm soliciting responses both from the S-Lang community
and the Perl community about my idea.

This idea is past the "conceptual" stage, but I wouldn't as yet call
it "embryonic" ... so perhaps we could refer to it as "zygotic" (or
maybe some of you would prefer to just call it "psychotic").

Anyway, I see some advantages to building a
library/module/package/whatever wherein all (or at least most) of the
features of S-Lang and Perl would be available to the programmer.

I like S-Lang because it provides a set of curses-like routines for
ascii-screen-based applications which are more robust, useful, and
higher-level than their curses counterparts.  Even powerful text
editors can be built using S-Lang (for example, `jed').

I like Perl because it's easy and extremely powerful to program in,
and because there are (at today's count) 676 modules living at CPAN
that can be used to greatly simplify just about any programming task
imaginable.

Combining these two environments should make it relatively quick and
easy to create powerful, ascii-screen-based applications.  A
full-featured newsreader that is fully configurable via Perl
comes to mind.

Of course, one could also use the S-Lang language itself instead of
Perl.  I'm impressed with what John Davis has done with this language
and the S-Lang environment as a whole, but this language doesn't as
yet have the hooks into the guts of the operating system like Perl
does.

I could also use Perl with its Curses module to create useful,
ascii-screen-based applications, but as I mentioned above, I
find S-Lang to be higher level and more useful and powerful
than curses.

So, I definitely see a positive synergy in the marriage of S-Lang and
Perl.

Given Perl's XS and S-Lang's embedded interpreter facilities, it would
be rather straightforward to build something that combines S-Lang and
Perl.  I can think of at least three ways this could be done, and I'll
discuss these in a subsequent message.

But for the moment, I'm wondering what other people think of this
idea.  If there's enough interest, I'm sure that we'll be able to come
up with all sorts of aspects of this to discuss, and perhaps a rather
useful set of programming tools could evolve from these discussions.

OK.  I'm now ready to face the onslaught ...

-- 
 Lloyd Zusman
 ljz@asfast.com


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

Date: Fri, 23 Oct 1998 01:28:14 GMT
From: jbutler@express-news.net
Subject: Newbie tries to create time-limited form!
Message-Id: <362fda34.4190513@news.fibr.net>

I'm looking for advice on how to prepare an online test (HTML) that
will stop accepting answers from the applicant after a set amount of
time, and  submit the answers automatically after that time (if the
applicant has not already done so). I suspect a cookie is called for
here?
I'm also trying to set up the form so the applicant cannot exit the
test and try again later.
TIA for any insight!   


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

Date: Thu, 22 Oct 1998 20:06:46 -0500
From: "Mark Hurley" <mph@pcola.gulf.net>
Subject: PERL & simple flat file database???
Message-Id: <XCQX1.812$Kp5.4412229@news1.atlantic.net>

I've spent the last couple nights trying to figure this one out...

I'm using a script from out of a book.  That will enable me to combine a
flat-file dbase with a template.   The script only HALF works.

The problem I believe lies here:

print <"FORM METHOD=\"POST\" ACTION=\"second.cgi\">/n";

I understand that each " (quote) inside the print quotes has to be preceded
by a \ (backslash).

When I click on the MORE INFORMATION button on this page:
www.finditviewitbuyit.com/cgi-bin/second.cgi?

A window pops up asking me to save or open (download) the file!!!  The file
is listed as
                        second.   from  www.finditviewitbuyit.com


I'm not sure why I have a download file window popup.  And even if it did
popup shouldn't it read            second.cgi        Where is it loosing
it's extension?

I've tried changing the path to the following...

 ../cgi-bin/second.cgi
/cgi-bin/second.cgi
/../cgi-bin/second.cgi

Anyone that can help will be GREATLY appreciated!!!  Please email me any
responses (as well as posting).

Mark Hurley





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

Date: Fri, 23 Oct 1998 01:22:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PERL & simple flat file database???
Message-Id: <cTQX1.36$Jy4.151781@nsw.nnrp.telstra.net>

In article <XCQX1.812$Kp5.4412229@news1.atlantic.net>,
	"Mark Hurley" <mph@pcola.gulf.net> writes:

> print <"FORM METHOD=\"POST\" ACTION=\"second.cgi\">/n";
        ^^
Your quotes are incorrect. perl will not compile this script.

To prevent to have to backslash the quotes inside the string you can
use a single quoted string. In case you do need double-quote
expansion: Since print takes a list, you can just use commas between
the arguments. Alternatively you can concatenate the separate strings
with '.'.

print '<FORM METHOD="POST" ACTION="second.cgi">', "\n";

> When I click on the MORE INFORMATION button on this page:
> www.finditviewitbuyit.com/cgi-bin/second.cgi?
> 
> A window pops up asking me to save or open (download) the file!!!  The file
> is listed as
>                         second.   from  www.finditviewitbuyit.com

This has nothing to do with this form. It has to do with what your
second.cgi script returns as a content type. Ask on one of the
comp.infosystems.www.* groups, because that part of your question has
nothing to do with perl, but with CGI.

> Anyone that can help will be GREATLY appreciated!!!  Please email me any
> responses (as well as posting).

Sorry, Post here, read here. If it's important enough for you to ask
here, it should also be important enough for you to check here.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Thu, 22 Oct 1998 17:38:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <MPG.10996fd1cf0c54609898da@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <70ogg1$1om$1@csnews.cs.colorado.edu> on 22 Oct 1998 23:52:33 
GMT, Tom Christiansen <tchrist@mox.perl.com> says...
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
> :There is an unambiguous way that is also *standard*:  ISO 8601:1988.  
> :The following is the complete long form:
> :
> :yyyy-mm-dd HH:MM:SS (punctuation is optional)
> 
> The day that you ask everyone on the street when they were born and they
> all recite an answer in a form such as that is the day that computer
> programmers should expect to use that form as their unique input and
> output style.

Granted.  But the post I responded to talked specifically about 
*storage*, not input and output.  FWIW (if anything), the ISO standard 
form was already the standard output representation in China, of all 
places.  But I have no idea what 'everyone on the street' there uses.

I might also have presented the Unix epoch time as a useful monotonic 
standard locale-independent storage-efficient date/time representation  
-- it can be packed from ten bytes as a string (left zero padding 
required for alphanumeric monotonicity) to four bytes as an integer.  
But, as we are all well aware, it has limited range. :-(

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


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

Date: Fri, 23 Oct 1998 01:42:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <Pine.GSO.4.02A.9810221832260.5534-100000@user2.teleport.com>

On 22 Oct 1998, Lloyd Zusman wrote:

> And if someone came here and suggested (to use one of your examples)
> that people go back and check completed projects for the proper use of
> "die", I doubt that you would be responding in the same manner to that
> hypothetical person as you're responding to this current person who's
> raising this Y2K-and-localtime issue.

If someone suggests checking "die" for proper use, I'll ask "Why be so
restrictive?"

If someone suggests checking "localtime" for proper use, I'll ask "Why be
so restrictive?"

If someone suggests checking entire programs for proper use of everything,
I'll say "Good idea!"

Do you think I'm being inconsistent?

> what is so special about Y2K issues that would lead some of you to
> [presumably] react differently to them than to other, similar issues?

Speaking only for myself, there's NOTHING special about Y2K issues and
Perl. It's just one of an infinite number of possible bugs. What is so
special about Y2K that we should treat this one differently, indeed?

Of course, there's nothing perl-specific about this, so general "look out
for bugs like this" messages belong in a more-general programming
newsgroup, rather than a language-specific one. General "look out for Y2K
bugs" messages belong in a Y2K-specific newsgroup. Anything about Y2K that
relates _only_ to Perl could be discussed here, but there's nothing to say
about it that hasn't been said 2K times already. :-)

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



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

Date: 22 Oct 1998 18:41:53 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <yl4ssw3vha.fsf@windlord.stanford.edu>

Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
> Russ Allbery <rra@stanford.edu> writes:

>> The fact that a return value of the year - 1900 is documented does not
>> change the fact that returning the year - 1900 when you could have just
>> returned the year is stupid.

> No, I do not think so.  I think it is hard to find a calendar with an
> absolute year number (as opposed to relative one of Perl or AD) which is
> not moon-phase based.  And I do not think many would appreciate it if
> Perl returned date in a moon-phase based format.

Granted, AD isn't particularly well-defined either.  But it's well-defined
enough that pretty much everyone uses it, which I think is rather good
enough for a programming language.

There are no absolutes, only relative choices.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Thu, 22 Oct 1998 20:19:32 -0400
From: Brian Fuller <brian@Emma.COM>
Subject: Re: Perl Y2K copmliance
Message-Id: <362FCB94.B495E1E1@Emma.COM>

In reference to the Subject:. What the hell does copmliance mean? Come
on people, lets take a little care in spelling.

We are forced to spell correctly in programming.

ARGZ[0] might not work. :-)


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

Date: 23 Oct 1998 01:16:33 GMT
From: gtod@netspace.net.au (Gregory Tod)
Subject: Re: postscript to acrobat in perl
Message-Id: <70oldh$r6h$1@otis.netspace.net.au>

On Thu, 22 Oct 1998 03:00:21 GMT, <benmoretti@my-dejanews.com> wrote:
>There are a number of perl scripts to extract data from PDFs

I'd be interested to know what they are.

>... and  I know that
>there is a script that converts text files natively to PDF.

Very interested to hear about that.

>What I need is a perl script that would convert postscript to PDF. I know it
>could be done in perl.

Well, since doing this implies implementing a full Postscript interpreter
in Perl (Postscript is a language) I doubt anyone has devoted the effort.

For Postscript to PDF Adobe's Distiller is the best choice, with 
Ghostscript second.

>If not, we should form a team to develop one!

Why?

-- 
Gregory Tod   gtod@netspace.net.au


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

Date: 23 Oct 1998 01:44:34 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Repost from Data
Message-Id: <slrn72vns2.oi4.sholden@pgrad.cs.usyd.edu.au>

On Thu, 22 Oct 1998 18:09:22 GMT, toiday@my-dejanews.com
	<toiday@my-dejanews.com> wrote:
>I'm writing a cgi program.  Because program generate a webpage that need to
>update the information, I include the following:
>
><META HTTP-EQUIV="REFRESH" CONTENT="120">
>
>to refresh every 2 minutes.  This webpage would also do "POST".  The problem
>is if someone use Microsoft IE (version 4) to submit the data, after two
>minutes, when it suppose to REFRESH, it would ask "Repost from Data?". 
>However, it work fine for Netscape.  Can someone tell me what is going on
>with IE?  How can I fix that problem?

I think you just use...
<META HTTP-EQUIV="REFRESH" CONTENT="120" MISC="POST DAMN YOU!!!!!!">

Then again I write perl not HTML... maybe you should try a more appropriate
news group...

-- 
Sam

PC's are backwards ... throw them out! Linux is ok though.
	--Rob Pike (on the subject of CR/LF etc)


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

Date: Fri, 23 Oct 1998 00:42:42 GMT
From: piercew@netscape.net
Subject: Re: Sambar help
Message-Id: <70oje2$4s8$1@nnrp1.dejanews.com>

[Message CCd to newsgroup]

In article <362CA1FE.621A5E58@echo-on.net>, Errol <enyoung@echo-on.net> wrote:
> I have a file \windows\host with "127.0.0.1
> localhost" in it.  When I call up www.localhost I get the Sambar Server
> home page as I am supposed to so all that seems set up well.
>
> I tried to get a small script to run and am having problems.  I read the
> part of the book a number of times and I am probably missing something.

 Is your script referring to your computer as 'www.localhost' or just
'localhost'.  It should either be the loopback 'localhost' or '127.0.0.1'.

> I got the script from the web site for the book so I know that it
> works.

 You might want to be careful on these, as I've encountered many
scripts/programs in books that had small typos which messed up the whole
program.

> I cannot figure out what the URL of the file should be.  Can you help me
> over this hump?

 Have you tried 'localhost/<sambar_cgi-bin_directory>/script_name'?

Wayne

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


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

Date: Fri, 23 Oct 1998 00:46:27 GMT
From: s1.brown@qut.edu.au (Shane Brown)
Subject: Re: Searching for long lines in a huge text file.
Message-Id: <70ojt6$f65$1@dove.qut.edu.au>

In article <T69X1.13$Fh4.128293@nsw.nnrp.telstra.net>, mgjv@comdyn.com.au (Martien Verbruggen) wrote:
>Another reply to this.
>
>While I am certainly not an authority on this subject, and there are
>people visiting this group who know a lot more about this than I do, I
>have been faced with this problem often enough to have spent some
>thought on it.

 .ditto for my skills and circumstances.


>
>Then you have to deal with exceptions to the 'sentence' rule. What
>happens if you have an abbreviation in the middle of a sentence, which
>commonly ends in a dot? You'll have to keep a dictionary of all
>abbreviations you might encounter, and check for those.  Even a
>dictionary will not be sufficient here, because you might have strings
>like 'Dr. F. Bar' in your text.
>
>You can try to make sense of the grammar of a sentence to determine
>where the sentence ends. This last thing is what the brain does,
>seemingly without effort. The brain understands grammar. Grammar is
>very hard to program.

>Of course, if your text rigorously adheres to a certain format your
>job gets a lot easier, e.g.  all sentences are terminated by a
>newline and newlines do not occur anywhere else, or the typist uses
>the old convention of ending every sentence with a dot followed by at
>least two whitespace characters (spaces or newlines). But normally,
>that's just not the case.
>
>It's a very hard thing to do. With simple pattern recognition, and a
>dictionary, you can probably reach a certain success rate. But it will
>never be 100%.
>
>Martien

 ..Just as a further example (and perhaps subconscious plea for
help...although now that I've recognised it it's no longer sub is it?
oh bugger ).

Anywhy... Currently I am undertaking the arduous task of content analysing
ten 25 mb plain text files (annual collections of presidents letters
from approx. 10,000 U.S. companies). The analyses are fairly
mechanistic...not so much interested in deep understanding,
but rather the co-occurence of key concepts (lets me off
the grammar hook to a large degree).

Perl is my chosen processing/analysis 'tool' ....though perhaps the
term 'bludgeon' might be more appropriate given my laughable
programming skills.

Thusfar splitting to the level of the company has been trivial, as the
initial text has some non-ambiguous markers for this purpose.
Splitting to the level of the paragraph is more difficult. For the most part
paragraph ends are defined by a newline, but section headings,
lists (which are used in only some letters) and for a small set of
letters actual sentence terminations, are also defined by a newline.
Some simple exclusion of paragraphs with single sentences will
help considerably here, but there will still be considerable
variation in what comprises a paragraph from case to case.
(I *could* of course disambiguate manually.....yeah right).

Now, down to the sentence level....where I've found a few
simple rules have taken me a long way. Basically I stripped
the text of any periods following -
isolated letters ( F.  or  a. ), short capitalized words
(eg. Mr., Fla., PhD.), capitals interleaved with periods
(C.R.A.P. to CRAP), replaced periods within digits (eg. 1.34 to 1#34)
and a few other manipulations. Didn't need to specify any
particular acronyms or abbreviations, as the general patterns
did a half decent job. Naturally, I've caused adjacent sentences
to combine in a few cases (eg C.R.A.P. where the last period
is actually the intended sentence endpoint), but overall I have a much
better set of actual sentences to analyse.

Now I just have to figure out an efficient way to tag and count
hits for a set of pre-defined concept co-occurences (which in
some cases can occur in any order, but may require one
concept to precede the other, and further which may need to
occur within a maximum number of words of each other).
This is the tricky bit (for me) and I'm not done torturing myself
yet, so I won't ask a Perl big sibling to step in  8)

BTW pardon the transparent lack of actual Perl content....

Cheers, Shane.


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

Date: Fri, 23 Oct 1998 00:57:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Still confused with pattern matching
Message-Id: <9wQX1.33$Jy4.151781@nsw.nnrp.telstra.net>

In article <u24n07.shk.ln@flash.net>,
	tadmc@flash.net (Tad McClellan) writes:
> Martien Verbruggen (mgjv@comdyn.com.au) wrote:
>: In article <362ED1BE.14AEABE1@creative.net>,
>: 	Farhad Farzaneh <ff@creative.net> writes:
> 
>: > if ($mls =~ /[0-9]+/) {
> 
>: You realise that this does the same as 
> 
>: if ($mls =~ /\d/)
>               ^^^^
>               ^^^^
> 
>     /\d+/  is the same as  /[0-9]+/   (was a typo, I'm sure)

I know that :), but it was not a typo.

I was not saying that /\d+/ is the same as /\d/, but that evaluating
($mls =~ /\d+/) and ($mls = /\d/) are functionally equivalent, except
that the second one is probably faster. of course, this would not be
true in case one wants to use $& or one of its kin, but there was no
specific mention of that.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Fri, 23 Oct 1998 01:24:40 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Updating Record Structures?
Message-Id: <F19AL4.Jos@news.boeing.com>

In article <362F4642.E0661172@boeing.com>,
Vickie Cooper  <vickie.cooper@boeing.com> wrote:
>I want to read in a list of records into an array...but when that record
>already exists then update the BYTES field to add the value from the
>current record to the existing record.
>
>I created a routine to load the records:
>@url_index = ();
>sub BuildIndex {      
>$record = {           
>  URL => $url,        
>  BYTES => $bytes,    
>  HITS => $RecCount++,
>  };                  
>}
>
>Then I assign :  
>
>$url_index[$record -> {URL}] = $record;
>
>Is there a way I can determine if the record already exists as I'm
>loading the array...and if so, update that record in place?
>

You'll need to loop, e.g.,

for ( 0 .. $#url_index ) {
   $url_index[$_]->{BYTES} += $record->{BYTES}  if 
        $url_index[$_]->{URL} eq $record->{URL};
}
      

But, as someone else pointed out, if url_index were simply
a hash, you could simply say: 

$url_index{$record->{URL}}{BYTES} += $record->{BYTES} if
  exists $url_index{$record->{URL}};



hth,
--
Charles DeRykus


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

Date: Fri, 23 Oct 1998 01:29:22 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: web baseed email
Message-Id: <Pine.GSO.4.02A.9810221829070.5534-100000@user2.teleport.com>

On Thu, 22 Oct 1998, James King wrote:

> IS there any perl programs that you know of that will provide us with
> the service we need.

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!

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



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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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