[13159] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 569 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 17 19:07:16 1999

Date: Tue, 17 Aug 1999 16:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 17 Aug 1999     Volume: 9 Number: 569

Today's topics:
    Re: adding 30 days <jimmy@blackhole-designs.com>
    Re: Anyone need an INDEPENDENT CONTRACTOR??? <jcreed@cyclone.jprc.com>
        Compiling to executable using ActivePerl <GOAWAYSPAMBASTARDSmartin3@dds.nl>
    Re: Counting lines of block of text <cassell@mail.cor.epa.gov>
    Re: HARASSMENT -- Monthly Autoemail (John Stanley)
    Re: HARASSMENT -- Monthly Autoemail (John Stanley)
        help with floats and structure <me@nowhere.com>
        help with floats in calling C from perl <me@nowhere.com>
    Re: How to count clicks to HTML link. <amonotod@netscape.net>
        Insecure dependency message with SGID script <gpalmer@interaccess.com>
        IO::Socket::INET - determining if listener is still act mrdster@my-deja.com
    Re: Language survey <cassell@mail.cor.epa.gov>
    Re: New Perl related Newsgroup, alt.comp.perlcgi.freela <cassell@mail.cor.epa.gov>
        Perl Help <gary.segler@bms.com>
    Re: Perl Help <uri@sysarch.com>
    Re: Perl Help (Bill Moseley)
    Re: Perl Help <sariq@texas.net>
        Perl on Netware 5 question <frankie@toad.net>
    Re: problems creating and saving to file... <james.p.williams@usahq.unitedspacealliance.com>
    Re: problems creating and saving to file... <james.p.williams@usahq.unitedspacealliance.com>
    Re: Q:Two perl programs printing to one txt file <emschwar@rmi.net>
    Re: Q:Two perl programs printing to one txt file danmex@my-deja.com
        Sending a Page using Perl ??? <ritche@san.rr.com>
    Re: Sending a Page using Perl ??? <makkulka@cisco.com>
    Re: Sending a Page using Perl ??? <mike@crusaders.no>
        Spell Checker dgold1@my-deja.com
        SSI commands appear in perl webbrowser one1999@my-deja.com
    Re: SSI commands appear in perl webbrowser (Malcolm Ray)
    Re: statistical sorts <marc@interak.com>
    Re: statistical sorts (John Stanley)
    Re: statistical sorts <cassell@mail.cor.epa.gov>
        wasted memory (Bill Moseley)
    Re: wasted memory <makkulka@cisco.com>
    Re: wasted memory <makkulka@cisco.com>
    Re: Why use Perl when we've got Python?! ()
    Re: writing an html file into another html file <jtnt@nospammindspring.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 17 Aug 1999 21:08:28 GMT
From: Jimmy Humphrey <jimmy@blackhole-designs.com>
Subject: Re: adding 30 days
Message-Id: <37B9CF3A.90B2DFCB@blackhole-designs.com>

Nevermind, I fixed it.

Jimmy

Jimmy Humphrey wrote:

> I was wondering how I could go about adding 30 days to the current date.
> I'm using perl 5.0005_02 on the latest Sun Solaris system.
>
> Thanks
>
> Jimmy



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

Date: 17 Aug 1999 17:09:54 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: Anyone need an INDEPENDENT CONTRACTOR???
Message-Id: <a1ogg6cdwd.fsf@cyclone.jprc.com>

marcel.grunauer@lovely.net (Marcel Grunauer) writes:

> >And I am looking for someone to clear 4.6 acres of land.....
> 
> Or should that be 5.6 acres of perlland?

perldoc perldozer

*duck*

---Jason


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

Date: Tue, 17 Aug 1999 23:36:36 +0100
From: "Martin Wachters" <GOAWAYSPAMBASTARDSmartin3@dds.nl>
Subject: Compiling to executable using ActivePerl
Message-Id: <7pco6i$7f7$1@nclient13-gui.server.virgin.net>


Hi all!
I am developping an application to automatically write midifiles (using the
MidiPerl module)
I am using ActivePerl 517 (for win32)
Could anyone please tell me if it is possible to compile my perl program to
an executale?
If so, what should I do?

Many thanks!!!

Martin





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

Date: Tue, 17 Aug 1999 14:18:57 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Counting lines of block of text
Message-Id: <37B9D1C1.FC5F758C@mail.cor.epa.gov>

Martien Verbruggen wrote:
> 
> In article <37B8A478.F6D30A62@mail.cor.epa.gov>,
>         David Cassell <cassell@mail.cor.epa.gov> writes:
> > Mark McCoy wrote:
> >> "$someArrayLength = $#linesFromFile;
> >
> > But that doesn't give the array length.  It is off by 1.
> 
> \begin{pedant}
> 
> perl -w
> $[ = 20;
> @a = qw(a b c);
> printf "%d %d\n", scalar @a, $#a;
> __END__
> 3 22
> 
> It is off by $[ - 1

I'll agree.. but only if you promise never never never never
never never never never never never never never never never
never never never never never never never never never never
never never never never never never never never never never
never never never never never never never never never never
never never never never never never never never never never
never never never never never never never never never never
to use that in real code.

David [note implicit smiley]
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 17 Aug 1999 21:33:42 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <7pckfm$6de$1@news.NERO.NET>

In article <37babfde.12079488@news.erols.com>,
Dave Salovesh <darsal@erols.com> wrote:
>In article <7pccqc$2lh$1@news.NERO.NET>,
>stanley@skyking.OCE.ORST.EDU (John Stanley) opined:
>
>>No, Dave. I am telling you that you need to show me
>
>I'm clearly not showing you anything, 

That's right, Dave. You haven't shown me anything that supports your
claim that posting is solicitation of email. 

>and to persist in trying would be
>foolish.  

Since there is no such rule, yes, it would be foolish to persist in
trying. I think that is what I was telling you. As long as you leave
with the knowledge that it is just your opinion that you have solicited
email when you post, and that opinion is binding on nobody but yourself,
and cannot possibly be used to justify a monthly FAQ being mailed to
someone, you've come out ahead of the game.

>I try to reduce my foolishness whenever I can.

Good for you.



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

Date: 17 Aug 1999 21:34:33 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <7pckh9$6dj$1@news.NERO.NET>

In article <37bcc2b6.12808178@news.erols.com>,
Dave Salovesh <darsal@erols.com> wrote:
>I see that.  I don't know what anyone expects you or me to do about it.

Ummm, stop defending it for one thing.



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

Date: Tue, 17 Aug 1999 22:52:55 GMT
From: "Jason Sill" <me@nowhere.com>
Subject: help with floats and structure
Message-Id: <bJlu3.17$Ta5.1057@sapphire.mtt.net>

Is there a problem with using floats as a parameter in a C function that you
plan on calling from perl?

I have the problem where it appears that in the function, when it gets the
parameters, it gets the incorrect size for the float hence both it and the
parameter after it are messed up.

Also, where can I find some good examples of dealing with C structures with
perl

Jason




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

Date: Tue, 17 Aug 1999 22:57:12 GMT
From: "Jason Sill" <me@nowhere.com>
Subject: help with floats in calling C from perl
Message-Id: <cNlu3.18$Ta5.1112@sapphire.mtt.net>

Is there a problem with using floats as a parameter in a C function that you
plan on calling from perl?

I have the problem where it appears that in the function, when it gets the
parameters, it gets the incorrect size for the float hence both it and the
parameter after it are messed up.

Also, where can I find some good examples of dealing with C structures with
perl

Jason




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

Date: Tue, 17 Aug 1999 21:45:53 GMT
From: Amonotod <amonotod@netscape.net>
To: Andres.Magi@microlink.ee
Subject: Re: How to count clicks to HTML link.
Message-Id: <7pcl6e$luh$1@nnrp1.deja.com>

In article <37A067FC.D761A847@microlink.ee>,
  andres <Andres.Magi@microlink.ee> wrote:
>   How to solve problem to count clicks on certain links(pointing out
of
> my site) on my website?
>
> Andres
>
>


Try this...
http://www.geocities.com/SiliconValley/Circuit/8340/my_redir_solution.ht
ml
--keep in mind that you'll have to add an extra s/// or two in order to
deal with sub-directories.

Let me know what you think...
--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Tue, 17 Aug 1999 17:25:48 -0500
From: Gregg Palmer <gpalmer@interaccess.com>
Subject: Insecure dependency message with SGID script
Message-Id: <37B9E16C.6849FA56@interaccess.com>

Hi,
 we're trying to run a setgid script, and getting the following error:
Insecure dependency in symlink while running setgid at
/usr/local/bin/linkmail.pl.
The linkmail.pl is called from a C wrapper, and we get the error when we
try to run the script reaches the symlink call. All it does is create a
symbolic link to another file.
Any ideas/help would be appreciated.

Gregg Palmer




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

Date: Tue, 17 Aug 1999 21:27:04 GMT
From: mrdster@my-deja.com
Subject: IO::Socket::INET - determining if listener is still active without croaking
Message-Id: <7pck2n$l2r$1@nnrp1.deja.com>

I have a perl client program that connects to a listener
server and sends data via tcp, using:

$server=IO::Socket::INET->new(PeerAddr=>$servername,PeerPort=>$port,Prot
o=>"tcp")

If the listener it is sending to stops, I want the client program
to gracefully sleep and try to reconnect.  The problem I am having is
that I can't find a dependable method of testing the connection
that doesn't fatally croak in the module itself.

On some systems the send method simply returns 0 or undef making
it very easy.  On other systems send croaks if the listener
server has stopped.  I found that trying the peeraddr method
before trying to send is a safe test on some systems, but now
I'm using it on a Solaris system that croaks on that method if
the server has stopped.

Anyone know of a dependable way to make this test without
causing a croak?  Thanks in advance for any response.

Tom Dexter


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


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

Date: Tue, 17 Aug 1999 14:22:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Language survey
Message-Id: <37B9D28C.41C7CEAB@mail.cor.epa.gov>

Bart Lateur wrote:
> 
> Tom Christiansen wrote:
> 
> >At the risk of advocacy, please spend 10 seconds on
> >
> >    http://www.recordingwebsite.com/language.html
> >
> >I have nothing to do with it; just came across it.
> 
> Thanks to this announcement here, the popularity of Perl in this poll
> has gone through the roof: 44%, 177 votes for 398 participants. The
> highest contendant is C with 37, 9%.

The thing I found the most interesting is that, while the
short-sighted authors of the quiz relegated Perl to the
procedural-language category only, the number of votes for
use of OO-language (as opposed to procedural) is far larger
than the sum of the votes for what they consider OO.  In
fact, a quick check of the tallies indicates that a lot
of the Perl-voters had to have marked OO instead of procedural.
In the words of Randal, "heh".

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 17 Aug 1999 14:27:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: New Perl related Newsgroup, alt.comp.perlcgi.freelance
Message-Id: <37B9D3B7.5A4DFC64@mail.cor.epa.gov>

Jonathan Stowe wrote:
> 
> Tomh <fetchNOhmSPAM@fetchound.com> wrote:
> >
> > Hi,
> >
> > There is a new perl/cgi related usenet group called,
> > alt.comp.perlcgi.freelance.
> >
> 
> Oh my word !!!!

Hey, this is *perfect*.  Think of all the times you wished
you could point someone to another perl group when the
question was:

[1] Can I get a free script that does X?
[2] Can I get a free CGI script that does Y and Z?
[3] Can someone fix this Perl/CGI script that was written by W
    but isn't supported [so it must be up to you to do so]?
[4] You people are so *mean* to poor little me, but where
    else could I ask but here?
[5] Can someone write me a program to do T, U, and V,
    with error-checking and threads, by Monday?
[6] The CGI script written by S doesn't work!  What's wrong?


Note the 'accidental' use of W and S in the given places.  :-)
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 17 Aug 1999 17:35:00 -0400
From: Gary Segler <gary.segler@bms.com>
Subject: Perl Help
Message-Id: <37B9D584.272CAEB1@bms.com>

HI --

I have a small problem.  I would like to print out numbers from
my PERL script using commas as the thousand separators but I
don't know how.  Is the a "printf" statement I can use or another
simple way?

Thanks!

Gary



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

Date: 17 Aug 1999 17:54:01 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl Help
Message-Id: <x7btc6ysxy.fsf@home.sysarch.com>

>>>>> "GS" == Gary Segler <gary.segler@bms.com> writes:

  GS> I have a small problem.  I would like to print out numbers from
  GS> my PERL script using commas as the thousand separators but I
  GS> don't know how.  Is the a "printf" statement I can use or another
  GS> simple way?

ever think that this is not the first time this has been asked? check
the FAQ that comes with your perl distribution. it might be in there.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Tue, 17 Aug 1999 14:47:56 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Perl Help
Message-Id: <MPG.1223786980ae41b09896bf@nntp1.ba.best.com>

Gary Segler (gary.segler@bms.com) seems to say...
> I have a small problem.  I would like to print out numbers from
> my PERL script using commas as the thousand separators but I
> don't know how.  Is the a "printf" statement I can use or another
> simple way?

One way would be to search Deja news, as this question was just asked.

Or another way would be to read the faq

% perldoc -q commas

Found in perlfaq5.pod
  How can I output my numbers with commas added?





-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Tue, 17 Aug 1999 16:59:38 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Perl Help
Message-Id: <37B9DB4A.62CA51A2@texas.net>

Gary Segler wrote:
> 
> HI --
> 
> I have a small problem.  I would like to print out numbers from
> my PERL script using commas as the thousand separators but I
> don't know how.  Is the a "printf" statement I can use or another
> simple way?
> 
> Thanks!
> 
> Gary

perlfaq5


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

Date: Tue, 17 Aug 1999 18:47:14 -0400
From: Frankie Thomason <frankie@toad.net>
Subject: Perl on Netware 5 question
Message-Id: <37B9E671.DEE7540C@toad.net>

I'm running the Novonyx (Netscape) Enterprise Web Server 3.51 on Netware
5 and am having trouble getting any file upload perl script to work.
I've tried 2 or 3 different Perl scripts that receive the file and write
it to the server.  They work fine for text files but binary files don't
work at all .  The problem seems to be in receiving the file.  The
$ENV{'CONTENT_LENGTH'} will be, say, 10000 but the amount of data read
from STDIN is only 800 bytes.  The same scripts work fine on NT.
  Has anyone run across anything like this?  Or know what could be
causing it?

Thanks,
Frank Thomason
EDAW, Inc



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

Date: Tue, 17 Aug 1999 20:59:50 GMT
From: Jim Williams <james.p.williams@usahq.unitedspacealliance.com>
Subject: Re: problems creating and saving to file...
Message-Id: <7pcifu$jno$1@nnrp1.deja.com>

In article <7pccgg$t30$1@cfs2.kis.keele.ac.uk>,
  "Andrew Weller" <p8e77@keele.ac.uk> wrote:
> Dear all,
>
> I am trying to open a new file that doesn't exist and write to that
> file - this is the current code I am using:
>
>   open (OUT, $filename)...

As you can learn by reading the output of "perldoc -f open", your
$filename should be preceded by ">" if you want to open for writing.

   open(OUT,"> $filename")...

Without seeing more code, I can only guess that this is the problem.  If
you don't adorn $filename with anything, "<" is assumed, meaning open an
existing file for reading, which should explain your error message.
Again, read "perldoc -f open".

Jim Williams


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


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

Date: Tue, 17 Aug 1999 21:00:18 GMT
From: Jim Williams <james.p.williams@usahq.unitedspacealliance.com>
Subject: Re: problems creating and saving to file...
Message-Id: <7pcigp$jp7$1@nnrp1.deja.com>

In article <7pccgg$t30$1@cfs2.kis.keele.ac.uk>,
  "Andrew Weller" <p8e77@keele.ac.uk> wrote:
> Dear all,
>
> I am trying to open a new file that doesn't exist and write to that
> file - this is the current code I am using:
>
>   open (OUT, $filename)...

As you can learn by reading the output of "perldoc -f open", your
$filename should be preceded by ">" if you want to open for writing.

   open(OUT,"> $filename")...

Without seeing more code, I can only guess that this is the problem.  If
you don't adorn $filename with anything, "<" is assumed, meaning open an
existing file for reading, which should explain your error message.
Again, read "perldoc -f open".

Jim Williams


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


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

Date: 17 Aug 1999 15:07:16 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Q:Two perl programs printing to one txt file
Message-Id: <xkfd7wmjeuz.fsf@valdemar.col.hp.com>

Makarand Kulkarni <makkulka@cisco.com> writes:
> > Opening the file in each program to append is all that is necessary.  The
> > seek is unnecessary.
> 
> Yes. Only if you assume that you want to do a single append and immediately
> after opening the file.

No, it's unnecessary at all times.  Opening a file for append means that
the underlying C library always writes all data to the end of the file.
That is, even if you open it as "+>>file", no matter where you're reading 
from, the data is always written at the end of the file.  There is an
implicit seek(), if you like.

-=Eric


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

Date: Tue, 17 Aug 1999 22:35:47 GMT
From: danmex@my-deja.com
Subject: Re: Q:Two perl programs printing to one txt file
Message-Id: <7pco42$o5f$1@nnrp1.deja.com>

In article <MPG.1223557f518c6032989e62@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:
> In article <37B9A20F.2E2F08D9@cisco.com> on Tue, 17 Aug 1999 10:55:28
-
> 0700, Makarand Kulkarni <makkulka@cisco.com> says...
> > [ danmex@my-deja.com wrote:
> >
> > > I have a problem: there are two perl programs that append to the
same
> > > TXT file, but when both of them try to do it at the same time the
TXT
> > > file end all messed up.
> > > Is there any way for the programs to "take turns" or to know that
the
> > > other program is not finished and wait until its done?
> > > Could you point me to a script that has some example code?
> >
> > You need to lock the file and seek to the end before attempting
> > to do a write to the file. Read perldoc -f   flock.
> > There is some sample code also.
>
> We have been over this several times alread.  Opening the file in
each
> program to append is all that is necessary.  The seek is unnecessary.
>
> Locking isn't really necessary, but cannot hurt.  The OS guarantees
that
> each append to the file is atomic, but it needn't be a complete line,
if
> that matters.  So interleaving of line fragments is possible if the
file
> isn't locked by each writer.
>
> See, for example,
> <URL:http://x30.deja.com/[ST_rn=ps]/getdoc.xp?AN=503630547>
>

Thank you very much for your help, yes that is what happens, both
programs are able to append to the file, but some times one of the
lines contains output from both programs.

I understand I must use some locking mechanism, and a new question
comes to mind: what is a good/correct way for one of the programs "to
wait" until the file is unlocked? A while-loop? A sleep?.

And another: Is there any way for the programs to "get in line"? I.E.:
Program 1 is writing, program 2 is waiting and enters a whileloop,
program 3 is also waiting and entes a whileloop. I'd like program 2 to
get at the file first, but the whileloop does not guarantee program 3
will let that happen?

Thank's again for the comments and examples.
Dan


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


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

Date: Tue, 17 Aug 1999 14:33:29 -0700
From: "Ritche Macalaguim" <ritche@san.rr.com>
Subject: Sending a Page using Perl ???
Message-Id: <NBku3.6447$K8.131448@newsr1.san.rr.com>

Hi everyone,

Is there a way to invoke the following URL using Perl?

http://www.skytel.com/cgi-bin/page.pl?to=NNNNNNN&pager=1&message=test+my+mes
sage

Thanks,
Ritche Macalaguim
ritche@san.rr.com






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

Date: Tue, 17 Aug 1999 14:51:55 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Sending a Page using Perl ???
Message-Id: <37B9D97B.FF42068A@cisco.com>

[ Ritche Macalaguim wrote:

> Is there a way to invoke the following URL using Perl?

If you want to grab the page at that URL then --
--
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$request = new HTTP::Request('GET', 'http://www.oracle.com/' );
$response = $ua->request($request);
print $response->as_string();
--



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

Date: Wed, 18 Aug 1999 00:33:33 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Sending a Page using Perl ???
Message-Id: <Pplu3.809$TV4.10155@news1.online.no>


Makarand Kulkarni <makkulka@cisco.com> wrote in message
news:37B9D97B.FF42068A@cisco.com...
> [ Ritche Macalaguim wrote:
>
> > Is there a way to invoke the following URL using Perl?
>
> If you want to grab the page at that URL then --
> --
> use LWP::UserAgent;
> $ua = new LWP::UserAgent;
> $request = new HTTP::Request('GET', 'http://www.oracle.com/' );
> $response = $ua->request($request);
> print $response->as_string();
> --

or you can use LWP::Simple

--------8<-----------
#!/path/to/perl -w
use LWP::Simple;
getprint ('http://www.perl.com/');
--------8<-----------


--
Trond Michelsen





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

Date: Tue, 17 Aug 1999 21:20:42 GMT
From: dgold1@my-deja.com
Subject: Spell Checker
Message-Id: <7pcjmq$ko3$1@nnrp1.deja.com>

I need to spell check a text box control on a form. Is there a PERL
solution avaliable that I can run on the Unix server?


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


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

Date: Tue, 17 Aug 1999 22:01:13 GMT
From: one1999@my-deja.com
Subject: SSI commands appear in perl webbrowser
Message-Id: <7pcm32$mhn$1@nnrp1.deja.com>

Hi,

I am programming a small perl webbrowser to measure the time of the
parts in the page downloading process (DNS lookup, first byte, rest of
the page etc.), but I see the SSI commands as they are. They are not
executed.

By the way the same happens when I download a page with telnet on port
80.

Do you know what I have to change to see the HTML code like an ordinary
browser?


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


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

Date: 17 Aug 1999 22:43:41 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: SSI commands appear in perl webbrowser
Message-Id: <slrn7rjpct.vqb.M.Ray@carlova.ulcc.ac.uk>

On Tue, 17 Aug 1999 22:01:13 GMT, one1999@my-deja.com <one1999@my-deja.com>
wrote:
>Hi,
>
>I am programming a small perl webbrowser to measure the time of the
>parts in the page downloading process (DNS lookup, first byte, rest of
>the page etc.), but I see the SSI commands as they are. They are not
>executed.
>
>By the way the same happens when I download a page with telnet on port
>80.

Then it's clearly not a problem in your Perl program!

>Do you know what I have to change to see the HTML code like an ordinary
>browser?

SSI stands for 'server-side includes'.  So, handling those SSI directives
is a function of the web server.  So you should ask on a newsgroup
devoted to the configuration of the particular web server in question.
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Tue, 17 Aug 1999 13:27:41 -0800
From: Marc Grober <marc@interak.com>
Subject: Re: statistical sorts
Message-Id: <37B9D3CD.DDE13E62@interak.com>

For example, if sampling of a,population produces a specific curve showing the
incidence of scores on a certain protocol and I want to then produce subsets of
that sample with the same distribution I need to distribute members of the
original sample such that all the subsets reflect the same statistical curve.

Ronald's suggestion only works where the premise is that each subgroup must have
the same actual distribution of every score. The. problem is that I am dealing
with a curve, meaning that I want to maintain the distribution where the actual
scoroes in each group may be different but where the distributiona; curve is the
same.

TO do that I need to develop a model of the population (that is pretty standard
statistical stuff....., though I am still not sure about working with the stat
modules in CPAN yet) , then use some kind of linear/fuzzy approximation to
successively refine the subsets until they all match the statistical
distribution originally produced.....

I suppose I can first group the scores in the general popualtion so as to
obtain  enough scores at any level to do an approximate disytribution across the
subgroups. I had initially planned to distribute from one extreme to another,
reordering the subgroups after each round of distribution so that no one group
would receive the highest or lowest distribuition for that "hand", but this
would run into the same kinds of issues, that being that there's nho guarantee
that this process will maintain mean, mode, medians etc.

Since this kind of process would arguably be used commonly in research, I
thought someone might have built something that computed SDs for each score and
then dealt out the subgroups based on the SDs or some such

Ronald J Kimball wrote:

> That shouldn't be too hard.  For each group, add N elements for each
> possible value of the characteristic, where N is the distribution of
> that value in the full population, multiplied by the desired size of the
> group being created.
>
> --



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

Date: 17 Aug 1999 21:41:35 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: statistical sorts
Message-Id: <7pckuf$6nj$1@news.NERO.NET>

In article <37B9D3CD.DDE13E62@interak.com>,
Marc Grober  <marc@interak.com> wrote:
>For example, 

Example of what? You haven't said anything to be an example of yet.

>if sampling of a,population produces a specific curve showing the
>incidence of scores on a certain protocol and I want to then produce subsets of
>that sample with the same distribution I need to distribute members of the
>original sample such that all the subsets reflect the same statistical curve.

No, you simply must sample the sample randomly. For example, if your
sample is 1,2,2,2,3, then a random selection from that sample has a 3/5
chance of being 2, and 1/5 each of being 1 or 3. That is the same
distribution you started with, assuming your initial sampling was valid.

>Ronald's suggestion 

Who?

>TO do that I need to develop a model of the population (that is pretty standard

Ok.



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

Date: Tue, 17 Aug 1999 15:42:56 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: statistical sorts
Message-Id: <37B9E570.EF16C251@mail.cor.epa.gov>

[BTW Marc, your line lengths are way too long.  It was misery
trying to read this.  72 characters is standard.  Okay?]

Marc Grober wrote:
> 
> For example, if sampling of a,population produces a specific curve showing the
> incidence of scores on a certain protocol and I want to then produce subsets of
> that sample with the same distribution I need to distribute members of the
> original sample such that all the subsets reflect the same statistical curve.

So you just want to do a standard probabilistic sampling technique
some sort.  If you want simple random sampling [with or without
replacement], then you can do all this with the rand() function
and no modules at all.

And what is your population anyway?  You talk of selecting numbers,
but are you really sampling from a population, or are you starting
from some subset of the real population already?  And if the answer
is 'subset' in any way, shape or form, then how can you assure that
your starting data set is really representative of your intended
[i.e. target] population?
 
> Ronald's suggestion only works where the premise is that each subgroup must have
> the same actual distribution of every score. The. problem is that I am dealing
> with a curve, meaning that I want to maintain the distribution where the actual
> scoroes in each group may be different but where the distributiona; curve is the
> same.

No, that is not correct.  I don't think you understand what
Mister Kimball intended.

And if you have definable subgroup with different population
characteristics, how are you going to control this?  Stratified
sampling?  Hierarchical randomization?  Post-stratification
procedures?
 
> TO do that I need to develop a model of the population (that is pretty standard
> statistical stuff....., though I am still not sure about working with the stat
> modules in CPAN yet) , then use some kind of linear/fuzzy approximation to
> successively refine the subsets until they all match the statistical
> distribution originally produced.....

No no no!  Please don't do that!  You'll totally louse up the
randomness of your sample if you keep jerking it around like
that.
 
> I suppose I can first group the scores in the general popualtion so as to
> obtain  enough scores at any level to do an approximate disytribution across the
> subgroups. I had initially planned to distribute from one extreme to another,
> reordering the subgroups after each round of distribution so that no one group
> would receive the highest or lowest distribuition for that "hand", but this
> would run into the same kinds of issues, that being that there's nho guarantee
> that this process will maintain mean, mode, medians etc.

No.  A simple random sample will return a sample which *by*
*definition* is representative of the population, with
a definable probabilistic interpretation.  If you understand
sampling then you will understand that the sample mean (or mode
or median or whatever) is an estimate of the population
parameter.  Not the exact value.

 
> Since this kind of process would arguably be used commonly in research, I
> thought someone might have built something that computed SDs for each score and
> then dealt out the subgroups based on the SDs or some such

There is a module that does descriptive statistics like sd
and mean.  But those are so easy it's hardly worth your
trouble to use a module.

I'm rather concerned by your thoughts on sampling.  Would
you like to e-mail me some specifics on your problem, or
perhaps take this problem to sci.stat.consult?

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 17 Aug 1999 14:29:26 -0700
From: moseley@best.com (Bill Moseley)
Subject: wasted memory
Message-Id: <MPG.1223740f658e39de9896be@nntp1.ba.best.com>

Am I using a lot of memory, or is it being released?

sub return_formatted_data {
    my $file_name = shift;

    my $formatted_text;

    [extract data out of $file_name and format]

    return \$formatted_text;
}


# read and extract data from 5000 files

foreach my $file ( @a_bunch_of_files ) {
   my $text = return_formatted_data( $file );

   print "-- $text --\n";
}

When does $formatted_text's memory get released?  After each loop?  When 
the foreach loop exits?  End of program?  Would it be better to pass a 
scalar to fill such as return_formatted_data( $file, \$text )?

Thanks,



-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Tue, 17 Aug 1999 15:35:53 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: wasted memory
Message-Id: <37B9E3C9.5B8E1360@cisco.com>

[Bill Moseley wrote:

> Am I using a lot of memory, or is it being released?
> sub return_formatted_data {
>     my $file_name = shift;
>     my $formatted_text;
>     [extract data out of $file_name and format]
>     return \$formatted_text;
> }
> # read and extract data from 5000 files
> foreach my $file ( @a_bunch_of_files ) {
>    my $text = return_formatted_data( $file );
>    print "-- $text --\n";
> }
> When does $formatted_text's memory get released?  After each loop?

Once $text gets assigned the next reference in the loop the earlier
chunk of memory held by $formatted_text is ready for reclaiming.

>  Would it be better to pass a
> scalar to fill such as return_formatted_data( $file, \$text )?

No. Memory requirements would be the same whether
you returned a ref from the subroutine or passed a ref
to a scalar to be filled out.
--



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

Date: Tue, 17 Aug 1999 15:50:49 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: wasted memory
Message-Id: <37B9E749.3B4DEE8A@cisco.com>

[
Bill Moseley wrote:

> When does $formatted_text's memory get released?  After each loop?

After each loop actually.  Earlier I missed the fact that you had $text
declared with my (). If $text was declared outside the foreach() loop
then what I said earlier would have been true.
--



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

Date: Wed, 18 Aug 1999 09:51:02 +1300
From: rodgerd@csrodgerd4.wnl.co.nz ()
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7rjmpg.kq.rodgerd@csrodgerd4.wnl.co.nz>

On Wed, 11 Aug 1999 09:19:32 -0400, Ala Qumsieh <aqumsieh@matrox.com> wrote:
>
>wvenable_net@iname.com (Wayne Venables) writes:
>
>>   Perl orginally drove me absolutely insane; it took me a few weeks
>> (as I'm sure it takes everyone) to really get a feel for it.
>
>You're wrong there.
>I loved Perl just after reading the first few pages in the Llama
>(that's the Foreword by lwall).

<AOL> Me too!

Perl is fun.  That's something I can't sayfor any other language I've used.
Excepting English.

-- 
Rodger Donaldson			rodger.donaldson@wnl.co.nz
Systems Support				Direct line	: 04 474 0560
Wellington Newspapers Limited		Fax		: 04 474 0309
You are in a maze of twisty little companies, all working against each other.


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

Date: Tue, 17 Aug 1999 18:28:25 -0400
From: "J Nicholas Tolson" <jtnt@nospammindspring.com>
Subject: Re: writing an html file into another html file
Message-Id: <7pcnmc$h1v$1@nntp4.atl.mindspring.net>

Hmmm...I don't think I have enough PERL experience for this to help. Thanks,
though.

A very nice person from another forum gave me a very small (4 lines) PHP
script that would do exactly what I want, if my SYSOP could install PHP on
the server before my deadline. Of course, he doesn't have the time.

So, I am still looking for help. I will put the php script here, in case
someone can use this as a guide for a PERL script that does the same thing.
It must be rather simple, I just don't know PERL.

Here's the PHP script:

<? if($i !="") {
  $i .= ".html";
  include $i;
  }?>

This is just called through the URL of the template with the name of
whatever I want to go into this template after the '?'.(e.g.
www.mysite.com/index.phtml?myarticle, where myarticle is a file called
myarticle.html)

Hope somebody can hook me up. Big gladness to anyone that can!



jtnt


----------
In article <37B6516F.B1BB498B@yahoo.com>, Shmooth <shmooth@yahoo.com> wrote:


> I just picked-up the text::basictemplate and text::template modules from CPAN
> (http://www.perl.com/CPAN/modules/by-module/Text/).  You'll see a README and
the
> distribution (usually a filename.tar.z) for each module.  Download the module
> and unpack it using the FAQ's linked-to off of www.perl.com.  This is for a
> perl-cgi-template soln.
>
> The way (I think) it works is you write a simple cgi/perl script that gets
> called when user clicks something and the script decides which 'template' file
> to parse (depending on a filename (or set of) you've given), then decides what
> to fill-in variables you've declared in the template.  So it's kinda like
server
> side includes except a script has to be called to fill-in the article.
>
> Or, if you can use the 'exec' (or maybe 'cgi'??) arguments for your server
side
> include tags, then you could say something like:
> <!--#exec file=insert.pl <optional_args> -->')   =>excuse the syntax here
> The insert.pl script will be called before the file is sent to the browser and
> you'll have to write insert.pl such that is prints to STDOUT whatever article
> text/html you wish to appear.
>
> JT Nicholas Tolson wrote:
>
>> I've tried to do this with javascript and server-side includes, but because
>> of the order in which things are processed, this didn't work. Here's my
>> situation.
>>
>> What I have is many HTML templates for news articles, and then many html
>> article files. What I want to do is put in a certain article file into a
>> certain template on the fly. This way, I just create one template file for
>> each section, and one article file, then place this article file into
>> whatever template I need to.
>> Then, if I want to put the same article in a different template, I don't
>> have to create another page, I just slap the same article file into a
>> different template file.
>>
>> To give you an idea of what I was trying to do, here's the javascript I was
>> using (disregard any possible syntax errors in this):
>>
>> function writeSSI() {
>>
>> searchstr = location.search.substring(1)
>> include = ('<!--#include virtual=\"/' + searchstr + '.html\"-->')
>> document.write(include)
>>
>> }
>>
>> Then I call this function wherever I want the article to appear, but for the
>> reason I mentioned earlier, this doesn't work.
>>
>> Any suggestions? BTW, excuse any ignorance of cgi/perl here, since I am
>> below novice level.
>>
>> Thanks in advance.
>>
>> jtnt
>> nicholas@edesigninc.com
> 


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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