[17050] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4462 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 28 18:10:35 2000

Date: Thu, 28 Sep 2000 15:10:20 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970179020-v9-i4462@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 28 Sep 2000     Volume: 9 Number: 4462

Today's topics:
    Re: Is this routine OK? <rick@iwtools.com>
    Re: Is this routine OK? (Arthur Darren Dunham)
    Re: Is this routine OK? <lr@hpl.hp.com>
    Re: MySQL vs. mSQL <gellyfish@gellyfish.com>
    Re: MySQL vs. mSQL <gellyfish@gellyfish.com>
        need help on a small cgi thank u sendkeys@my-deja.com
    Re: newbie - flushing content to the browser <dsimonis@fiderus.com>
    Re: newbie - flushing content to the browser (Jerome O'Neil)
    Re: newbie - flushing content to the browser scottfreez@my-deja.com
    Re: Newbie question about files <lr@hpl.hp.com>
    Re: Newbie question about files (Arthur Darren Dunham)
    Re: Newbie question about files (Abigail)
    Re: Newbie question about files <lr@hpl.hp.com>
    Re: Newbie question about files (Richard J. Rauenzahn)
    Re: OT: Newbie windows perl question <lr@hpl.hp.com>
    Re: OT: Newbie windows perl question <jeffp@crusoe.net>
        Perl on 64-bit platform <Jean_BrunoYAYAKA@compuserve.com>
    Re: Perl on PWS on Win ME <jim@usjet.net>
    Re: Perl on PWS on Win ME <brian+usenet@smithrenaud.com>
        Perl Regex vlad_the_impaler24@my-deja.com
    Re: Perl Regex (Craig Berry)
    Re: Perl vs. PHP/Java <mauri@unixrulez.org>
        Q: inverse mirror script (publish) using ftp??? (Michael Friendly)
    Re: Q: inverse mirror script (publish) using ftp??? <uri@sysarch.com>
    Re: Question about fork/exec (Richard J. Rauenzahn)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 28 Sep 2000 12:20:45 -0700
From: "Rick Freeman" <rick@iwtools.com>
Subject: Re: Is this routine OK?
Message-Id: <hu57tskfqj77ak6gh6pml7c59ienb6d4jk@4ax.com>

On Wed, 27 Sep 2000 17:42:52 -0500, "Andrew N. McGuire "
>RF>     open(HANDLE, "$file");
>                     ^     ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>        open(HANDLE, $file) || die "can't read $file: $!\n";
>
>  The biggest thing wrong I see is that in several critical places you have
>thrown error-checking by the wayside.  The above quote is one of them. Also
>in the above quote, the quotes around $file are superfluous.  The question
>you have to ask yourself is what can you not afford to have fail in your
>script (open, unlink, flock, ...).  Error check those things that you can't
>afford to have fail, or would like to be notified about.  If in doubt, check 
>for errors. 

Thanks Andrew and everyone else.  The reason for no  || die on that
like is that the file doesn't always exist and the routine should
return an empty list.

Thanks, too for the perldoc referral Tim.  I'll study those.

And thanks, Brian, for the datadumper idea.  Sometimes I just like to
do ity myself :-)  I end up copying and pasting these routines into a
lot of different scripts, and often they are slightly modified to meet
application-specific needs (odd comment tags in the file, etc.).

I'm really interested in hearing if anyone has any real-life
commentary on the following lines (I probably included too much in my
earlier post):

    open(FILE, ">$filename.tmp") or die("Write_out couldn't open file,
                $filename. $!");
    flock FILE, 2;
    print FILE $out;
    close(FILE);

    copy("$filename.tmp", "$filename") or die("Write_out couldn't copy
               file, $filename.tmp $!");

    unlink("$filename.tmp");

Am I safe doing it like this?  Is there a better "idiom"?  I tend to
program in isolation and don't spend as much time looking at other
peoples' code as I should.  Sometimes I'll run across something that
everyone else seems to know and say, "Damn, why aren't I doing it that
way!"  

My questions are... Is the way I'm doing this safe?  Is it
accomplishing what I want -- minimal risk of concurrent access
problems?

Could there be a risk between the close(FILE) and the copy?  Should I
move the close after the copy?

Rick

- - - - - - - - - - - - - - - - - - - - - - - - - - - 
Rick Freeman
System Analyst
Resmatic, Inc. 
Internet Recruiting from Start to Finish 
http://www.resmatic.com 
tel 415-246-1187


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

Date: 28 Sep 2000 20:49:01 GMT
From: add@netcom.com (Arthur Darren Dunham)
Subject: Re: Is this routine OK?
Message-Id: <8r0art$sbf$1@slb1.atl.mindspring.net>

In article <hu57tskfqj77ak6gh6pml7c59ienb6d4jk@4ax.com>,
Rick Freeman <rick@iwtools.com> wrote:
>On Wed, 27 Sep 2000 17:42:52 -0500, "Andrew N. McGuire "
>>RF>     open(HANDLE, "$file");
>>                     ^     ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>        open(HANDLE, $file) || die "can't read $file: $!\n";
>>
>>  The biggest thing wrong I see is that in several critical places you have
>>thrown error-checking by the wayside.  The above quote is one of them. Also
>>in the above quote, the quotes around $file are superfluous.  The question
>>you have to ask yourself is what can you not afford to have fail in your
>>script (open, unlink, flock, ...).  Error check those things that you can't
>>afford to have fail, or would like to be notified about.  If in doubt, check 
>>for errors. 
>
>Thanks Andrew and everyone else.  The reason for no  || die on that
>like is that the file doesn't always exist and the routine should
>return an empty list.
>
>Thanks, too for the perldoc referral Tim.  I'll study those.
>
>And thanks, Brian, for the datadumper idea.  Sometimes I just like to
>do ity myself :-)  I end up copying and pasting these routines into a
>lot of different scripts, and often they are slightly modified to meet
>application-specific needs (odd comment tags in the file, etc.).
>
>I'm really interested in hearing if anyone has any real-life
>commentary on the following lines (I probably included too much in my
>earlier post):
>
>    open(FILE, ">$filename.tmp") or die("Write_out couldn't open file,
>                $filename. $!");
>    flock FILE, 2;
>    print FILE $out;
>    close(FILE);

Race condition starts here...  The tmp file is unlocked..

>    copy("$filename.tmp", "$filename") or die("Write_out couldn't copy
>               file, $filename.tmp $!");
>
>    unlink("$filename.tmp");
>
>Am I safe doing it like this?  Is there a better "idiom"?  I tend to
>program in isolation and don't spend as much time looking at other
>peoples' code as I should.  Sometimes I'll run across something that
>everyone else seems to know and say, "Damn, why aren't I doing it that
>way!"  

I would generally lock both files (new and old), make sure both are in
the same directory, and while locked,

flush buffers
rename (not copy) current to old
rename new to current

Do error checking on both and attempt to back out "safely" if you run
into problems.

*after* you've renamed them, close the files.  That should be completely
safe on UNIX.  I don't know that it's possible on NT.  anyone?
--
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                               San Francisco Bay Area
      < Please move on, ...nothing to see here,  please disperse >


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

Date: Thu, 28 Sep 2000 14:47:11 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Is this routine OK?
Message-Id: <MPG.143d5c375d0127a498add8@nntp.hpl.hp.com>

In article <8r0art$sbf$1@slb1.atl.mindspring.net> on 28 Sep 2000 
20:49:01 GMT, Arthur Darren Dunham <add@netcom.com> says...

 ...

> *after* you've renamed them, close the files.  That should be completely
> safe on UNIX.  I don't know that it's possible on NT.  anyone?

You can neither rename nor delete an open file on a Windows/DOS system.

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


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

Date: 27 Sep 2000 21:35:28 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: MySQL vs. mSQL
Message-Id: <8qtlmg$6n7$1@orpheus.gellyfish.com>

On Tue, 26 Sep 2000 19:05:07 -0700 Jeff Zucker wrote:
> 
> Also, it doesn't make sense to ask which database is "better".  Better
> for what?  Which beverage is better -- coffee or brandy?  At 8am I'll
> take the coffee, no questions asked.  At 8pm, that's a different story.
> 

You obviously weren't at yapc::Europe ;-}

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 27 Sep 2000 21:48:01 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: MySQL vs. mSQL
Message-Id: <8qtme1$6o4$1@orpheus.gellyfish.com>

On Wed, 27 Sep 2000 15:10:54 GMT Mark-Jason Dominus wrote:
> In article <vel3tss8mrnigj46lp8vcq8ob2asmklkem@4ax.com>,
> Bart Lateur  <bart.lateur@skynet.be> wrote:
>>PostGreSQL has transactions. MySQL does not. If it's important that your
>>data remains integer while being updated by more than just a few people
>>simultaniously, that probably will matter. 
> 
> No, that's untrue.  You are correct that MySQL has no transactions.
> But it doesn't need them because it does not have concurrent updates
> of the database; only one query executes at a time.
> 
> This brings with it many other disadvantages, but data corruption is
> not one of them.
> 

And those disadvantages include the fact that it is impossible to ensure
that multitable or multirow updates are finished in their entirety or
not at all - and yes I know that this things *could* be done in owns
one code or that MySQL is moving toward transactions experimentally but
with really critical stuff you're just not going to be able to justify
the risk to the PHBs (or yourself).  More on this can be found via Deja.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Thu, 28 Sep 2000 21:17:53 GMT
From: sendkeys@my-deja.com
Subject: need help on a small cgi thank u
Message-Id: <8r0chn$ojp$1@nnrp1.deja.com>

hi all here is the cgi im using

#!/usr/bin/perl
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $q = new CGI;
my $dir = substr($ENV{'REQUEST_URI'},30);
my $file = $q->param("FILENAME");
print $q->header(),<<FRM_B;
<html><body>
<h3 align=center>You can upload your file to server:</h3> <form
method="post" enctype="multipart/form-data"> <input type="file"
name="FILENAME" size="40" > <input type="submit" value="Send">
</form>
<hr>
FRM_B
if ($file =~ m{[\w\-\.]+$}){
my $to = $&;
open(TO,">$dir/$to") || die $!;
binmode TO;
print TO <$file>;
close TO;
print "<h3 align=center>File $to was uploaded successfuly</h3>\n"; }
print "There are following files on the server:<br>\n<ul>",       map
{"<li>$_\n"} <$dir/*>;
print "</ul></body></html>";



just a basic upload file cgi  it all works but my main problem is i
can't delete the files after i make them. when i try i get a Permission
denied. and when i try to set to files to 777 i get a "Permission
denied" so im guessing the script hasnt stopped running but i have no
way to tell.if the script is running is there some why of telling? its
on a unix server and i can use telnet. any help would be great thank
you very much.


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


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

Date: Thu, 28 Sep 2000 13:56:34 -0400
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: newbie - flushing content to the browser
Message-Id: <39D38652.6B2E023E@fiderus.com>

scottfreez@my-deja.com wrote:
> 
> Whatever........I guess the fact that the program is written in Perl
> has nothing to do with my reasons for posting it here? The question
> still remains if anyone cares to answer.
> 

*plonk*


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

Date: Thu, 28 Sep 2000 19:40:59 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: newbie - flushing content to the browser
Message-Id: <f9NA5.1410$Yc.239524@news.uswest.net>

scottfreez@my-deja.com elucidates:
> Whatever........I guess the fact that the program is written in Perl
> has nothing to do with my reasons for posting it here? 

That is exacly correct.  You would have the same problem if your
program were written in COBOL.  What does that tell you?

-- 
"Civilization rests on two things: the discovery that fermentation 
produces alcohol, and the voluntary ability to inhibit defecation.  
And I put it to you, where would this splendid civilization be without 
both?" --Robertson Davies "The Rebel Angels" 


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

Date: Thu, 28 Sep 2000 20:41:43 GMT
From: scottfreez@my-deja.com
Subject: Re: newbie - flushing content to the browser
Message-Id: <8r0ae5$mnc$1@nnrp1.deja.com>



> I see, you call yourself a newbie but you won't take an experienced
> user's advice on where to find the answer to your question.  That
bodes
> well.
> Here is the sum total of the Perl answer: put $|++ at the top of your
> script.  That does as much as Perl can do to flush the buffer
contents.
> If you want to find out why that will probably have very little impact
> on your users' experience, go to the group that Drew pointed you
towards
> because they are the ones who discuss the fact that buffering can be
> implemented by web servers, by proxies, by browsers and that therefore
> any flushing in the CGI script (whether it is Perl or not) is only a
> small part of the picture.
>
> > > > what causes the server/program(?) to flush the results? I'm
running
> > > > the program on IIS.
>
> That's a good question, but how IIS operates, and how servers flush or
> buffer data is a question for a newsgroup about servers and/or CGI,
not
> for a newsgroup about Perl.  One person has already posted a
misleading
> HTTPD related answer to your question.  But to even go into why their
> answer is misleading would take a detailed discussion of web serving
and
> that is better carried out in a place where web serving experts hang
> out.
>
> --
> Jeff
>

Advice taken... thanks a lot for the details.

scottfreez


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


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

Date: Thu, 28 Sep 2000 11:30:03 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie question about files
Message-Id: <MPG.143d2e09d76f605898add2@nntp.hpl.hp.com>

In article <slrn8t5s0n.48l.bernard.el-hagin@gdndev25.lido-tech> on 28 
Sep 2000 07:15:36 GMT, Bernard El-Hagin <bernard.el-hagin@lido-tech.net> 
says...
> On Thu, 28 Sep 2000 09:12:40 +0200, Glenn Vollsæter
> <a4232.vollsaeter@sporveien.oslo.no> wrote:
> >just wondering how to delete a file in Perl. I can't seem to find a suitable
> >function for this. I trust there is one!
> >
> >Can someone help me?
> 
> perldoc -f unlink

This is a Frequently Asked Question that isn't in the FAQ.

Might it not help to un-Unixify Perl further by adding yet another 
capability to 'delete EXPR':

  Note that the EXPR can be arbitrarily complicated as long as the final
  operation is a hash element, array element, hash slice, or array slice
  lookup:

So add that if the EXPR evaluates to a string, the string is taken to be 
the name of a file, and the operation is synonymous with unlink().  

Maybe someone can come up with some further clever semantics, to avoid 
the 'completely-synonymous' objection, as is the case with 'delete array 
element or slice'.  Maybe to do with the little-know fact that open 
files can be unlinked on Unix systems but cannot be deleted on non-Unix 
systems.  Hmmm... 

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


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

Date: 28 Sep 2000 20:40:04 GMT
From: add@netcom.com (Arthur Darren Dunham)
Subject: Re: Newbie question about files
Message-Id: <8r0ab4$l8a$1@nntp9.atl.mindspring.net>

In article <MPG.143d2e09d76f605898add2@nntp.hpl.hp.com>,
Larry Rosler  <lr@hpl.hp.com> wrote:

>Might it not help to un-Unixify Perl further by adding yet another 
>capability to 'delete EXPR':
>
>  Note that the EXPR can be arbitrarily complicated as long as the final
>  operation is a hash element, array element, hash slice, or array slice
>  lookup:
>
>So add that if the EXPR evaluates to a string, the string is taken to be 
>the name of a file, and the operation is synonymous with unlink().  
>
>Maybe someone can come up with some further clever semantics, to avoid 
>the 'completely-synonymous' objection, as is the case with 'delete array 
>element or slice'.  Maybe to do with the little-know fact that open 
>files can be unlinked on Unix systems but cannot be deleted on non-Unix 
>systems.  Hmmm... 

Ugh.. So if I've got my file in $file{'a'}, I couldn't do this..

So a user learns to do this...
delete 'bob';

Then they learn this...
$file = 'bob';
delete $file;

Then this...
$file[1] = 'bob';
delete $file[1];

Then one day they try this...
$file{a} = 'bob';
delete $file{a};  #whoops!!!
--
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                               San Francisco Bay Area
      < Please move on, ...nothing to see here,  please disperse >


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

Date: 28 Sep 2000 20:59:48 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Newbie question about files
Message-Id: <slrn8t7c7k.k0e.abigail@alexandra.foad.org>

Larry Rosler (lr@hpl.hp.com) wrote on MMDLXXXV September MCMXCIII in
<URL:news:MPG.143d2e09d76f605898add2@nntp.hpl.hp.com>:
__ 
__ This is a Frequently Asked Question that isn't in the FAQ.
__ 
__ Might it not help to un-Unixify Perl further by adding yet another 
__ capability to 'delete EXPR':
__ 
__   Note that the EXPR can be arbitrarily complicated as long as the final
__   operation is a hash element, array element, hash slice, or array slice
__   lookup:
__ 
__ So add that if the EXPR evaluates to a string, the string is taken to be 
__ the name of a file, and the operation is synonymous with unlink().  


If you're going to change delete, let it take a list as arguments, so we
can do:

    delete $hash -> {key}, 'file', @array [3 .. 5];

__ Maybe someone can come up with some further clever semantics, to avoid 
__ the 'completely-synonymous' objection, as is the case with 'delete array 
__ element or slice'.  Maybe to do with the little-know fact that open 
__ files can be unlinked on Unix systems but cannot be deleted on non-Unix 
__ systems.  Hmmm... 


    delete 'directory';   # Recursively deletes the entire directory;
                          # in list context, it returns the names of the
                          # files deleted.



Abigail
-- 
sub _ {$_ = shift and y/b-yB-Y/a-yB-Y/                xor      !@ _?
       exit print                                                  :
            print and push @_ => shift and goto &{(caller (0)) [3]}}
            split // => "KsvQtbuf fbsodpmu\ni flsI "  xor       & _


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

Date: Thu, 28 Sep 2000 13:59:05 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie question about files
Message-Id: <MPG.143d50f0db2e7baa98add6@nntp.hpl.hp.com>

In article <8r0ab4$l8a$1@nntp9.atl.mindspring.net> on 28 Sep 2000 
20:40:04 GMT, Arthur Darren Dunham <add@netcom.com> says...
+ In article <MPG.143d2e09d76f605898add2@nntp.hpl.hp.com>,
+ Larry Rosler  <lr@hpl.hp.com> wrote:
+ 
+ >Might it not help to un-Unixify Perl further by adding yet another 
+ >capability to 'delete EXPR':
+ >
+ >  Note that the EXPR can be arbitrarily complicated as long as the
+ >  final operation is a hash element, array element, hash slice, or
+ >  array slice lookup:
+ >
+ >So add that if the EXPR evaluates to a string, the string is taken to
+ >be the name of a file, and the operation is synonymous with unlink().  

 ...

+ Ugh.. So if I've got my file in $file{'a'}, I couldn't do this..
+ 
+ So a user learns to do this...
+ delete 'bob';
+ 
+ Then they learn this...
+ $file = 'bob';
+ delete $file;
+ 
+ Then this...
+ $file[1] = 'bob';
+ delete $file[1];

This would be wrong also.

+ Then one day they try this...
+ $file{a} = 'bob';
+ delete $file{a};  #whoops!!!

$file[1] is an array element.  $file{a} is a hash element.  $file is a 
string.

There are comparable distinctions on the use of variables as 
filehandles, based on the form of the expression, not on its value.

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


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

Date: 28 Sep 2000 20:58:54 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: Newbie question about files
Message-Id: <970174733.133952@hpvablab.cup.hp.com>

Larry Rosler <lr@hpl.hp.com> writes:
>
>This is a Frequently Asked Question that isn't in the FAQ.

Perhaps it should be added?

How do I remove/delete a file?

>Might it not help to un-Unixify Perl further by adding yet another 
>capability to 'delete EXPR':

*gulp*

How about just adding "If you want to delete a file, see unlink()" in
the delete function description?

Or maybe add a function called 'remove' that is the same as 'unlink'?

>So add that if the EXPR evaluates to a string, the string is taken to be 
>the name of a file, and the operation is synonymous with unlink().  

Only if Perl can add 'ununlink()' to my OS for when delete doesn't do
what it thought I wanted =-).

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Thu, 28 Sep 2000 11:07:22 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: OT: Newbie windows perl question
Message-Id: <MPG.143d28b07939978498add1@nntp.hpl.hp.com>

In article <jdBA5.406$Qz1.2504@newsfeed.slurp.net> on Wed, 27 Sep 2000 
23:12:48 -0700, Jim <merlinjb@pyramid.net> says...

 ...

> This code using CGI.pm can be shortened to:
> foreach $var ( param() ) {
>     $cgiVals{$var} = param($var);
> }
> 
> or even:
> 
> $cgiVals{$_} = param($_) for param();  #  =)

or even faster:

  @cgiVals{param()} = map param($_) => param();  #  =))

and Golfier (though the squeezed explicit loop is shorter):

  @cgiVals{+param}=map{param($_)}param;

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


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

Date: Thu, 28 Sep 2000 14:44:07 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: OT: Newbie windows perl question
Message-Id: <Pine.GSO.4.21.0009281443360.5957-100000@crusoe.crusoe.net>

On Sep 28, Larry Rosler said:

>> $cgiVals{$_} = param($_) for param();  #  =)
>  @cgiVals{param()} = map param($_) => param();  #  =))
>  @cgiVals{+param}=map{param($_)}param;

None of which do the right thing for 'a=b&a=c'.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/





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

Date: Thu, 28 Sep 2000 23:25:56 +0000
From: "J. B. YAYAKA" <Jean_BrunoYAYAKA@compuserve.com>
Subject: Perl on 64-bit platform
Message-Id: <39D3D383.5D506FE7@compuserve.com>

Hi Gurus,

I have tried to compile perl 5.6.0 on an 64 bit AIX  platform
(Escale T450 with RS64II processors).

I use ./Configure -D_USE_64_ALL

I got a 64-bit binary (which I have checked using file perl, which
 reported 64-bit AIX binary).

When I run make test, it fails on t/base/lex.t, test 7 reported NNNNN.5,

while it should report NNNNN (it was int(NNNNN+.5)

Does anybody know of that bug on the int() function ?

Any help would be appreciated.

--
==============================================================
Jean-Bruno YAYAKA
System Administrator
France Telecom/SERNIT
3, Rue du Gal de Larminat
94000 CRETEIL(FRANCE)
==============================================================





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

Date: Thu, 28 Sep 2000 14:37:58 -0500
From: Jim Gaasedelen <jim@usjet.net>
Subject: Re: Perl on PWS on Win ME
Message-Id: <39D39E16.7A7B9935@usjet.net>

If this is your personal computer and security is not a problem, then
open up
read, write, execute privileges on all the relevant directories (like
cgi-bin)
so that you can do http://localhost/cgi-bin and get a directory listing
to see
just what it is that is in there compared to what you think it is that
should be
in there. You may have to rename any files like index.htm(l) or
default.htm(l)
so they don't open automatically. You may also have to change security
to allow
directory listing. This is a great help in diagnosing these problems.

Daniel van den Oord wrote:
> 
> I have installed Microsoft Personal Webserver on Windows ME... This works
> just fine..
> After this I installed Perl 5.6 build 618 without installation problems...
> Though when I'm trying to excess
> http://daniel304/cgi-bin/filer.pl
> perl says
> 
> Can't open perl script ""C:\Inetpub\cgi-bin\filer.pl"": No such file or
> directory
> 
> This directory is correct and in a dos-box it does open this file
> correctly...
> I have granted executables and scripts in this dir..
> 
> Anybody knows what kinda problem this is.. except for a annoying one ?!?
> 
> Thanks


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

Date: Thu, 28 Sep 2000 16:46:11 -0400
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: Perl on PWS on Win ME
Message-Id: <brian+usenet-728235.16461128092000@news.panix.com>

In article <39D39E16.7A7B9935@usjet.net>, Jim Gaasedelen 
<jim@usjet.net> wrote:

> If this is your personal computer and security is not a problem, then
> open up
> read, write, execute privileges on all the relevant directories

security is always a problem no matter if its your personal 
computer or not.  there is no sense in doing it wrong on
purpose.

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


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

Date: Thu, 28 Sep 2000 19:15:06 GMT
From: vlad_the_impaler24@my-deja.com
Subject: Perl Regex
Message-Id: <8r05bi$hs5$1@nnrp1.deja.com>

Here is my problem, I am working on parsing a logfile, and the logfile
ouputs lines that have numbers like
1 2 3

I would like to take that and put \ in between the numbers so it ends
up being \1\2\3\, the numbers are always different, I would guess I
have to use Regex, but I am very new to it, does anyone know off the
top of their heads how to do this?

Thanks
Vlad


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


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

Date: Thu, 28 Sep 2000 21:24:22 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl Regex
Message-Id: <st7do6pnap7260@corp.supernews.com>

vlad_the_impaler24@my-deja.com wrote:
: Here is my problem, I am working on parsing a logfile, and the logfile
: ouputs lines that have numbers like
: 1 2 3
: 
: I would like to take that and put \ in between the numbers so it ends
: up being \1\2\3\, the numbers are always different, I would guess I
: have to use Regex, but I am very new to it, does anyone know off the
: top of their heads how to do this?

It's unclear exactly what you want.  If it is "replace any space with a
number on each side of it with a backslash", then:

  s/(?<=\d) (?=\d)/\\/g;

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Thu, 28 Sep 2000 18:44:28 GMT
From: Maurizio Cimaschi <mauri@unixrulez.org>
Subject: Re: Perl vs. PHP/Java
Message-Id: <bc20r8.p51.ln@HAL9000.jupiter.space>

Lucas <wstsoi@hongkong.com> wrote:

> I am not a Perl guy, I just want to ask, would FastCgi a good way for
> solve the problems about "resource loading" of Perl/CGI ?

http://perl.apache.org/

-- 
Ciao, Maurizio.


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

Date: 28 Sep 2000 20:39:21 GMT
From: friendly@hotspur.psych.yorku.ca (Michael Friendly)
Subject: Q: inverse mirror script (publish) using ftp???
Message-Id: <8r0a9p$clf$1@sunburst.ccs.yorku.ca>

I have a number of web sites I maintain from my local machine
using nsf mounts to the target real hosts.  I wrote a perl script
to compare directories/files here vs. there, and update any file
on the real host which had changed on my machine.  Because the 
remote host was mounted on my local file system, the script used
the standard unix/perl tools to
- make directories on the remote (mkdir)
- check filestamps
- compare file content s (cmp)
- copy newer files (cp)

The script is run nightly by cron, so I never had to worry...

Until now... that I will no longer be able to nsf mount the remote
hosts.  So, it seems I'll have to replace all those operations
with FTP.

I've seen lots of mirror scripts, but they all do the updating
from the remote to the local, whereas I need to update the remote
from the local machine.  Is there any such 'publish' script
out there I could use as a basis?

--
Michael Friendly     Email: friendly@yorku.ca (NeXTmail OK)
Psychology Dept
York University      Voice: 416 736-5115  Fax: 416 736-5814
4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA


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

Date: Thu, 28 Sep 2000 21:34:08 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Q: inverse mirror script (publish) using ftp???
Message-Id: <x7itrg6w1e.fsf@home.sysarch.com>

>>>>> "MF" == Michael Friendly <friendly@hotspur.psych.yorku.ca> writes:

  MF> I've seen lots of mirror scripts, but they all do the updating
  MF> from the remote to the local, whereas I need to update the remote
  MF> from the local machine.  Is there any such 'publish' script
  MF> out there I could use as a basis?

the one called 'mirror' can update in either direction. many many
features and options. unfortunately it is still in perl4 but it
works. they think keeping it compatible is worth it. not any more.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 28 Sep 2000 20:28:03 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: Question about fork/exec
Message-Id: <970172880.833349@hpvablab.cup.hp.com>

"Me@You.com" <Me@you.com> writes:
>background, the sql is completed, and the file is created!  I have gone
>through the Perl Cookbook, and "Learning Perl" (from where this code
>fragment was taken), but I am unable to find out why my program doesn't wait
>for the exec to finish...

Maybe you should also go through the entry for exec in the perlfunc
manpage?  I'll give you a hint -- '&' probably counts as a 'shell
metacharacter,' which is also why waitpid doesn't work.  I don't know
why your other exec doesn't create the file.

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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


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


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